API call description
After you successfully delete a user from Contacts, the following data is also deleted:- The user is removed from the attendance group they belong to.
- The user is removed from the Smart HR roster. You can view the user’s information under resigned employees in Smart HR.
Request
| Basic information | |
|---|---|
| HTTP URL | https://oapi.dingtalk.io/topapi/v2/user/delete |
| HTTP Method | POST |
| Supported app types | appType-Internal app |
| Permissions required | permission-qyapi_manage_addresslist-Contacts data management permission |
Query parameter
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | Be3xxxx | The app credential used to call this API. Obtain it through the API for getting the access_token of an internal app. |
Request body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| userid | String | Yes | uxxxx3 | The user ID of the employee. |
Request example
Response
Response body
| Name | Type | Example | Description |
|---|---|---|---|
| request_id | String | 4f9md9obopn2 | The request ID. |
| errcode | Number | 0 | The return code. |
| errmsg | String | Invalid userid | The error message returned when the call failed. |
Response body example
Error codes
If an error is returned when you call this API, refer to the global error codes document for solutions.| Error code (errcode) | Error message (errmsg) | Solution |
|---|---|---|
| 33012 | Invalid userId | Check whether the userId is correct. |
| 400002 | Invalid parameter | Check whether the parameters are entered as required. |
| -1 | System busy | Try again later. |