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

# Parse an uploaded file into structured HTML with chunk IDs for targeted AI editing.

> Fetches the file uploaded via request_upload_url and runs the same parsing pipeline as upload_document_base64: every paragraph, heading, table, row, and cell gets a unique chunk ID, enabling targeted structural edits via chat ("remove row 3 of the pricing table" works), with tables, borders, shading, alternating row colors, fonts, and inline styling preserved on edit and export. By default the response is compact (metadata only, no document body) to keep your context small — the document is loaded into the session and you edit it via chat; pass return_html=true if you need the parsed HTML inline. Uploading and parsing is NOT itself a billable operation — you are charged only when the AI edits the document. Specify parse_mode='document' to load as the active editable document, or parse_mode='attachment' to load as a read-only AI-searchable reference.



## OpenAPI

````yaml /openapi.json post /v1/uploads/{upload_id}/process
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/uploads/{upload_id}/process:
    post:
      tags:
        - uploads
        - mcp
        - uploads
      summary: >-
        Parse an uploaded file into structured HTML with chunk IDs for targeted
        AI editing.
      description: >-
        Fetches the file uploaded via request_upload_url and runs the same
        parsing pipeline as upload_document_base64: every paragraph, heading,
        table, row, and cell gets a unique chunk ID, enabling targeted
        structural edits via chat ("remove row 3 of the pricing table" works),
        with tables, borders, shading, alternating row colors, fonts, and inline
        styling preserved on edit and export. By default the response is compact
        (metadata only, no document body) to keep your context small — the
        document is loaded into the session and you edit it via chat; pass
        return_html=true if you need the parsed HTML inline. Uploading and
        parsing is NOT itself a billable operation — you are charged only when
        the AI edits the document. Specify parse_mode='document' to load as the
        active editable document, or parse_mode='attachment' to load as a
        read-only AI-searchable reference.
      operationId: process_uploaded_document
      parameters:
        - name: upload_id
          in: path
          required: true
          schema:
            type: string
            description: The upload_id returned by request_upload_url.
            title: Upload Id
          description: The upload_id returned by request_upload_url.
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessUploadRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessDocumentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ProcessUploadRequest:
      properties:
        session_id:
          type: string
          maxLength: 256
          pattern: ^[a-zA-Z0-9_\-\.]+$
          title: Session Id
          description: >-
            Session ID to load this document/attachment into. Must match the
            chat/async session-id format — letters, digits, '_', '-', '.' only
            (no ':'); max 256 chars.
        filename:
          type: string
          maxLength: 255
          title: Filename
          description: Same filename passed to request_upload_url.
        parse_mode:
          type: string
          enum:
            - document
            - attachment
          title: Parse Mode
          description: >-
            'document' = parse and load as the active editable doc; 'attachment'
            = process asynchronously as AI-searchable reference (returns job_id
            to poll).
          default: document
        return_html:
          type: boolean
          title: Return Html
          description: >-
            When false (default), the response is compact — metadata only
            (chunks_count, version_id, page_setup), no document body — to keep
            your context small; the document is loaded into the session and you
            edit it via chat. Set true only if you actually need the parsed HTML
            returned inline.
          default: false
      type: object
      required:
        - session_id
        - filename
      title: ProcessUploadRequest
    ProcessDocumentResponse:
      properties:
        html:
          anyOf:
            - type: string
            - type: 'null'
          title: Html
        session_id:
          type: string
          title: Session Id
        filename:
          type: string
          title: Filename
        chunks_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Chunks Count
        version_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Version Id
        job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Job Id
        status:
          type: string
          title: Status
        parse_mode:
          type: string
          title: Parse Mode
        page_setup:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Page Setup
        warnings:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Warnings
      type: object
      required:
        - session_id
        - filename
        - status
        - parse_mode
      title: ProcessDocumentResponse
    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

````