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

# Delete Agent

> Permanently delete an agent. This action cannot be undone.

<Note>
  Every endpoint on this page requires either a Clerk-issued JWT (`Authorization: Bearer <token>`) or
  an organization API key (`x-api-key: pk_…`). Anonymous calls return `401 Unauthorized`. See
  [Authentication](/authentication) for the full setup.
</Note>

<Warning>
  Deleting an agent is **permanent**. The agent is detached from all phone numbers and call campaigns. Existing session history is retained but the agent can no longer be used for new conversations.
</Warning>

## Code examples

<CodeGroup>
  ```bash curl theme={null}
  curl -X DELETE https://api.agntix.ai/v2/chat/agents/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
    -H "x-api-key: pk_live_••••"
  ```

  ```javascript Node.js theme={null}
  const agentId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';

  const res = await fetch(`https://api.agntix.ai/v2/chat/agents/${agentId}`, {
    method: 'DELETE',
    headers: { 'x-api-key': 'pk_live_••••' },
  });

  if (res.status === 204) {
    console.log('Agent deleted successfully.');
  }
  ```

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

  agent_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"

  response = httpx.delete(
      f"https://api.agntix.ai/v2/chat/agents/{agent_id}",
      headers={"x-api-key": "pk_live_••••"},
  )
  assert response.status_code == 204
  ```
</CodeGroup>

## Soft-delete alternative

If you want to pause an agent without losing it, set `isActive: false` instead:

```bash curl theme={null}
curl -X PATCH https://api.agntix.ai/v2/chat/agents/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "x-api-key: pk_live_••••" \
  -H "Content-Type: application/json" \
  -d '{ "isActive": false }'
```

A `204 No Content` response indicates the agent was successfully deleted.


## OpenAPI

````yaml DELETE /v2/chat/agents/{id}
openapi: 3.0.3
info:
  title: Agntix API
  version: 1.0.0
  description: >-
    The Agntix API lets you build, deploy, and operate AI chat and voice agents.
    All requests are sent to `https://api.agntix.ai`. Authenticate with an API
    key (`x-api-key`) or a Clerk-issued JWT (`Authorization: Bearer <token>`).


    Base URL: `https://api.agntix.ai`
servers:
  - url: https://api.agntix.ai
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Agents
    description: >-
      Create and manage AI agents — the core building block of Agntix. An agent
      encapsulates a system prompt, LLM, tools, knowledge store, and voice
      configuration.
  - name: Chat
    description: >-
      Open chat sessions with an agent and exchange messages. Supports streaming
      responses over SSE.
  - name: Voice
    description: >-
      List available voices and TTS/STT models, and create real-time voice
      sessions.
  - name: Tools
    description: >-
      Extend agent capabilities with API tools (webhook calls) or function tools
      (server-side logic).
  - name: Phone Numbers
    description: >-
      Provision and manage telephony numbers for inbound and outbound voice
      calls.
  - name: Models
    description: Browse available LLM, STT, and TTS models supported by Agntix.
  - name: Analytics
    description: Query call and agent-level performance metrics.
  - name: API Keys
    description: Create and manage organization-scoped API keys.
  - name: Contacts
    description: Manage customer contacts that can be linked to chat sessions.
  - name: Call Campaigns
    description: Launch and manage outbound call campaigns against a list of contacts.
  - name: Subscriptions
    description: View billing plans, usage quotas, and manage Stripe subscriptions.
paths:
  /v2/chat/agents/{id}:
    delete:
      tags:
        - Agents
      summary: Delete agent
      description: >-
        Permanently deletes an agent and detaches it from all phone numbers and
        campaigns. This action cannot be undone.
      operationId: deleteAgent
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: Agent deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    Unauthorized:
      description: Missing or invalid authentication credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: UNAUTHORIZED
              message: Authentication required.
              status: 401
            meta:
              requestId: req_01j3m...
              timestamp: '2026-04-29T10:00:00Z'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: NOT_FOUND
              message: Agent not found.
              status: 404
            meta:
              requestId: req_01j3m...
              timestamp: '2026-04-29T10:00:00Z'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: NOT_FOUND
            message:
              type: string
              example: Resource not found.
            status:
              type: integer
              example: 404
        meta:
          type: object
          properties:
            requestId:
              type: string
            timestamp:
              type: string
              format: date-time
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Organization API key. Obtain from the
        [dashboard](https://app.agntix.ai/settings/api-keys). Format:
        `pk_live_…`
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Clerk-issued JWT. Use `Authorization: Bearer <token>`.'

````