---
updatedAt: 2025-07-11T10:49:13.000Z
agentTools:
  projectIndex: https://developers.kommo.com/llms.txt
---

# Add roles

This method allows to add multiple roles to the account

**Limitations**\
Method is available for users administrator rights only.

**Data type header when the request is successful**\
Content-Type: application/hal+json

**Data type header in case of an error**\
Content-Type: application/problem+json

### `status_rights` example

```json
"status_rights": [
                {
                    "entity_type": "leads",
                    "pipeline_id": XXXXXX,
                    "status_id": XXXXXXX,
                    "rights": {
                        "edit": "A",
                        "view": "A",
                        "delete": "A",
                        "export": "A"
                    }
                }
            ]
```

<br />

**Response parameters**\
Method returns a collection of created roles. The parameters are similar to the role list request parameters.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "kommo-api-references",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://{subdomain}.kommo.com",
      "variables": {
        "subdomain": {
          "default": "subdomain"
        }
      }
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {}
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/api/v4/roles": {
      "post": {
        "summary": "Adding roles",
        "description": "This method allows to add multiple roles to the account",
        "operationId": "adding-roles",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "RAW_BODY": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Role name"
                        },
                        "rights": {
                          "type": "object",
                          "description": "User rights. By default all access is restricted.",
                          "properties": {
                            "leads": {
                              "type": "object",
                              "description": "Leads access rights object",
                              "properties": {
                                "view": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "edit": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "add": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "delete": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "export": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                }
                              }
                            },
                            "contacts": {
                              "type": "object",
                              "description": "Contacts access rights object",
                              "properties": {
                                "view": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "edit": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "add": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "delete": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "export": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                }
                              }
                            },
                            "companies": {
                              "type": "object",
                              "description": "Companies access rights object",
                              "properties": {
                                "view": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "edit": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "add": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "delete": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "export": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                }
                              }
                            },
                            "tasks": {
                              "type": "object",
                              "description": "Tasks access rights object",
                              "properties": {
                                "view": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "edit": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "add": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "delete": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                },
                                "export": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "G",
                                    "M",
                                    "D"
                                  ]
                                }
                              }
                            },
                            "status_rights": {
                              "type": "string",
                              "description": "An array of the objects that define stages rights.  It is null by default.",
                              "default": "null",
                              "format": "json"
                            },
                            "mail_access": {
                              "type": "boolean",
                              "description": "Defines whether Mail functionality is allowed for the user. It is false by default.",
                              "default": false
                            },
                            "catalog_access": {
                              "type": "boolean",
                              "description": "Defines whether Lists functionality is allowed for the user. It is false by default.",
                              "default": false
                            }
                          }
                        },
                        "request_id": {
                          "type": "string",
                          "description": "Field that will be returned unchanged in the response and will not be saved."
                        }
                      },
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "examples": {
                  "Roles have been successfully created": {
                    "value": "{\n    \"_total_items\": 1,\n    \"_embedded\": {\n        \"roles\": [\n            {\n                \"id\": XXXXX,\n                \"name\": \"role 3\",\n                \"rights\": {\n                    \"leads\": {\n                        \"add\": \"A\",\n                        \"edit\": \"G\",\n                        \"view\": \"G\",\n                        \"delete\": \"G\",\n                        \"export\": \"G\"\n                    },\n                    \"tasks\": {\n                        \"edit\": \"A\",\n                        \"delete\": \"A\"\n                    },\n                    \"contacts\": {\n                        \"add\": \"A\",\n                        \"edit\": \"A\",\n                        \"view\": \"A\",\n                        \"delete\": \"A\",\n                        \"export\": \"A\"\n                    },\n                    \"companies\": {\n                        \"add\": \"A\",\n                        \"edit\": \"A\",\n                        \"view\": \"A\",\n                        \"delete\": \"A\",\n                        \"export\": \"A\"\n                    },\n                    \"mail_access\": true,\n                    \"status_rights\": [\n                        {\n                            \"entity_type\": \"leads\",\n                            \"pipeline_id\": XXXXX,\n                            \"status_id\": XXXXXXX,\n                            \"rights\": {\n                                \"edit\": \"A\",\n                                \"view\": \"A\",\n                                \"delete\": \"A\",\n                                \"export\": \"A\"\n                            }\n                        },\n                        {\n                            \"entity_type\": \"leads\",\n                            \"pipeline_id\": XXXXXXX,\n                            \"status_id\": XXXXXXXX,\n                            \"rights\": {\n                                \"edit\": \"D\",\n                                \"view\": \"D\",\n                                \"delete\": \"D\"\n                            }\n                        }\n                    ],\n                    \"catalog_access\": true\n                },\n                \"_links\": {\n                    \"self\": {\n                        \"href\": \"https://example.kommo.com/api/v4/roles/XXX/\"\n                    }\n                }\n            }\n        ]\n    }\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Invalid data given. Details are available in the request response": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "text/plain": {
                "examples": {
                  "User is not authorized": {
                    "value": ""
                  }
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "text/plain": {
                "examples": {
                  "Insufficient rights to call this method": {
                    "value": ""
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```