# Delete an agent

This API is used to delete the agent.

**Notice**：Notes: <br>
If user_access_token is used, the operator needs to be the administrator or owner of the current Help Desk

## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/helpdesk/v1/agents/:agent_id/schedules
HTTP Method | DELETE
Rate Limit | [Special Rate Limit](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
Supported app types | Custom App
Required scopes<br>**To use this API, you must have at least 1 of the listed scopes.** | Update resources details of Help Desk(helpdesk:all)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | `user_access_token`<br>**Value format**: "Bearer `access_token`"<br>**Example value**: "Bearer u-7f1bcd13fc57d46bac21793a18e560"<br>[How to choose and get access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)

**Notice**：The "Help Desk token" parameter also needs to be added to the Help Desk request header:

Key: X-Lark-Helpdesk-Authorization

Value: base64(helpdesk_id:helpdesk_token), a base64-encrypted string that connects helpdesk_id and helpdesk_token with ':'.

[Learn more about how to obtain and use Help Desk token](https://open.feishu.cn/document/ukTMukTMukTM/ugDOyYjL4gjM24CO4IjN)

### Path parameters

Parameter | Type | Description
---|---|---
agent_id | string | agent user id<br>**Example value**: "12345"

## Response

### Response body

Parameter | Type | Description
---|---|---
code | int | Error codes, fail if not zero
msg | string | Error descriptions
data | \- | \-

### Response body example
```json
{
    "code": 0,
    "msg": "success",
    "data": {}
}
```

### Error code

HTTP status code | Error code | Description | Troubleshooting suggestions
---|---|---|---
400 | 154000 | Bad request, please check your request body | Invalid request. Check the parameters.
403 | 154003 | Please check you have the correct access | Check if the correct permission scope is requested.
500 | 155000 | Internal error | Internal error, please contact us

