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

# Convertir un archivo

> Cualquier archivo a otro formato, sin IA: a Markdown para un modelo, de Markdown a Word, de PDF a Word, a PDF…



## OpenAPI

````yaml /es/openapi.json post /convert
openapi: 3.1.0
info:
  title: Doconda API
  version: 0.1.0
  license:
    name: Proprietary
    url: https://doconda.com/terms
  description: >-
    Convert, create and edit Word, PowerPoint, Excel and PDF documents for AI
    agents. `POST /documents` waits for the document (direct, the default) or
    answers at once with `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 and edit documents.
  - name: Files
    description: 'Your own files: convert them, or use them as a source or to edit.'
  - name: Webhooks
    description: Be notified when a document is ready.
  - name: Editor
    description: Calls your backend makes for the editor plugin.
  - name: Dashboard
    description: >-
      Used by the Doconda dashboard with a signed-in user. Not available with
      API keys.
paths:
  /convert:
    post:
      tags:
        - Files
      summary: Convert a file
      description: >-
        Turns a file into another format, with no AI: Word ↔ Markdown, PDF →
        Word, PowerPoint or Excel → Markdown, anything → PDF… Scanned PDFs and
        pictures are read with OCR. The first 1000 conversions each month are
        free, then 0.01 € each.
      operationId: convertFile
      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).
                to:
                  type: string
                  enum:
                    - docx
                    - pdf
                    - md
                    - txt
                    - html
                    - odt
                    - rtf
                    - xlsx
                    - csv
                    - pptx
                  description: >-
                    The format you want. Word, Markdown, text, HTML and .odt →
                    docx, pdf, md, txt, html, odt, rtf. Excel and CSV → xlsx,
                    csv, pdf, md, txt. PowerPoint → pptx, pdf, md, txt. PDF →
                    docx, md, txt. PNG and JPEG → pdf, md. A scanned PDF or a
                    picture is read with OCR.
              required:
                - file
                - to
              additionalProperties: false
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: 'The result: `text` for md, txt, html and csv; `output` for files.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    const: conversion
                  id:
                    type: string
                    pattern: ^doc_[0-9A-HJKMNP-TV-Z]{26}$
                  from:
                    type: string
                    enum:
                      - docx
                      - doc
                      - odt
                      - md
                      - txt
                      - html
                      - xlsx
                      - xls
                      - csv
                      - pptx
                      - ppt
                      - pdf
                      - png
                      - jpg
                    description: >-
                      The format of the file you sent: `doc`, `xls` and `ppt`
                      are the 97-2003 ones; `md` is Markdown.
                  to:
                    type: string
                    enum:
                      - docx
                      - pdf
                      - md
                      - txt
                      - html
                      - odt
                      - rtf
                      - xlsx
                      - csv
                      - pptx
                    description: >-
                      The format you want. Word, Markdown, text, HTML and .odt →
                      docx, pdf, md, txt, html, odt, rtf. Excel and CSV → xlsx,
                      csv, pdf, md, txt. PowerPoint → pptx, pdf, md, txt. PDF →
                      docx, md, txt. PNG and JPEG → pdf, md. A scanned PDF or a
                      picture is read with OCR.
                  text:
                    description: >-
                      md, txt, html and csv: the result itself (an Excel to CSV
                      is its first sheet). Then nothing is kept. Other formats:
                      null.
                    type:
                      - string
                      - 'null'
                  output:
                    anyOf:
                      - 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
                              - txt
                              - csv
                              - odt
                              - rtf
                          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, which works
                              until its retention ends or you delete it; with
                              `retention: none`, the page to download.
                          expires_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 `url` stops working; null for an artifact's
                              page, which works until the document's
                              `expires_at`.
                        required:
                          - id
                          - kind
                          - content_type
                          - bytes
                          - url
                          - expires_at
                      - type: 'null'
                    description: >-
                      docx, pdf, odt, rtf, xlsx and pptx: the file, to download
                      within 5 minutes. Text formats: null.
                  pages:
                    anyOf:
                      - type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      - type: 'null'
                    description: >-
                      Pages (PDF, Word), slides (PowerPoint) or sheets (Excel)
                      of the file you sent.
                  expires_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 the converted file is deleted (15 minutes after it
                      was made); null for text, deleted at once.
                required:
                  - object
                  - id
                  - from
                  - to
                  - text
                  - output
                  - pages
                  - expires_at
                description: >-
                  No AI is used: the first 1000 conversions each month are free,
                  then 0.01 € each.
        '202':
          description: 'Past 120 s: pick it up with GET /convert/{id}.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    const: conversion
                  id:
                    type: string
                    pattern: ^doc_[0-9A-HJKMNP-TV-Z]{26}$
                  status:
                    type: string
                    enum:
                      - queued
                      - running
                required:
                  - object
                  - id
                  - status
                description: >-
                  Still converting (a long scanned PDF can take minutes): pick
                  it up with GET /convert/{id} within 15 minutes.
        '400':
          description: >-
            conversion_not_supported: that file can't become that format (the
            message lists the ones it can).
          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
        '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
        '402':
          description: >-
            insufficient_balance: past the 1000 free conversions this month,
            with no balance.
          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 converted
          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.