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

# DELETE /v1/assistants/{id}

> Delete an assistant permanently. Its blocks survive and stay in the project catalogue.

Deletes the assistant. This is a hard delete of the assistant document and it cannot be undone.

It is **not** a cascade. Every block the assistant referenced stays in the project catalogue, un-archived, with its full version history. Deleting an assistant unwires it; it does not clean up after it.

<Warning>
  If your goal is to stop an assistant answering, [`PATCH` it with `is_active: false`](/dev/endpoints/assistants-update) instead. That is reversible and keeps the configuration intact.
</Warning>

## Endpoint

```
DELETE https://api.keebai.com/v1/assistants/{id}
```

## Required scope

`assistants:write`

## Headers

| Header          | Required | Value                    |
| --------------- | -------- | ------------------------ |
| `Authorization` | Yes      | `Bearer kbai_pk_<token>` |

## Path parameters

| Parameter | Type     | Description                  |
| --------- | -------- | ---------------------------- |
| `id`      | `string` | `ObjectId` of the assistant. |

## Example request

<CodeGroup>
  ```bash curl theme={null}
  curl -X DELETE https://api.keebai.com/v1/assistants/6650a1b2c3d4e5f6a7b8c9d0 \
    -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ```

  ```js JavaScript theme={null}
  const resp = await fetch(
    "https://api.keebai.com/v1/assistants/6650a1b2c3d4e5f6a7b8c9d0",
    {
      method: "DELETE",
      headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` },
    },
  );
  // 204 on success, 404 if it was already gone.
  ```

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

  resp = requests.delete(
      "https://api.keebai.com/v1/assistants/6650a1b2c3d4e5f6a7b8c9d0",
      headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
      timeout=10,
  )
  if resp.status_code != 404:
      resp.raise_for_status()
  ```
</CodeGroup>

## Response

### 204 No Content

Deleted. No body.

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

The token does not have the `assistants:write` scope.

### 404 Not Found

No assistant with that id in the token's company and project. A repeated delete lands here, so treat `404` as "already gone" when retrying.

### 502 Bad Gateway

The assistant service is unreachable.

## Operational notes

* **The blocks are orphaned, not deleted.** They remain in [the catalogue](/dev/endpoints/blocks-list) with no assistant referencing them. If they were only ever used by this assistant, [archive them](/dev/endpoints/blocks-archive) afterwards or they accumulate.
* **Knowledge documents are untouched.** Deleting an assistant removes its assignments, not the documents themselves.
* **Anything still routing to this assistant will stop working.** The delete does not check for inbound routes, channels or funnel stages pointing at it. Repoint them first.
* **A retry is safe.** The operation is idempotent from the caller's point of view: the second call is a `404`, never a partial delete.


## OpenAPI

````yaml DELETE /v1/assistants/{id}
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/assistants/{id}:
    delete:
      tags:
        - assistants
      summary: Eliminar un asistente
      description: >-
        Borra el asistente de forma permanente. Sus bloques sobreviven y quedan
        en el catalogo: esto desarma el cableado, no limpia lo que habia detras.
      operationId: PublicAssistantsController_remove
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '204':
          description: ''
      security:
        - PAT: []
components:
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````