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

# Read a file

> Any file to Markdown ready for a model.



## OpenAPI

````yaml /en/openapi.json post /extract
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
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:
  /extract:
    post:
      tags:
        - Files
      summary: >-
        Read any file into Markdown ready for a model (Word, PowerPoint, Excel,
        PDF, .doc/.ppt/.xls, TXT, Markdown, HTML)
      operationId: extractFile
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file:
                  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).
              required:
                - file
              additionalProperties: false
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: The text, as Markdown. Nothing is kept.
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    const: extraction
                  id:
                    type: string
                    pattern: ^doc_[0-9A-HJKMNP-TV-Z]{26}$
                  format:
                    type: string
                    enum:
                      - docx
                      - pptx
                      - xlsx
                      - pdf
                      - doc
                      - ppt
                      - xls
                      - txt
                      - md
                      - html
                      - png
                      - jpg
                      - gif
                      - webp
                  markdown:
                    type: string
                    description: >-
                      Headings, lists and tables kept; one section per slide or
                      sheet; page markers in a PDF. Scanned pages and pictures
                      are read with OCR.
                  chars:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: Length of the whole text, before any cut.
                  truncated:
                    type: boolean
                    description: true when longer than 2 000 000 characters.
                  pages:
                    anyOf:
                      - type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      - type: 'null'
                    description: Pages (PDF), slides (PowerPoint) or sheets (Excel).
                required:
                  - object
                  - id
                  - format
                  - markdown
                  - chars
                  - truncated
                  - pages
                description: >-
                  The text of the file. Doconda keeps nothing once it has given
                  it to you.
        '202':
          description: 'Past 120 s: pick it up with GET /extract/{id}.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    const: extraction
                  id:
                    type: string
                    pattern: ^doc_[0-9A-HJKMNP-TV-Z]{26}$
                  status:
                    type: string
                    enum:
                      - queued
                      - running
                required:
                  - object
                  - id
                  - status
                description: >-
                  Still reading (a long scanned PDF can take minutes): pick it
                  up with GET /extract/{id} within 15 minutes.
        '401':
          description: unauthorized (missing, unknown or revoked key; expired session).
          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
        '413':
          description: file_too_large
          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: file_rejected / file_unreachable, or the file could not be read
          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_…`, a key from the dashboard (API keys).'
    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.