> ## 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/assistants/{id}/blocks

> List the blocks wired into one assistant, in prompt order, with metadata and no content.

The middle step of the drill-down: [which assistants exist](/dev/endpoints/assistants-list) → **which blocks make up this one** → [what one of them says](/dev/endpoints/blocks-content-get).

Returns each block's type, family and name, plus its `order` and `pinned_version_id` on this assistant, sorted by `order`. **No content**: a block document holds none, which is why reading it is a separate call.

## Endpoint

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

## Required scope

`assistants:read`

## 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 https://api.keebai.com/v1/assistants/6650a1b2c3d4e5f6a7b8c9d0/blocks \
    -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ```

  ```js JavaScript theme={null}
  const resp = await fetch(
    "https://api.keebai.com/v1/assistants/6650a1b2c3d4e5f6a7b8c9d0/blocks",
    { headers: { Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}` } },
  );
  const { data } = await resp.json();

  const personality = data.find((b) => b.type === "personification");
  ```

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

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

## Response

### 200 OK

```json theme={null}
{
  "data": [
    {
      "_id": "6650bbbb2222cccc3333dddd",
      "type": "personification",
      "family": "identity",
      "name": "Personalidad",
      "current_version_id": "6650ffff4444aaaa5555bbbb",
      "is_archived": false,
      "content_writable": true,
      "order": 0,
      "pinned_version_id": null,
      "created_at": "2026-07-20T14:02:11.870Z",
      "updated_at": "2026-07-26T09:44:03.512Z"
    },
    {
      "_id": "6650bbbb2222cccc3333eeee",
      "type": "product_info",
      "family": "information",
      "name": "Catálogo",
      "current_version_id": "6650ffff4444aaaa5555cccc",
      "is_archived": false,
      "content_writable": false,
      "order": 1,
      "pinned_version_id": "6650ffff4444aaaa5555cccc",
      "created_at": "2026-07-21T11:19:44.001Z",
      "updated_at": "2026-07-21T11:19:44.001Z"
    }
  ],
  "total": 2
}
```

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

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

### 404 Not Found

No assistant with that id in the token's company and project.

### 502 Bad Gateway

The assistant service is unreachable.

## Operational notes

* **Archived blocks are included, on purpose.** A block that is attached and archived still renders into the assistant's prompt — archiving hides it from [the catalogue](/dev/endpoints/blocks-list), it does not switch it off. Omitting them here would make this list disagree with the `blocks` array on the assistant. Check `is_archived` if you want to surface it in a UI.
* **`content_writable` tells you whether you may edit it** before you try. It is `false` for `product_info`, `store_info`, `reservation_info`, `tables_info` and `tags`, which [only the portal can save](/dev/assistants/overview#catalogue-blocks-are-read-only-here).
* **`family` is derived from `type`**, and decides which section of the prompt the block lands in. It is never something you send.
* **This is not paginated**, because an assistant holds at most 50 blocks. There is no `limit`, and `total` is the real count.
* **A reference to a block that no longer exists is dropped silently.** If the list is shorter than the `blocks` array on the assistant, a referenced block was hard-deleted out of band; clean it up with [`PUT /v1/assistants/{id}/blocks`](/dev/endpoints/assistants-blocks-set).


## OpenAPI

````yaml GET /v1/assistants/{id}/blocks
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}/blocks:
    get:
      tags:
        - assistants
      summary: Listar los bloques de un asistente
      description: >-
        Devuelve los bloques cableados al asistente en orden de prompt, con su
        metadata y sin contenido. Es el paso del medio: asistente, sus bloques,
        y despues el contenido de uno. Incluye los archivados, que siguen
        rindiendo en el prompt.
      operationId: PublicAssistantsController_listBlocks
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAttachedBlockListResponseDto'
      security:
        - PAT: []
components:
  schemas:
    PublicAttachedBlockListResponseDto:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PublicAttachedBlockDto'
        total:
          type: number
      required:
        - data
        - total
    PublicAttachedBlockDto:
      type: object
      properties:
        _id:
          type: string
        type:
          type: string
          enum:
            - personification
            - objective
            - response_format
            - steps
            - cases_possible
            - do_not
            - product_info
            - store_info
            - reservation_info
            - tables_info
            - tags
            - response_policy
        family:
          type: string
          enum:
            - identity
            - instructions
            - information
          description: >-
            Se deriva del tipo y determina en que seccion del prompt entra el
            bloque. Es de solo lectura.
        name:
          type: string
        current_version_id:
          type: string
          nullable: true
          description: >-
            Version vigente del bloque. Su contenido se lee en GET
            /v1/blocks/{id}/content.
        is_archived:
          type: boolean
        content_writable:
          type: boolean
          description: >-
            Si el contenido de este bloque se puede editar por API. Los tipos de
            catalogo son de solo lectura porque su escritura depende de una
            sincronizacion de funciones que vive en el portal.
        created_at:
          type: string
        updated_at:
          type: string
        order:
          type: number
          description: Posicion del bloque en el prompt del asistente.
        pinned_version_id:
          type: string
          nullable: true
          description: >-
            Version fijada por el asistente. Si es null, el asistente usa la
            version vigente del bloque.
      required:
        - _id
        - type
        - family
        - name
        - current_version_id
        - is_archived
        - content_writable
        - created_at
        - updated_at
        - order
        - pinned_version_id
  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`.

````