> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Seguir los eventos

> Los eventos de un documento en tiempo real (SSE), reanudables.



## OpenAPI

````yaml /openapi.json get /documents/{document_id}/events
openapi: 3.1.0
info:
  title: Doconda API
  version: 0.1.0
  license:
    name: Proprietary
    url: https://doconda.com/terms
  description: >-
    Create, review and edit Word, PowerPoint, Excel and PDF documents for AI
    agents. `POST /documents` works like an LLM API: direct (default), `stream:
    true` (SSE) or `background: true`.

    Errors follow RFC 9457 (application/problem+json). `POST /documents` accepts
    `Idempotency-Key`.
servers:
  - url: https://api.eu.doconda.com/v1
    description: EU (API keys `ak_eu_…`)
  - url: https://api.us.doconda.com/v1
    description: US (not deployed yet)
security:
  - apiKey: []
tags:
  - name: Documents
    description: Create, review and edit documents.
  - name: Files
    description: Your own files, to use as a source or to review/edit.
  - name: Webhooks
    description: Be notified when a document is ready.
  - name: Dashboard
    description: >-
      Used by the Doconda dashboard with a signed-in user. Not available with
      API keys.
paths:
  /documents/{document_id}/events:
    get:
      tags:
        - Documents
      summary: Follow or resume a document's events (SSE). See the events guide.
      operationId: streamDocumentEvents
      parameters:
        - name: document_id
          in: path
          required: true
          schema:
            type: string
        - name: after
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 9007199254740991
        - name: Last-Event-ID
          in: header
          required: false
          description: Resume after this sequence.
          schema:
            type: string
      responses:
        '200':
          description: text/event-stream; each `data:` is a DocumentEvent.
          content:
            text/event-stream:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    pattern: ^evt_[0-9A-HJKMNP-TV-Z]{26}$
                    description: Unique; dedupe webhooks by it.
                  type:
                    type: string
                    examples:
                      - content.block_completed
                      - document.ready
                  version:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  document_id:
                    type: string
                    pattern: ^doc_[0-9A-HJKMNP-TV-Z]{26}$
                  sequence:
                    type: integer
                    minimum: 1
                    maximum: 9007199254740991
                    description: 1, 2, 3… per document. It is the SSE `id:`.
                  timestamp:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                  display:
                    description: 'Short UI text per language, e.g. { es: ''Revisando…'' }.'
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                  data:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                required:
                  - id
                  - type
                  - version
                  - document_id
                  - sequence
                  - timestamp
                  - data
        '401':
          description: >-
            unauthorized (missing, unknown or revoked key; expired session) or
            region_mismatch.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  code:
                    type: string
                    description: >-
                      Stable machine code, e.g. input_invalid,
                      insufficient_balance.
                  request_id:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                required:
                  - type
                  - title
                  - status
                  - code
                  - request_id
        '404':
          description: not_found
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  code:
                    type: string
                    description: >-
                      Stable machine code, e.g. input_invalid,
                      insufficient_balance.
                  request_id:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                required:
                  - type
                  - title
                  - status
                  - code
                  - request_id
        '410':
          description: 'events_expired (kept 7 days) or content_deleted (store: false).'
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  code:
                    type: string
                    description: >-
                      Stable machine code, e.g. input_invalid,
                      insufficient_balance.
                  request_id:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - message
                required:
                  - type
                  - title
                  - status
                  - code
                  - request_id
      security:
        - apiKey: []
        - session: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        `Authorization: Bearer ak_eu_…`. The prefix is the project's region and
        must match the server (api.eu / api.us).
    session:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Dashboard only: the Cognito ID token of the signed-in user.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.