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

# Upload a reference file (PDF/DOCX/image) for the AI to query while editing.

> Files are processed asynchronously and become AI-searchable once ready. The AI can then reference the attachment's content during chat (e.g., "rewrite section 3 to match the style guide PDF I attached"). Images are queryable via multimodal vision. Poll get_attachment_status to know when ready. Distinct from upload_document_base64: attachments are read-only context for the AI to reference, not the editable working document. Supported formats: .pdf, .docx, .txt, .rtf, .md, .html, .htm. Max 50 MB validated; note the hosted transport layer caps any REQUEST BODY at ~32 MB and rejects larger ones at the gateway with an HTML (not JSON) error — base64 inflates content ~33%, so inline uploads are reliable up to ~20 MB of file bytes; beyond that use request_upload_url (pre-signed flow, up to 100 MB). Requires session_id.



## OpenAPI

````yaml /openapi.json post /v1/attachments/upload-base64
openapi: 3.1.0
info:
  title: Universal Document AI API
  description: AI-powered document editing with multi-tenant organization support
  version: 2.0.0
servers: []
security: []
paths:
  /v1/attachments/upload-base64:
    post:
      tags:
        - v1
        - mcp
        - attachments
      summary: >-
        Upload a reference file (PDF/DOCX/image) for the AI to query while
        editing.
      description: >-
        Files are processed asynchronously and become AI-searchable once ready.
        The AI can then reference the attachment's content during chat (e.g.,
        "rewrite section 3 to match the style guide PDF I attached"). Images are
        queryable via multimodal vision. Poll get_attachment_status to know when
        ready. Distinct from upload_document_base64: attachments are read-only
        context for the AI to reference, not the editable working document.
        Supported formats: .pdf, .docx, .txt, .rtf, .md, .html, .htm. Max 50 MB
        validated; note the hosted transport layer caps any REQUEST BODY at ~32
        MB and rejects larger ones at the gateway with an HTML (not JSON) error
        — base64 inflates content ~33%, so inline uploads are reliable up to ~20
        MB of file bytes; beyond that use request_upload_url (pre-signed flow,
        up to 100 MB). Requires session_id.
      operationId: upload_attachment_base64
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Base64UploadRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Base64UploadRequest:
      properties:
        filename:
          type: string
          maxLength: 512
          title: Filename
          description: >-
            Original filename with extension (e.g. 'contract.pdf'). Used for
            file type detection.
        file_base64:
          type: string
          maxLength: 50000000
          title: File Base64
          description: Base64-encoded file content.
        session_id:
          anyOf:
            - type: string
              maxLength: 256
            - type: 'null'
          title: Session Id
          description: Session ID. Auto-generated if not provided.
        return_html:
          type: boolean
          title: Return Html
          description: >-
            With a session_id: false (default) returns compact metadata only
            (chunks_count, version_id, page_setup) — the document is loaded into
            the session and you edit it via chat, keeping your context small;
            true returns the full parsed HTML inline. Ignored on the
            convert-only path (no session_id), which always returns the
            converted html.
          default: false
      type: object
      required:
        - filename
        - file_base64
      title: Base64UploadRequest
      description: JSON request body for base64-encoded file uploads.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````