Detect Form (Async)

Start detecting fields in a PDF form and return immediately with a `form_detection_run` resource, typically in the `PROCESSING` state. Poll the [Get Form Detection Run](https://docs.extend.ai/2026-02-09/api-reference/endpoints/edit/get-form-detection-run) endpoint until the status is `PROCESSED` or `FAILED`. When processing succeeds, `output.schema` contains an edit schema you can pass directly to `POST /edit` or `POST /edit_runs`. See [Async Processing](https://docs.extend.ai/2026-02-09/general/async-processing) for polling guidance.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Headers

x-extend-api-version"2026-02-09"OptionalDefaults to 2026-02-09
API version to use for the request. If you're using an SDK, you can ignore this parameter. If you are not using an SDK and do not specify a version, you will either receive a `400 Bad Request` or be set to a previous legacy version. See [API Versioning](https://docs.extend.ai/2026-02-09/api-reference/api-versioning) for more details.

Request

This endpoint expects an object.
fileobjectRequired
The PDF form to analyze. Files can be provided as a URL or an Extend file ID.
configobjectOptional
Configuration options for edit schema generation.

Response

Successfully initiated form detection run
objectenum

The type of object. Will always be "form_detection_run".

idstring

A unique identifier for the form detection run.

Example: "sgr_xK9mLPqRtN3vS8wF5hB2cQ"

fileobject
The input PDF submitted for form detection.
statusenum

The status of the form detection run:

  • "PROCESSING" - The form is still being analyzed
  • "PROCESSED" - Form detection completed successfully
  • "FAILED" - Form detection failed (see failureReason for details)
failureReasonstring or null

The reason for failure.

Availability: Present when status is "FAILED".

Possible values include:

  • UNABLE_TO_DOWNLOAD_FILE
  • FILE_TYPE_NOT_SUPPORTED
  • FILE_SIZE_TOO_LARGE
  • CORRUPT_FILE
  • FIELD_DETECTION_ERROR
  • PASSWORD_PROTECTED_FILE
  • FAILED_TO_CONVERT_TO_PDF
  • EMPTY_SCHEMA
  • INTERNAL_ERROR
  • INVALID_OPTIONS
  • OUT_OF_CREDITS

Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.

failureMessagestring or null

A human-readable description of the failure.

Availability: Present when status is "FAILED".

configobject
The configuration used for this form detection run, including any default values that were applied.
outputobject or null

The detected schema and optional mapping metadata.

Availability: Present when status is "PROCESSED".

metricsobject or null

Metrics about the form detection process.

Availability: Present when status is "PROCESSED".

usageobject or null
Usage credits consumed by this form detection run.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error