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

# Subir un archivo

> Sube un archivo para convertirlo, editarlo o usarlo como fuente.



## OpenAPI

````yaml /es/openapi.json post /files
openapi: 3.1.0
info:
  title: API de Doconda
  version: 0.1.0
  license:
    name: Proprietary
    url: https://doconda.com/terms
  description: >-
    Convierte, crea y edita documentos de Word, PowerPoint, Excel y PDF para
    agentes de IA. `POST /documents` espera al documento (modo directo, por
    defecto) o responde al momento con `background: true`.

    Los errores siguen el RFC 9457 (application/problem+json). `POST /documents`
    acepta `Idempotency-Key`.
servers:
  - url: https://api.eu.doconda.com/v1
security:
  - apiKey: []
tags:
  - name: Documents
    description: Crea y edita documentos.
  - name: Files
    description: 'Tus propios archivos: conviértelos, o úsalos como fuente o para editarlos.'
  - name: Webhooks
    description: Recibe un aviso cuando un documento está listo.
  - name: Editor
    description: Llamadas que hace tu backend para el plugin de editor.
paths:
  /files:
    post:
      tags:
        - Files
      summary: Subir un archivo
      description: >-
        Sube un Word, PowerPoint, Excel (también .doc/.ppt/.xls), PDF, TXT,
        Markdown, HTML o una imagen, de hasta 20 MB: por multipart, con una URL
        o en base64.
      operationId: uploadFile
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    url:
                      type: string
                      maxLength: 2048
                      format: uri
                    filename:
                      type: string
                      minLength: 1
                      maxLength: 200
                  required:
                    - url
                  additionalProperties: false
                - 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: >-
                La alternativa en JSON a multipart: una URL que descargamos, o
                los bytes en base64.
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '201':
          description: Guardado.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    pattern: ^file_[0-9A-HJKMNP-TV-Z]{26}$
                  object:
                    type: string
                    const: file
                  filename:
                    type: string
                  content_type:
                    type: string
                  bytes:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  sha256:
                    type: string
                  pages:
                    anyOf:
                      - type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      - type: 'null'
                  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)))$
                required:
                  - id
                  - object
                  - filename
                  - content_type
                  - bytes
                  - sha256
                  - pages
                  - created_at
        '401':
          description: >-
            unauthorized (falta la key, no existe o está revocada; la sesión ha
            caducado).
          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: >-
                      Código estable para máquinas, por ejemplo 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: >-
                      Código estable para máquinas, por ejemplo 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: el contenido no es un archivo admitido (se rechazan
            las macros).
          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: >-
                      Código estable para máquinas, por ejemplo 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_…`, con una key del panel (API keys).'
    session:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Solo para el panel: el token de ID de Cognito del usuario que ha
        iniciado sesión.

````

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