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

# Upload Document

> Upload a PDF document for processing.

Exactly one of ``file_base64``, ``url``, or ``s3_path`` must be provided.



## OpenAPI

````yaml /openapi.json post /upload
openapi: 3.1.0
info:
  title: Capout API
  description: >-
    Programmatic REST, WebSocket, and SSE API for uploading documents, tracking
    processing status, and reading claim balances.
  version: 1.0.0
servers:
  - url: https://api.capout.ai
    description: Public API
security: []
paths:
  /upload:
    post:
      tags:
        - Upload
      summary: Upload Document
      description: >-
        Upload a PDF document for processing.


        Exactly one of ``file_base64``, ``url``, or ``s3_path`` must be
        provided.
      operationId: upload_document_upload_post
      parameters:
        - name: capout-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Capout-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UploadRequest:
      properties:
        file_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: File Base64
          description: Base64-encoded PDF file
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: >-
            Downloadable HTTPS URL to a PDF that the server can fetch
            immediately
        s3_path:
          anyOf:
            - type: string
            - type: 'null'
          title: S3 Path
          description: Existing protected S3 path previously created by POST /upload-url
        file_name:
          type: string
          title: File Name
          description: Original filename
        xn_address:
          type: string
          title: Xn Address
          description: Xactnet recipient address for this upload
        profile_code:
          type: string
          enum:
            - 5L
            - 8D
          title: Profile Code
          description: >-
            Xactimate profile code. Accepted values are 5L (Carrier) and 8D
            (Contractor).
          example: 5L
      type: object
      required:
        - file_name
        - xn_address
        - profile_code
      title: UploadRequest
      description: Request body for POST /upload.
    UploadResponse:
      properties:
        document_id:
          type: string
          title: Document Id
        workflow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Id
        status:
          type: string
          title: Status
          default: processing
        created_at:
          type: string
          format: date-time
          title: Created At
        status_url:
          type: string
          title: Status Url
        ws_url:
          type: string
          title: Ws Url
          default: /ws/status
      type: object
      required:
        - document_id
        - created_at
        - status_url
      title: UploadResponse
      description: Response body for POST /upload.
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````