API call description
- Before calling this API, make sure that all employees associated with the role have had the role removed.
- Roles under the default role group cannot be deleted.
Request
| Basic information | |
|---|---|
| HTTP URL | https://oapi.dingtalk.io/topapi/role/deleterole |
| HTTP Method | POST |
| Supported app type | appType-Internal app |
| Permission required | permission-qyapi_manage_addresslist-Contacts data management permission |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | 6ed1xxxx | The app credential for calling this API. Obtain it through the API for getting the access_token of an internal app. |
Request body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| role_id | Number | Yes | 1581321999 | The ID of the role to delete. Call the Get role list API to obtain it. Roles in the “Default” group cannot be modified, including: Owner, Manager, Super Admin, and Sub Admin. |
Request example
Response
Response body
| Name | Type | Example | Description |
|---|---|---|---|
| errcode | Number | 0 | The return code. |
| errmsg | String | ok | The description of the return code. |
| request_id | String | zw9fhpj3m32u | The request ID. |
Response body example
Error codes
If an error is returned when calling this API, refer to the Global error codes document to find the solution based on the error message.| Error code (errcode) | Error message (errmsg) | Solution |
|---|---|---|
| 33011 | Invalid role_id | Verify that role_id is correct. |
| 23004 | Editing system tags is not allowed | Verify that role_id is valid. |
| 1002 | System busy | Try again later. |