> ## 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/{id}/prompts/{section}/versions/{versionId}

> Read one version of a section, with the text it held.

One snapshot. Use it to diff against [the current text](/dev/endpoints/agents-prompts-list) before deciding whether to [restore it](/dev/endpoints/agents-prompt-version-restore).

## Endpoint

```
GET https://api.keebai.com/v1/agents/{id}/prompts/{section}/versions/{versionId}
```

## Required scope

`agents:read`

## Path parameters

| Parameter   | Type     | Description                |
| ----------- | -------- | -------------------------- |
| `id`        | `string` | `ObjectId` of the agent.   |
| `section`   | `string` | Section type.              |
| `versionId` | `string` | `ObjectId` of the version. |

## Example request

```bash curl theme={"system"}
curl https://api.keebai.com/v1/agents/6650a1b2c3d4e5f6a7b8c9d0/prompts/business_context/versions/6651aaaa1111bbbb2222bbbb \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

## Response

### 200 OK

```json theme={"system"}
{
  "_id": "6651aaaa1111bbbb2222bbbb",
  "agent_id": "6650a1b2c3d4e5f6a7b8c9d0",
  "section": "business_context",
  "version_number": 3,
  "markdown": "# Quiénes somos\n\nBarbería en Providencia.",
  "label": null,
  "created_by": "ops@cliente.cl",
  "restored_from": null,
  "created_at": "2026-08-02T11:07:55.900Z"
}
```

### 404 Not Found

No agent with that id in the token's company and project, or no version with that id in that section.

## Operational notes

* **The version is immutable.** Nothing rewrites it, which is what makes it usable as an audit record.
* **A version of a section the agent no longer has is still readable.** Deleting a section does not delete its history.


## OpenAPI

````yaml GET /v1/agents/{id}/prompts/{section}/versions/{versionId}
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/{id}/prompts/{section}/versions/{versionId}:
    get:
      tags:
        - agents
      summary: Leer una version de una seccion
      operationId: PublicAgentsController_getPromptVersion
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: section
          required: true
          in: path
          schema:
            type: string
        - name: versionId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicPromptVersionDto'
      security:
        - PAT: []
components:
  schemas:
    PublicPromptVersionDto:
      type: object
      properties:
        _id:
          type: string
        agent_id:
          type: string
        section:
          type: string
          example: business_context
        version_number:
          type: number
          description: Correlativo dentro de la seccion; el mayor es el vigente.
        markdown:
          type: string
        label:
          type: object
          nullable: true
        created_by:
          type: object
          nullable: true
          description: Quien la guardo.
        restored_from:
          type: object
          nullable: true
          description: >-
            Version de la que se copio, cuando esta nacio de una restauracion.
            Restaurar no muta: crea una version nueva.
        created_at:
          type: string
      required:
        - _id
        - agent_id
        - section
        - version_number
        - markdown
        - label
        - created_by
        - restored_from
        - created_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`.

````