> ## 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/crm/tasks/:id

> Permanently delete a task. There is no undo.

Deletes a task. The deletion is permanent — there is no soft-delete flag and no restore endpoint.

To take a task off someone's list while keeping the record, set its status to `cancelled` or `completed` with [`PATCH /v1/crm/tasks/:id`](/dev/endpoints/crm-task-update) instead.

## Endpoint

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

## Required scope

`crm:tasks:delete`

## Headers

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

## Path parameters

| Field | Type     | Required | Description             |
| ----- | -------- | -------- | ----------------------- |
| `id`  | `string` | Yes      | `ObjectId` of the task. |

## Example request

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

  ```js JavaScript theme={null}
  const response = await fetch(`https://api.keebai.com/v1/crm/tasks/${taskId}`, {
    method: "DELETE",
    headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` },
  });
  // 204 No Content — response.body is empty
  ```

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

  resp = requests.delete(
      f"https://api.keebai.com/v1/crm/tasks/{task_id}",
      headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
      timeout=10,
  )
  resp.raise_for_status()
  ```
</CodeGroup>

## Response

### 204 No Content

The task was deleted. The response body is empty.

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

The token does not have the `crm:tasks:delete` scope.

### 404 Not Found

No task with that id, or the task belongs to a different company.


## OpenAPI

````yaml DELETE /v1/crm/tasks/{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/crm/tasks/{id}:
    delete:
      tags:
        - crm-tasks
      summary: Eliminar una tarea
      operationId: PublicTasksController_remove
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '204':
          description: Tarea eliminada
      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`.

````