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

# Extract Data (Async)

> Asynchronously extract structured data. Returns a job_id for polling.



## OpenAPI

````yaml api-reference/openapi.json post /extract_async
openapi: 3.1.0
info:
  title: Aifano Platform API
  version: 1.0.0
  description: >-
    Transform unstructured documents into structured data. Parse, extract,
    split, and edit documents at scale.
servers:
  - url: https://platform.aifano.com
    description: Production
security:
  - BearerAuth: []
paths:
  /extract_async:
    post:
      tags:
        - Document Processing
      summary: Extract Data (Async)
      description: Asynchronously extract structured data. Returns a job_id for polling.
      operationId: extract_async
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AsyncExtractRequest'
      responses:
        '200':
          description: Job created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncJobResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    AsyncExtractRequest:
      type: object
      required:
        - input
        - schema
      properties:
        input:
          $ref: '#/components/schemas/DocumentInput'
        schema:
          type: object
        system_prompt:
          type: string
        async:
          $ref: '#/components/schemas/AsyncConfig'
        parsing:
          $ref: '#/components/schemas/ParseOptions'
    AsyncJobResponse:
      type: object
      required:
        - job_id
      properties:
        job_id:
          type: string
          description: Job ID for polling via GET /job/{job_id}.
    DocumentInput:
      description: >-
        The document to process. Accepts: (1) a public URL, (2) a presigned S3
        URL, (3) an `aifano://file_id` from /upload, or (4) a `jobid://job_id`
        from a previous /parse call.
      oneOf:
        - type: string
          description: URL or aifano:// reference
        - $ref: '#/components/schemas/UploadResponse'
    AsyncConfig:
      type: object
      properties:
        priority:
          type: boolean
          default: false
          description: Process with priority if budget is available.
        webhook:
          type: object
          nullable: true
          description: Webhook configuration for job completion notifications.
          properties:
            mode:
              type: string
              enum:
                - svix
                - direct
            url:
              type: string
              description: Webhook URL (required for direct mode).
        metadata:
          description: Custom JSON metadata included in webhook payloads.
    ParseOptions:
      type: object
      description: Configuration for the parsing step. Ignored when using jobid:// input.
      properties:
        enhance:
          $ref: '#/components/schemas/Enhance'
        retrieval:
          $ref: '#/components/schemas/Retrieval'
        formatting:
          $ref: '#/components/schemas/Formatting'
        spreadsheet:
          $ref: '#/components/schemas/Spreadsheet'
        settings:
          $ref: '#/components/schemas/Settings'
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message.
    UploadResponse:
      type: object
      required:
        - file_id
      properties:
        file_id:
          type: string
          description: File reference in `aifano://file_id` format.
        presigned_url:
          type: string
          nullable: true
          description: Presigned URL for direct access.
    Enhance:
      type: object
      properties:
        agentic:
          type: array
          items:
            type: object
            properties:
              scope:
                type: string
                enum:
                  - table
                  - figure
                  - text
              prompt:
                type: string
                nullable: true
            required:
              - scope
          default: []
          description: >-
            Use vision language models to enhance accuracy for specific block
            types.
        summarize_figures:
          type: boolean
          default: true
          description: Summarize figures using a vision model.
    Retrieval:
      type: object
      properties:
        chunking:
          type: object
          properties:
            chunk_mode:
              type: string
              enum:
                - variable
                - section
                - page
                - disabled
                - block
                - page_sections
              default: disabled
            chunk_size:
              type: integer
              nullable: true
        filter_blocks:
          type: array
          items:
            type: string
          default: []
        embedding_optimized:
          type: boolean
          default: false
    Formatting:
      type: object
      properties:
        add_page_markers:
          type: boolean
          default: false
        table_output_format:
          type: string
          enum:
            - html
            - json
            - md
            - jsonbbox
            - dynamic
            - csv
          default: dynamic
        merge_tables:
          type: boolean
          default: false
        include:
          type: array
          items:
            type: string
            enum:
              - change_tracking
              - highlight
              - comments
              - hyperlinks
              - signatures
          default: []
    Spreadsheet:
      type: object
      properties:
        split_large_tables:
          type: object
          properties:
            enabled:
              type: boolean
              default: true
            size:
              type: integer
              default: 50
        clustering:
          type: string
          enum:
            - accurate
            - fast
            - disabled
          default: accurate
    Settings:
      type: object
      properties:
        ocr_system:
          type: string
          enum:
            - standard
            - legacy
          default: standard
          description: >-
            Standard is the best multilingual OCR. Legacy supports only Germanic
            languages.
        extraction_mode:
          type: string
          enum:
            - ocr
            - hybrid
          default: hybrid
          description: Hybrid combines OCR with embedded PDF text for best accuracy.
        force_url_result:
          type: boolean
          default: false
        return_ocr_data:
          type: boolean
          default: false
        return_images:
          type: array
          items:
            type: string
            enum:
              - figure
              - table
          default: []
        page_range:
          type: object
          nullable: true
          properties:
            start:
              type: integer
            end:
              type: integer
        timeout:
          type: number
          nullable: true
        document_password:
          type: string
          nullable: true
  responses:
    Unauthorized:
      description: Unauthorized - invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Use your Aifano API key (starts with `ak_live_`)
        as the Bearer token.

````