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

# Create Batch Endpoint



## OpenAPI

````yaml /openapi.json post /v1/batches
openapi: 3.1.0
info:
  title: extract
  summary: Parse documents into structured data. Text, tables, and figures in one call.
  version: 0.1.0
servers:
  - url: https://api.extract.page
    description: production
security:
  - APIKeyHeader: []
paths:
  /v1/batches:
    post:
      tags:
        - v1
        - async-batch
      summary: Create Batch Endpoint
      operationId: create_batch_v1
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Idempotency-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBatchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResource'
        '402':
          description: Quota exceeded.
        '404':
          description: >-
            One or more `file_id`s don't exist for this account (or their 3-day
            TTL lapsed).
          content:
            application/json:
              example:
                error: file_not_found
                file_ids:
                  - file_abc123
        '409':
          description: >-
            One or more files have no bytes in storage — the upload never
            completed or expired. A *finished* upload does not 409; we re-check
            S3 on submit.
          content:
            application/json:
              example:
                error: file_not_uploaded
                file_ids:
                  - file_abc123
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CreateBatchRequest:
      properties:
        source:
          $ref: '#/components/schemas/FilesSource'
        engine:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Engine
        extract_text:
          type: boolean
          title: Extract Text
          default: true
        extract_images:
          type: boolean
          title: Extract Images
          default: true
        ocr:
          type: string
          enum:
            - auto
            - never
            - force
          title: Ocr
          description: >-
            Deprecated. Accepted for backward compatibility but currently has no
            effect.
          default: auto
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - source
      title: CreateBatchRequest
    BatchResource:
      properties:
        object:
          type: string
          title: Object
          default: batch
        id:
          type: string
          title: Id
        status:
          type: string
          title: Status
        counts:
          $ref: '#/components/schemas/BatchCounts'
        total_items:
          type: integer
          title: Total Items
        engine:
          anyOf:
            - type: string
            - type: 'null'
          title: Engine
        options:
          additionalProperties: true
          type: object
          title: Options
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        created_at:
          type: string
          title: Created At
        started_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Completed At
        expires_at:
          type: string
          title: Expires At
      type: object
      required:
        - id
        - status
        - counts
        - total_items
        - engine
        - options
        - created_at
        - expires_at
      title: BatchResource
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FilesSource:
      properties:
        type:
          type: string
          const: files
          title: Type
          default: files
        file_ids:
          items:
            type: string
          type: array
          maxItems: 10000
          minItems: 1
          title: File Ids
      type: object
      required:
        - file_ids
      title: FilesSource
    BatchCounts:
      properties:
        pending:
          type: integer
          title: Pending
          default: 0
        running:
          type: integer
          title: Running
          default: 0
        succeeded:
          type: integer
          title: Succeeded
          default: 0
        failed:
          type: integer
          title: Failed
          default: 0
        cancelled:
          type: integer
          title: Cancelled
          default: 0
      type: object
      title: BatchCounts
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY

````