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

# Form Filling

> Fill PDF or image forms with provided field data. Supports PDFs with and without native form fields.



## OpenAPI

````yaml https://www.datalab.to/openapi.json post /api/v1/fill
openapi: 3.1.0
info:
  title: Datalab API
  version: 0.0.1
servers:
  - url: https://www.datalab.to
    description: Datalab API
security: []
paths:
  /api/v1/fill:
    post:
      summary: Form Filling
      description: >-
        Fill PDF or image forms with provided field data. Supports PDFs with and
        without native form fields.
      operationId: fill_api_v1_fill_post
      parameters:
        - name: wos-session
          in: cookie
          required: false
          schema:
            type: string
            title: Wos-Session
        - name: datalab_active_team
          in: cookie
          required: false
          schema:
            type: string
            title: Datalab Active Team
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_fill_api_v1_fill_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InitialResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    Body_fill_api_v1_fill_post:
      properties:
        file_url:
          anyOf:
            - type: string
            - type: 'null'
          title: File Url
          description: >-
            Optional file URL (http/https). If provided, the server will
            download and process it.
        field_data:
          type: string
          title: Field Data
          description: >-
            JSON string mapping field keys to values and descriptions. Format:
            {"field_key": {"value": "...", "description": "..."}}
          dashboard:
            description: JSON mapping field keys to values and descriptions.
            type: json
        context:
          anyOf:
            - type: string
            - type: 'null'
          title: Context
          description: >-
            Optional context to guide form filling (e.g., 'Initial hire for new
            employee').
        confidence_threshold:
          type: number
          title: Confidence Threshold
          description: >-
            Minimum confidence for field matching (0.0-1.0). Fields below this
            threshold won't be filled.
          default: 0.5
          dashboard:
            description: Minimum confidence for field matching.
            max_value: 1
            min_value: 0
        page_range:
          anyOf:
            - type: string
            - type: 'null'
          title: Page Range
          description: >-
            Pages to process, comma separated like 0,5-10,20. Example: '0,2-4'
            will process pages 0, 2, 3, and 4.
        skip_cache:
          type: boolean
          title: Skip Cache
          description: Skip the cache and re-run the inference. Defaults to False.
          default: false
        processing_location:
          anyOf:
            - type: string
            - type: 'null'
          title: Processing Location
          description: >-
            Optional residency region override (e.g. us, eu). When provided, use
            file_url or direct-upload; multipart uploads are rejected. When
            omitted, the request uses the team's configured residency and
            profile.
        file:
          anyOf:
            - type: string
              format: binary
            - type: 'null'
          title: File
          description: >-
            Input PDF, word document, powerpoint, or image file, uploaded as
            multipart form data.  Images must be png, jpg, or webp format.
      type: object
      required:
        - field_data
      title: Body_fill_api_v1_fill_post
    InitialResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether the request was successful.
          default: true
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: >-
            If the request was not successful, this will contain an error
            message.
        request_id:
          type: string
          title: Request Id
          description: >-
            The ID of the request. This ID can be used to check the status of
            the request.
        request_check_url:
          type: string
          title: Request Check Url
          description: The URL to check the status of the request and get results.
        versions:
          anyOf:
            - additionalProperties: true
              type: object
            - type: string
            - type: 'null'
          title: Versions
          description: A dictionary of the versions of the libraries used in the request.
      type: object
      required:
        - request_id
        - request_check_url
      title: InitialResponse
    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:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````