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

# Crear un documento

> Crea, revisa o edita un documento, en modo directo, stream o background.



## OpenAPI

````yaml /openapi.json post /documents
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:
    post:
      tags:
        - Documents
      summary: Create, review or edit a document (direct, stream or background)
      operationId: createDocument
      parameters:
        - name: dry_run
          in: query
          required: false
          description: Validate without creating anything.
          schema:
            type: boolean
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Strongly recommended on POST (the SDK always sends one). 24 h, per
            organization.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                operation:
                  default: create
                  type: string
                  enum:
                    - create
                    - review
                    - edit
                    - extract
                name:
                  description: >-
                    A name to find it later ("Contrato piso Malasaña"). It also
                    names the downloaded files.
                  type: string
                  minLength: 1
                  maxLength: 200
                format:
                  type: string
                  enum:
                    - docx
                    - pdf
                    - pptx
                    - xlsx
                    - artifact
                  description: >-
                    The file you want. `docx` → Word (with a PDF too), `pdf` →
                    only the PDF, `pptx` → PowerPoint (with a PDF), `xlsx` →
                    Excel (with a PDF). `artifact` → a web page that keeps data
                    (in each visitor's browser, or shared by everyone), on a
                    signed link; with `store: false`, a page to download (see
                    the artifacts guide). Without it, Doconda works it out from
                    `prompt`.
                prompt:
                  description: >-
                    What to write (create) or what to change (edit). Uses a
                    model.
                  type: string
                  minLength: 3
                  maxLength: 8000
                content:
                  description: >-
                    Your own text, in Markdown (create; for an artifact, the
                    content of its page).
                  type: object
                  properties:
                    markdown:
                      type: string
                      minLength: 1
                      maxLength: 500000
                  required:
                    - markdown
                  additionalProperties: false
                style:
                  description: >-
                    The look, in your own words: "blue centred headings, Lora
                    font, with a cover page and a table of contents". What can't
                    be done is listed in `style_unsupported`.
                  type: string
                  minLength: 1
                  maxLength: 1000
                sources:
                  description: >-
                    create: your files for the document. Documents (Word,
                    PowerPoint, Excel, PDF, also .doc/.ppt/.xls, TXT, Markdown;
                    up to 5) are material to write from, with `prompt`. Pictures
                    (PNG, JPEG, GIF, WebP; up to 10) go into the document: with
                    `prompt` the AI places them where they fit; with `content`,
                    point to them from the Markdown as `![caption](img:1)` (the
                    first picture in `sources`). If the request asks to copy the
                    look of one of them ("with the design of our template"),
                    Doconda uses it as the design: a PowerPoint for a
                    presentation is its template at any `quality`; anything else
                    needs `best`.
                  maxItems: 15
                  type: array
                  items:
                    anyOf:
                      - type: string
                        pattern: ^file_
                        description: A file uploaded with POST /files.
                      - type: string
                        pattern: ^doc_
                        description: >-
                          A document Doconda already made, by its id: we use its
                          Word, PowerPoint or Excel (or its PDF, if that is all
                          it has).
                      - type: object
                        properties:
                          url:
                            type: string
                            maxLength: 2048
                            format: uri
                          filename:
                            type: string
                            minLength: 1
                            maxLength: 200
                        required:
                          - url
                        additionalProperties: false
                        description: We download it (public http/https, up to 20 MB).
                      - type: object
                        properties:
                          data:
                            type: string
                            maxLength: 27962031
                            format: base64
                            contentEncoding: base64
                            pattern: >-
                              ^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$
                          filename:
                            type: string
                            minLength: 1
                            maxLength: 200
                        required:
                          - data
                          - filename
                        additionalProperties: false
                        description: >-
                          The file's bytes in base64, with its name (the
                          extension says the format).
                file:
                  description: >-
                    review / edit / extract: the file to work on. review and
                    edit take Word, PowerPoint, Excel or PDF, also .doc, .ppt
                    and .xls (they come back as .docx, .pptx and .xlsx).
                  anyOf:
                    - type: string
                      pattern: ^file_
                      description: A file uploaded with POST /files.
                    - type: string
                      pattern: ^doc_
                      description: >-
                        A document Doconda already made, by its id: we use its
                        Word, PowerPoint or Excel (or its PDF, if that is all it
                        has).
                    - type: object
                      properties:
                        url:
                          type: string
                          maxLength: 2048
                          format: uri
                        filename:
                          type: string
                          minLength: 1
                          maxLength: 200
                      required:
                        - url
                      additionalProperties: false
                      description: We download it (public http/https, up to 20 MB).
                    - type: object
                      properties:
                        data:
                          type: string
                          maxLength: 27962031
                          format: base64
                          contentEncoding: base64
                          pattern: >-
                            ^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$
                        filename:
                          type: string
                          minLength: 1
                          maxLength: 200
                      required:
                        - data
                        - filename
                      additionalProperties: false
                      description: >-
                        The file's bytes in base64, with its name (the extension
                        says the format).
                quality:
                  default: auto
                  description: >-
                    create / edit: `fast`, `standard` or `best` (see Quality),
                    or `auto` to let Doconda choose. Each level has its own
                    price.
                  type: string
                  enum:
                    - auto
                    - fast
                    - standard
                    - best
                max_quality:
                  description: >-
                    With `quality: "auto"`: the highest level Doconda may
                    choose, to cap the price.
                  type: string
                  enum:
                    - fast
                    - standard
                    - best
                stream:
                  default: false
                  description: Answer with text/event-stream on this connection.
                  type: boolean
                background:
                  default: false
                  description: Answer 202 at once; follow with GET, /events or webhooks.
                  type: boolean
                metadata:
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    type: string
                    maxLength: 500
                artifact:
                  description: >-
                    Artifacts only. Without it: `shared`, or `local` in a
                    project that stores nothing.
                  type: object
                  properties:
                    storage:
                      type: string
                      enum:
                        - local
                        - shared
                      description: >-
                        Where an artifact's page keeps its data. `local`: in
                        each visitor's browser (each one sees only theirs;
                        nothing reaches Doconda). `shared`: in Doconda, the same
                        for everyone with the link (polls, team lists). A
                        project that stores nothing only allows `local`.
                  additionalProperties: false
                store:
                  default: true
                  description: >-
                    false: 15 minutes after it finishes Doconda deletes the
                    files, the request, the report and the events. Only what
                    billing needs stays (status, format, pages, cost).
                  type: boolean
              additionalProperties: false
      responses:
        '200':
          description: >-
            Direct mode: the finished document with its download links. Stream
            mode: text/event-stream of DocumentEvent. Dry run: DryRunResult.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      id:
                        type: string
                        pattern: ^doc_[0-9A-HJKMNP-TV-Z]{26}$
                      object:
                        type: string
                        const: document
                      name:
                        description: The name you gave it (`name` when creating it).
                        type:
                          - string
                          - 'null'
                      operation:
                        type: string
                        enum:
                          - create
                          - review
                          - edit
                          - extract
                      format:
                        anyOf:
                          - type: string
                            enum:
                              - docx
                              - pdf
                              - pptx
                              - xlsx
                              - artifact
                            description: >-
                              The file you want. `docx` → Word (with a PDF too),
                              `pdf` → only the PDF, `pptx` → PowerPoint (with a
                              PDF), `xlsx` → Excel (with a PDF). `artifact` → a
                              web page that keeps data (in each visitor's
                              browser, or shared by everyone), on a signed link;
                              with `store: false`, a page to download (see the
                              artifacts guide). Without it, Doconda works it out
                              from `prompt`.
                          - type: 'null'
                      type:
                        anyOf:
                          - type: string
                            enum:
                              - report
                              - letter
                              - contract
                              - memo
                              - minutes
                              - presentation
                              - spreadsheet
                              - artifact
                            description: >-
                              What Doconda decided the document is. It sets the
                              default look (a contract: serif, justified,
                              numbered clauses; a letter: no page numbers). You
                              don't choose it: say what you want in `prompt`,
                              and the look in `style`.
                          - type: 'null'
                      mode:
                        anyOf:
                          - type: string
                            enum:
                              - prompt
                              - content
                              - manual
                          - type: 'null'
                        description: >-
                          `manual`: a version someone edited by hand in the
                          editor (POST /documents/{id}/versions).
                      sector:
                        description: >-
                          The professional sector Doconda recognised in the
                          request (legal, healthcare, accounting…). Its guide
                          shapes the structure and conventions; what you say or
                          send always wins.
                        type:
                          - string
                          - 'null'
                      parent_id:
                        anyOf:
                          - type: string
                            pattern: ^doc_[0-9A-HJKMNP-TV-Z]{26}$
                          - type: 'null'
                        description: The document this version was edited from.
                      status:
                        type: string
                        enum:
                          - queued
                          - running
                          - ready
                          - ready_with_warnings
                          - needs_review
                          - failed
                          - canceled
                      phase:
                        type:
                          - string
                          - 'null'
                      pages:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                      style_applied:
                        anyOf:
                          - type: object
                            properties:
                              font:
                                type: string
                              font_size:
                                type: number
                              line_spacing:
                                type: number
                              colors:
                                type: object
                                properties:
                                  title:
                                    type: string
                                  headings:
                                    type: string
                                  text:
                                    type: string
                                  accent:
                                    type: string
                                required:
                                  - title
                                  - headings
                                  - text
                                  - accent
                              align:
                                type: object
                                properties:
                                  title:
                                    type: string
                                    enum:
                                      - left
                                      - center
                                      - right
                                      - justify
                                  headings:
                                    type: string
                                    enum:
                                      - left
                                      - center
                                      - right
                                      - justify
                                  body:
                                    type: string
                                    enum:
                                      - left
                                      - center
                                      - right
                                      - justify
                                required:
                                  - title
                                  - headings
                                  - body
                              margins_cm:
                                type: number
                              orientation:
                                type: string
                                enum:
                                  - portrait
                                  - landscape
                              cover_page:
                                type: boolean
                              table_of_contents:
                                type: boolean
                              page_numbers:
                                type: boolean
                              header:
                                type: string
                              footer:
                                type: string
                            required:
                              - font
                              - font_size
                              - line_spacing
                              - colors
                              - align
                              - margins_cm
                              - orientation
                              - cover_page
                              - table_of_contents
                              - page_numbers
                          - type: 'null'
                      style_unsupported:
                        type: array
                        items:
                          type: string
                      validation_summary:
                        anyOf:
                          - type: object
                            properties:
                              errors:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              warnings:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              info:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                            required:
                              - errors
                              - warnings
                              - info
                          - type: 'null'
                      repair_summary:
                        anyOf:
                          - type: object
                            properties:
                              iterations:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              applied:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              rejected:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                            required:
                              - iterations
                              - applied
                              - rejected
                          - type: 'null'
                      error:
                        anyOf:
                          - type: object
                            properties:
                              code:
                                type: string
                              message:
                                type: string
                            required:
                              - code
                              - message
                          - type: 'null'
                      versions:
                        type: object
                        properties:
                          engine:
                            type: string
                          renderer:
                            type: string
                          model:
                            type:
                              - string
                              - 'null'
                      metadata:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type: string
                      store:
                        type: boolean
                        description: >-
                          false: its content is deleted 15 minutes after it
                          finishes.
                      route:
                        anyOf:
                          - type: object
                            properties:
                              path:
                                type: string
                                enum:
                                  - fast
                                  - agent
                              reason:
                                type: string
                            required:
                              - path
                              - reason
                            description: >-
                              The path Doconda chose to make the file, and why.
                              `fast`: the AI writes the text and Doconda lays it
                              out (seconds). `agent`: an AI agent writes the
                              program that builds the file, looks at the pages
                              and fixes them (30 s – 2 min; any design,
                              comments, tracked changes, formulas and charts).
                              Doconda always chooses.
                          - type: 'null'
                      quality:
                        anyOf:
                          - type: object
                            properties:
                              requested:
                                type: string
                                enum:
                                  - auto
                                  - fast
                                  - standard
                                  - best
                                description: >-
                                  `auto`: Doconda picks the level the request
                                  needs (when in doubt, the cheaper one).
                              level:
                                anyOf:
                                  - type: string
                                    enum:
                                      - fast
                                      - standard
                                      - best
                                    description: >-
                                      How much work goes into the file. `fast`:
                                      one quick AI pass, seconds, the cheapest.
                                      `standard`: a careful pass and one look at
                                      the result, under a minute. `best`: an AI
                                      agent builds it like a designer would,
                                      looking at the pages and fixing them, a
                                      few minutes, the dearest.
                                  - type: 'null'
                                description: >-
                                  The level used (null until Doconda decides
                                  it).
                              reason:
                                type:
                                  - string
                                  - 'null'
                            required:
                              - requested
                              - level
                              - reason
                          - type: 'null'
                        description: >-
                          create and edit: the quality level asked for and the
                          one used, which sets the price.
                      artifact:
                        anyOf:
                          - type: object
                            properties:
                              storage:
                                type: string
                                enum:
                                  - local
                                  - shared
                                description: >-
                                  Where an artifact's page keeps its data.
                                  `local`: in each visitor's browser (each one
                                  sees only theirs; nothing reaches Doconda).
                                  `shared`: in Doconda, the same for everyone
                                  with the link (polls, team lists). A project
                                  that stores nothing only allows `local`.
                            required:
                              - storage
                          - type: 'null'
                        description: 'Artifacts only: where the page keeps its data.'
                      content_deleted_at:
                        anyOf:
                          - 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)))$
                          - type: 'null'
                        description: >-
                          When its files, request, report and events were
                          deleted (`store: false`).
                      outputs:
                        description: Present once finished.
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              pattern: ^out_[0-9A-HJKMNP-TV-Z]{26}$
                            kind:
                              type: string
                              enum:
                                - docx
                                - pptx
                                - xlsx
                                - pdf
                                - preview
                                - html
                                - md
                            page:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            content_type:
                              type: string
                            bytes:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            width:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            height:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            url:
                              type: string
                              description: >-
                                Signed download URL, valid 5 minutes. For `html`
                                (an artifact), the link to the page: 1 hour, or
                                `?expires_in=` on GET /outputs; with `store:
                                false`, the page to download.
                            expires_at:
                              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)))$
                          required:
                            - id
                            - kind
                            - content_type
                            - bytes
                            - url
                            - expires_at
                      created_at:
                        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)))$
                      completed_at:
                        anyOf:
                          - 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)))$
                          - type: 'null'
                    required:
                      - id
                      - object
                      - name
                      - operation
                      - format
                      - type
                      - mode
                      - sector
                      - parent_id
                      - status
                      - phase
                      - pages
                      - style_applied
                      - style_unsupported
                      - validation_summary
                      - repair_summary
                      - error
                      - versions
                      - metadata
                      - store
                      - route
                      - quality
                      - artifact
                      - content_deleted_at
                      - created_at
                      - completed_at
                  - type: object
                    properties:
                      valid:
                        type: boolean
                      errors:
                        type: array
                        items:
                          type: object
                          properties:
                            path:
                              type: string
                            message:
                              type: string
                          required:
                            - path
                            - message
                    required:
                      - valid
                      - errors
            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
        '202':
          description: >-
            Background mode, or direct mode past 120 s: follow with GET
            /documents/{id}.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    pattern: ^doc_[0-9A-HJKMNP-TV-Z]{26}$
                  object:
                    type: string
                    const: document
                  name:
                    description: The name you gave it (`name` when creating it).
                    type:
                      - string
                      - 'null'
                  operation:
                    type: string
                    enum:
                      - create
                      - review
                      - edit
                      - extract
                  format:
                    anyOf:
                      - type: string
                        enum:
                          - docx
                          - pdf
                          - pptx
                          - xlsx
                          - artifact
                        description: >-
                          The file you want. `docx` → Word (with a PDF too),
                          `pdf` → only the PDF, `pptx` → PowerPoint (with a
                          PDF), `xlsx` → Excel (with a PDF). `artifact` → a web
                          page that keeps data (in each visitor's browser, or
                          shared by everyone), on a signed link; with `store:
                          false`, a page to download (see the artifacts guide).
                          Without it, Doconda works it out from `prompt`.
                      - type: 'null'
                  type:
                    anyOf:
                      - type: string
                        enum:
                          - report
                          - letter
                          - contract
                          - memo
                          - minutes
                          - presentation
                          - spreadsheet
                          - artifact
                        description: >-
                          What Doconda decided the document is. It sets the
                          default look (a contract: serif, justified, numbered
                          clauses; a letter: no page numbers). You don't choose
                          it: say what you want in `prompt`, and the look in
                          `style`.
                      - type: 'null'
                  mode:
                    anyOf:
                      - type: string
                        enum:
                          - prompt
                          - content
                          - manual
                      - type: 'null'
                    description: >-
                      `manual`: a version someone edited by hand in the editor
                      (POST /documents/{id}/versions).
                  sector:
                    description: >-
                      The professional sector Doconda recognised in the request
                      (legal, healthcare, accounting…). Its guide shapes the
                      structure and conventions; what you say or send always
                      wins.
                    type:
                      - string
                      - 'null'
                  parent_id:
                    anyOf:
                      - type: string
                        pattern: ^doc_[0-9A-HJKMNP-TV-Z]{26}$
                      - type: 'null'
                    description: The document this version was edited from.
                  status:
                    type: string
                    enum:
                      - queued
                      - running
                      - ready
                      - ready_with_warnings
                      - needs_review
                      - failed
                      - canceled
                  phase:
                    type:
                      - string
                      - 'null'
                  pages:
                    anyOf:
                      - type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      - type: 'null'
                  style_applied:
                    anyOf:
                      - type: object
                        properties:
                          font:
                            type: string
                          font_size:
                            type: number
                          line_spacing:
                            type: number
                          colors:
                            type: object
                            properties:
                              title:
                                type: string
                              headings:
                                type: string
                              text:
                                type: string
                              accent:
                                type: string
                            required:
                              - title
                              - headings
                              - text
                              - accent
                          align:
                            type: object
                            properties:
                              title:
                                type: string
                                enum:
                                  - left
                                  - center
                                  - right
                                  - justify
                              headings:
                                type: string
                                enum:
                                  - left
                                  - center
                                  - right
                                  - justify
                              body:
                                type: string
                                enum:
                                  - left
                                  - center
                                  - right
                                  - justify
                            required:
                              - title
                              - headings
                              - body
                          margins_cm:
                            type: number
                          orientation:
                            type: string
                            enum:
                              - portrait
                              - landscape
                          cover_page:
                            type: boolean
                          table_of_contents:
                            type: boolean
                          page_numbers:
                            type: boolean
                          header:
                            type: string
                          footer:
                            type: string
                        required:
                          - font
                          - font_size
                          - line_spacing
                          - colors
                          - align
                          - margins_cm
                          - orientation
                          - cover_page
                          - table_of_contents
                          - page_numbers
                      - type: 'null'
                  style_unsupported:
                    type: array
                    items:
                      type: string
                  validation_summary:
                    anyOf:
                      - type: object
                        properties:
                          errors:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          warnings:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          info:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                        required:
                          - errors
                          - warnings
                          - info
                      - type: 'null'
                  repair_summary:
                    anyOf:
                      - type: object
                        properties:
                          iterations:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          applied:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          rejected:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                        required:
                          - iterations
                          - applied
                          - rejected
                      - type: 'null'
                  error:
                    anyOf:
                      - type: object
                        properties:
                          code:
                            type: string
                          message:
                            type: string
                        required:
                          - code
                          - message
                      - type: 'null'
                  versions:
                    type: object
                    properties:
                      engine:
                        type: string
                      renderer:
                        type: string
                      model:
                        type:
                          - string
                          - 'null'
                  metadata:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                  store:
                    type: boolean
                    description: >-
                      false: its content is deleted 15 minutes after it
                      finishes.
                  route:
                    anyOf:
                      - type: object
                        properties:
                          path:
                            type: string
                            enum:
                              - fast
                              - agent
                          reason:
                            type: string
                        required:
                          - path
                          - reason
                        description: >-
                          The path Doconda chose to make the file, and why.
                          `fast`: the AI writes the text and Doconda lays it out
                          (seconds). `agent`: an AI agent writes the program
                          that builds the file, looks at the pages and fixes
                          them (30 s – 2 min; any design, comments, tracked
                          changes, formulas and charts). Doconda always chooses.
                      - type: 'null'
                  quality:
                    anyOf:
                      - type: object
                        properties:
                          requested:
                            type: string
                            enum:
                              - auto
                              - fast
                              - standard
                              - best
                            description: >-
                              `auto`: Doconda picks the level the request needs
                              (when in doubt, the cheaper one).
                          level:
                            anyOf:
                              - type: string
                                enum:
                                  - fast
                                  - standard
                                  - best
                                description: >-
                                  How much work goes into the file. `fast`: one
                                  quick AI pass, seconds, the cheapest.
                                  `standard`: a careful pass and one look at the
                                  result, under a minute. `best`: an AI agent
                                  builds it like a designer would, looking at
                                  the pages and fixing them, a few minutes, the
                                  dearest.
                              - type: 'null'
                            description: The level used (null until Doconda decides it).
                          reason:
                            type:
                              - string
                              - 'null'
                        required:
                          - requested
                          - level
                          - reason
                      - type: 'null'
                    description: >-
                      create and edit: the quality level asked for and the one
                      used, which sets the price.
                  artifact:
                    anyOf:
                      - type: object
                        properties:
                          storage:
                            type: string
                            enum:
                              - local
                              - shared
                            description: >-
                              Where an artifact's page keeps its data. `local`:
                              in each visitor's browser (each one sees only
                              theirs; nothing reaches Doconda). `shared`: in
                              Doconda, the same for everyone with the link
                              (polls, team lists). A project that stores nothing
                              only allows `local`.
                        required:
                          - storage
                      - type: 'null'
                    description: 'Artifacts only: where the page keeps its data.'
                  content_deleted_at:
                    anyOf:
                      - 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)))$
                      - type: 'null'
                    description: >-
                      When its files, request, report and events were deleted
                      (`store: false`).
                  outputs:
                    description: Present once finished.
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          pattern: ^out_[0-9A-HJKMNP-TV-Z]{26}$
                        kind:
                          type: string
                          enum:
                            - docx
                            - pptx
                            - xlsx
                            - pdf
                            - preview
                            - html
                            - md
                        page:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        content_type:
                          type: string
                        bytes:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        width:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        height:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        url:
                          type: string
                          description: >-
                            Signed download URL, valid 5 minutes. For `html` (an
                            artifact), the link to the page: 1 hour, or
                            `?expires_in=` on GET /outputs; with `store: false`,
                            the page to download.
                        expires_at:
                          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)))$
                      required:
                        - id
                        - kind
                        - content_type
                        - bytes
                        - url
                        - expires_at
                  created_at:
                    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)))$
                  completed_at:
                    anyOf:
                      - 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)))$
                      - type: 'null'
                required:
                  - id
                  - object
                  - name
                  - operation
                  - format
                  - type
                  - mode
                  - sector
                  - parent_id
                  - status
                  - phase
                  - pages
                  - style_applied
                  - style_unsupported
                  - validation_summary
                  - repair_summary
                  - error
                  - versions
                  - metadata
                  - store
                  - route
                  - quality
                  - artifact
                  - content_deleted_at
                  - created_at
                  - completed_at
        '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
        '402':
          description: >-
            Balance too low for this document (insufficient_balance). Top up in
            the dashboard.
          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
        '422':
          description: The request is not valid (input_invalid, idempotency_key_reused).
          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
        '501':
          description: A feature of a later milestone (feature_unavailable).
          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.