> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ringyo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Agent

> Delete an agent permanently

## Request

Permanently delete an AI voice agent. This action cannot be undone.

<Warning>
  Deleting an agent is permanent. All associated configuration will be lost. Active calls using this agent will not be affected, but no new calls can be initiated.
</Warning>

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication. Format: `Bearer YOUR_API_KEY`
</ParamField>

### Path Parameters

<ParamField path="agent_id" type="string" required>
  The unique identifier of the agent to delete
</ParamField>

## Response

Returns a confirmation of deletion.

<ResponseField name="id" type="string">
  The ID of the deleted agent
</ResponseField>

<ResponseField name="deleted" type="boolean">
  Always `true` on success
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE https://api.ringyo.ai/v1/agents/agent_abc123 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.ringyo.ai/v1/agents/agent_abc123',
    {
      method: 'DELETE',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
      },
    }
  );

  const result = await response.json();
  // { id: 'agent_abc123', deleted: true }
  ```

  ```python Python theme={null}
  import requests

  response = requests.delete(
      'https://api.ringyo.ai/v1/agents/agent_abc123',
      headers={'Authorization': 'Bearer YOUR_API_KEY'}
  )

  result = response.json()
  # {'id': 'agent_abc123', 'deleted': True}
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "id": "agent_abc123",
    "deleted": true
  }
  ```

  ```json 404 - Not Found theme={null}
  {
    "error": {
      "code": "agent_not_found",
      "message": "The specified agent does not exist"
    }
  }
  ```

  ```json 409 - Conflict theme={null}
  {
    "error": {
      "code": "agent_in_use",
      "message": "Cannot delete agent while it has active calls"
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code              | Description                                    |
| ----------------- | ---------------------------------------------- |
| `agent_not_found` | The specified agent\_id does not exist         |
| `agent_in_use`    | Agent has active calls and cannot be deleted   |
| `unauthorized`    | You don't have permission to delete this agent |

## Best Practices

Before deleting an agent:

1. **Check for active calls** - Ensure no calls are currently in progress
2. **Export configuration** - Save the agent's system prompt and settings if you might need them later
3. **Update integrations** - Remove references to this agent from webhooks and automations
