# Delete an agent (/en/api-reference/api-ref/conversational-ai/platform/delete-agent)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

> Documentation: Conversational AI API.
> Documentation version: Preview.
> This document describes only this version. [Version index](/llms/doc-versions-convoai-api-v2.txt).


Deletes a saved agent.

- OpenAPI: /openapi/conversational-ai/rest-api-platform.en.yaml
- Operation ID: delete-agent
- Method: DELETE
- Path: /v1/projects/{appid}/agents/{agent_id}
- Endpoint: https://preview.ai.agora.io/conversational-ai/v1/projects/{appid}/agents/{agent_id}

## Servers

- https://preview.ai.agora.io/conversational-ai

You can't delete an agent that a phone number routes inbound calls to, or that a campaign that hasn't finished uses. Remove those references first.


## Authorization

This endpoint requires authentication.

- `tokenAuth`
- `basicAuth`

## Parameters

- `appid` (path, required, string) - The App ID of your project.
- `agent_id` (path, required, string) - The ID of the agent, returned in `agent_id` when you create the agent.
  - Format: `uuid`

## Request body

No request body.

## Responses

### 200

The agent was deleted.

- `deleted` (boolean, required) - Always `true`. The resource is deleted.
### 401

Authentication is missing or invalid. The reason is `InvalidPermission`.

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).
### 404

The resource in the path doesn't exist. The reason is `ResourceNotFound`.

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).
### 409

`AgentInUse`: A phone number's inbound routing or an unfinished campaign references the agent. `detail` names the reference.

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).
### default

The request failed. The response body contains the `reason` and `detail` of the failure. For possible reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).

- `detail` (string, required) - A human-readable description of the error. It names the field or resource involved, when there is one. Don't parse it; branch on `reason` instead.
- `reason` (string, required) - A machine-readable error reason, such as `InvalidFieldValue` or `ResourceNotFound`. For all reasons, see [Status codes](/en/api-reference/api-ref/conversational-ai/platform/status-codes).
