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

# Delete Voice Agent

# Delete Voice Agent API

This documentation explains how to delete a voice agent using the API.

## Endpoint

**POST** `/api/v1/global/agents/delete`

## Authentication

Include your API token in the request header:

```
token: <your_api_token>
```

or

```
api_access_token: <your_api_token>
```

## Request Body

```json theme={null}
{
  "agent_id": 123
}
```

## Query Parameters (Alternative)

You can also pass `agent_id` as a query parameter:

```
POST /api/v1/global/agents/delete?agent_id=123
```

## Required Fields

| Field      | Type    | Description               |
| ---------- | ------- | ------------------------- |
| `agent_id` | integer | ID of the agent to delete |

## Success Response

**Status Code:** `200 OK`

```json theme={null}
{
  "success": true,
  "message": "Voice agent deleted successfully",
  "data": {
    "agent_id": 123
  }
}
```

## Error Responses

### 400 Bad Request

```json theme={null}
{
  "error": true,
  "message": "Agent ID is required"
}
```

### 401 Unauthorized

```json theme={null}
{
  "error": true,
  "message": "Invalid Auth Key or Session Expired"
}
```

### 404 Not Found

```json theme={null}
{
  "error": true,
  "message": "Agent not found"
}
```

## Example Request

### Using Request Body

```bash theme={null}
curl -X POST https://www.tryunleashx.com/api/v1/global/agents/delete \
  -H "Content-Type: application/json" \
  -H "token: your_api_token_here" \
  -d '{
    "agent_id": 123
  }'
```

### Using Query Parameter

```bash theme={null}
curl -X POST "https://www.tryunleashx.com/api/v1/global/agents/delete?agent_id=123" \
  -H "Content-Type: application/json" \
  -H "token: your_api_token_here"
```

## Notes

* Deleting an agent is a permanent action. The agent will be marked as deleted and cannot be recovered.
* The agent must exist and belong to your workspace.
* Once deleted, the agent cannot be used for making calls.


## OpenAPI

````yaml api-reference/openapi.json POST /delete-agent
openapi: 3.1.0
info:
  title: >-
    UnleashX - Build human like conversations | Voice Agents | Automations | AI
    Workforce
  version: 1.0.0
  description: UnleashX - Your home for human like conversations
servers:
  - url: https://www.tryunleashx.com/api/v1/global/
security:
  - bearerAuth: []
paths:
  /delete-agent:
    post:
      tags:
        - Voice AI
      summary: Delete voice agent
      parameters:
        - name: token
          in: header
          required: true
          description: API token for authentication
          schema:
            type: string
        - name: agent_id
          in: query
          required: false
          description: ID of the agent to delete (can also be provided in request body)
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agent_id
              properties:
                agent_id:
                  type: integer
                  description: ID of the agent to delete
      responses:
        '200':
          description: Voice agent deleted successfully
        '400':
          description: Bad Request - Agent ID is required
        '401':
          description: Unauthorized
        '404':
          description: Agent not found
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````