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

# Detect form fields

> Queue detection of fillable areas on a PDF form's file. The pdf-field-mapping automation adds native CX fields to the PDF and questions to the form; poll GET for progress.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /library/forms/{form}/_detect_fields
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /library/forms/{form}/_detect_fields:
    post:
      tags:
        - library
      summary: Detect form fields
      description: >-
        Queue detection of fillable areas on a PDF form's file. The
        pdf-field-mapping automation adds native CX fields to the PDF and
        questions to the form; poll GET for progress.
      parameters:
        - description: Form ID
          name: form
          in: path
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Detection queued (or already in progress)
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pkg_routes_library_forms.DetectFieldsResponse
        '400':
          description: Invalid form ID, not a PDF form, or no PDF uploaded
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: Form not found
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '409':
          description: The form's PDF changed meanwhile
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '502':
          description: Failed to trigger field detection
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_library_forms.DetectFieldsResponse:
      type: object
      properties:
        field_detection:
          $ref: '#/components/schemas/pkg_routes_library_forms.FieldDetection'
        ok:
          type: boolean
    pkg_routes_library_forms.FieldDetection:
      type: object
      properties:
        counts:
          type: object
          additionalProperties:
            type: integer
        file:
          type: string
        message:
          type: string
        requested_at:
          type: string
        source_file:
          type: string
        status:
          type: string
        updated_at:
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.