> ## 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/agents

> List the active agents in your project. Filterable by name and paginated.

Returns the active agents in your project. This is the index: start here to find the `id` every other endpoint in this tab needs, and the one [`POST /v1/knowledge/assignments`](/dev/endpoints/knowledge-assign) takes as `agent_id`.

The listing carries basic metadata only. To see how an agent is actually configured — its goal, its sections and their text — follow it with [`GET /v1/agents/{id}`](/dev/endpoints/agents-get).

## Endpoint

```
GET https://api.keebai.com/v1/agents
```

## Required scope

`agents:read`

## Headers

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

## Query parameters

| Parameter | Type     | Default | Description                                                      |
| --------- | -------- | ------- | ---------------------------------------------------------------- |
| `q`       | `string` | —       | Filter by name. Partial, case-insensitive. Up to 120 characters. |
| `page`    | `number` | `1`     | Page, 1-based.                                                   |
| `limit`   | `number` | `25`    | Items per page, max `100`.                                       |

## Example request

<CodeGroup>
  ```bash curl theme={"system"}
  curl "https://api.keebai.com/v1/agents?q=ventas&limit=10" \
    -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ```

  ```js JavaScript theme={"system"}
  const params = new URLSearchParams({ q: "ventas", limit: "10" });
  const resp = await fetch(`https://api.keebai.com/v1/agents?${params}`, {
    headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` },
  });
  const { items } = await resp.json();
  ```

  ```python Python theme={"system"}
  import os, requests

  resp = requests.get(
      "https://api.keebai.com/v1/agents",
      params={"q": "ventas", "limit": 10},
      headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
      timeout=10,
  )
  resp.raise_for_status()
  items = resp.json()["items"]
  ```
</CodeGroup>

## Response

### 200 OK

```json theme={"system"}
{
  "items": [
    {
      "id": "65f3a1b2c3d4e5f6a7b8c9aa",
      "name": "Ventas",
      "description": "Califica leads y agenda demos.",
      "model": "gpt-4o-mini",
      "voice_response_enabled": false,
      "created_at": "2026-03-12T10:15:00.000Z"
    }
  ],
  "page": 1,
  "limit": 10,
  "total": 1
}
```

| Field                            | Type      | Description                                                                       |
| -------------------------------- | --------- | --------------------------------------------------------------------------------- |
| `items[].id`                     | `string`  | `ObjectId` of the agent. This is what every other endpoint takes as the agent id. |
| `items[].name`                   | `string`  | Name.                                                                             |
| `items[].description`            | `string`  | Short description shown in the portal.                                            |
| `items[].model`                  | `string`  | Configured model (e.g. `gpt-4o-mini`).                                            |
| `items[].voice_response_enabled` | `boolean` | Whether voice responses are enabled.                                              |
| `page` / `limit` / `total`       | `number`  | Standard pagination.                                                              |

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

The token does not have the `agents:read` scope.

### 502 Bad Gateway

The agent service is unreachable.

## Operational notes

* **This endpoint uses a different envelope from the rest of the API.** It returns `items` with a 1-based `page` and an `id` field, where everything else paginated returns `data` with `offset` and `_id`. It predates that convention and is deliberately left alone so existing integrations keep working — the other endpoints in this tab use the current shape.
* **Only active agents appear.** There is no parameter to include inactive ones. Fetch a known id with [`GET /v1/agents/:id`](/dev/endpoints/agents-get), which returns it either way and includes `is_active`.
* **Scoped to the token's project**, not the whole company. A token issued against another project sees another list. [Tools do not](/dev/endpoints/tools-list): they belong to the company.
* **`voice_response_enabled` is a flag, not the configuration.** The underlying provider settings, including voice ids, are not exposed.


## OpenAPI

````yaml GET /v1/agents
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/agents:
    get:
      tags:
        - agents
      summary: Listar y buscar agentes activos de la company.
      operationId: PublicAgentsController_list
      parameters:
        - name: q
          required: false
          in: query
          description: Filtro por nombre (búsqueda parcial, case-insensitive).
          schema:
            type: string
        - name: page
          required: false
          in: query
          schema:
            minimum: 1
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 100
            default: 25
            type: number
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAgentsResponse'
      security:
        - PAT: []
components:
  schemas:
    PaginatedAgentsResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/PublicAgentDto'
        page:
          type: number
        limit:
          type: number
        total:
          type: number
      required:
        - items
        - page
        - limit
        - total
    PublicAgentDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        avatar_url:
          type: string
        model:
          type: string
        voice_response_enabled:
          type: boolean
          description: Indica si la respuesta de voz está habilitada.
        created_at:
          type: string
      required:
        - id
        - name
        - model
        - voice_response_enabled
  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`.

````