> ## 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.

# GET /v1/crm/tasks

> List the tasks of your company, optionally filtered by status.

Returns a paginated list of tasks. Tasks are company-level records — they have no project of their own, so this listing always covers the whole company.

## Endpoint

```
GET https://api.keebai.com/v1/crm/tasks
```

## Required scope

`crm:tasks:read`

## Headers

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

## Query parameters

| Field    | Type      | Required | Description                           |
| -------- | --------- | -------- | ------------------------------------- |
| `status` | `string`  | No       | Exact status match, e.g. `pending`.   |
| `limit`  | `integer` | No       | Page size, `1`–`200`. Defaults to 50. |
| `offset` | `integer` | No       | Records to skip. Defaults to 0.       |

## Example request

<CodeGroup>
  ```bash curl theme={null}
  curl -G https://api.keebai.com/v1/crm/tasks \
    -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    --data-urlencode "status=pending" \
    --data-urlencode "limit=50"
  ```

  ```js JavaScript theme={null}
  const params = new URLSearchParams({ status: "pending", limit: "50" });

  const response = await fetch(`https://api.keebai.com/v1/crm/tasks?${params}`, {
    headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` },
  });
  const { data, total } = await response.json();
  ```

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

  resp = requests.get(
      "https://api.keebai.com/v1/crm/tasks",
      headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
      params={"status": "pending", "limit": 50},
      timeout=10,
  )
  resp.raise_for_status()
  tasks = resp.json()["data"]
  ```
</CodeGroup>

## Response

### 200 OK

```json theme={null}
{
  "data": [
    {
      "_id": "65a1f2b3c4d5e6f7a8b9c0d1",
      "title": "Llamar a Juan Pérez",
      "description": "Confirmar propuesta del plan anual",
      "status": "pending",
      "priority": "high",
      "assigned_to": "68e1f2a3b4c5d6e7f8a9b0c1",
      "due_at": "2026-05-05T13:00:00.000Z",
      "created_at": "2026-05-02T14:31:07.221Z",
      "updated_at": "2026-05-02T14:31:07.221Z"
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}
```

### 400 Bad Request

`limit` above 200, negative `offset`, or an unknown query parameter.

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

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

## Operational notes

* **`status` is free-form**, and the filter is an exact string match. The values the portal uses are `pending`, `in_progress`, `completed`, and `cancelled`, but nothing rejects a custom one — so filter on exactly what you wrote.
* There is no filter for `assigned_to` or `due_at` on this endpoint. Page through and filter client-side if you need those.


## OpenAPI

````yaml GET /v1/crm/tasks
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:
    get:
      tags:
        - crm-tasks
      summary: Listar tareas
      description: Devuelve las tareas de la company del token.
      operationId: PublicTasksController_list
      parameters:
        - name: status
          required: false
          in: query
          description: Filtrar por estado exacto
          schema:
            type: string
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 200
            default: 50
            type: number
        - name: offset
          required: false
          in: query
          schema:
            minimum: 0
            default: 0
            type: number
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTaskListResponseDto'
      security:
        - PAT: []
components:
  schemas:
    PublicTaskListResponseDto:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PublicTaskResponseDto'
        total:
          type: number
        limit:
          type: number
        offset:
          type: number
      required:
        - data
        - total
        - limit
        - offset
    PublicTaskResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: ObjectId de la tarea
        title:
          type: string
        description:
          type: string
        status:
          type: string
          description: >-
            Estado libre. Los valores del portal son pending, in_progress,
            completed y cancelled.
        priority:
          type: string
          enum:
            - low
            - medium
            - high
            - urgent
        assigned_to:
          type: string
          description: ObjectId del usuario asignado
        due_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - _id
        - title
        - status
        - priority
        - created_at
        - updated_at
  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`.

````