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

# Upload Document

> Upload a PDF form to be processed and made available for autofill.



## OpenAPI

````yaml post /v1/documents/upload-document
openapi: 3.1.0
info:
  title: AI Form-Filler API
  version: 0.1.0
servers:
  - url: https://api.simplicity.ai
    description: Production
  - url: http://localhost:8000
    description: Local
security: []
paths:
  /v1/documents/upload-document:
    post:
      tags:
        - Documents
      summary: Upload Document
      description: Upload a PDF form to be processed and made available for autofill.
      operationId: upload_document_v1_documents_upload_document_post
      parameters:
        - name: document_type
          in: query
          required: false
          description: >-
            Set to **FORM_DOCUMENT** for the PDF form to fill, or
            **SOURCE_DOCUMENT** for knowledge or reference files—including
            images.
          schema:
            anyOf:
              - $ref: '#/components/schemas/DocumentSource'
              - type: 'null'
            default: SOURCE_DOCUMENT
            title: Document Type
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_document_v1_documents_upload_document_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    DocumentSource:
      type: string
      enum:
        - FORM_DOCUMENT
        - SOURCE_DOCUMENT
      title: DocumentSource
      description: >-
        Classifies an uploaded document for the form-filling workflow.


        - **FORM_DOCUMENT** — The PDF form to be filled. Use this for the actual
        application, intake, or questionnaire file the AI should complete. Only
        PDF is supported for form documents.


        - **SOURCE_DOCUMENT** — Supporting material used as context when filling
        a form: PDFs, **images** (for example photos of IDs or receipts), and
        other reference files (policies, prior submissions, spreadsheets,
        notes). This is the default when the parameter is omitted. Upload
        multiple source documents and reference them when creating or
        autofilling a form alongside a **FORM_DOCUMENT**.
    Body_upload_document_v1_documents_upload_document_post:
      properties:
        file:
          type: string
          format: binary
          title: File
      type: object
      required:
        - file
      title: Body_upload_document_v1_documents_upload_document_post
    TaskCreateResponse:
      properties:
        task_id:
          type: string
          title: Task Id
        status:
          $ref: '#/components/schemas/TaskStatus'
          default: processing
      type: object
      required:
        - task_id
        - status
      title: TaskCreateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskStatus:
      type: string
      enum:
        - pending
        - processing
        - completed
        - failed
      title: TaskStatus
    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:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````