Extract File (Sync)

Extract structured data from a file synchronously, waiting for the result before returning. This endpoint has a **5-minute timeout** — if processing takes longer, the request will fail. **Note:** This endpoint is intended for onboarding and testing only. For production workloads, use `POST /extract_runs` with [polling or webhooks](https://docs.extend.ai/2026-02-09/developers/async-processing) instead, as it provides better reliability for large files and avoids timeout issues. The Extract endpoint allows you to extract structured data from files using an existing extractor or an inline configuration. For more details, see the [Extract File guide](https://docs.extend.ai/2026-02-09/product/extraction/quick-start-5-minutes).

Authentication

AuthorizationBearer

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

Headers

x-extend-api-version"2026-02-09"Optional

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 for more details.

Request

This endpoint expects an object.
fileobjectRequired
The file to be extracted from. Files can be provided as a URL, Extend file ID, or raw text.
extractorobjectOptional

Reference to an existing extractor. One of extractor or config must be provided.

configobjectOptional

Inline extract configuration. One of extractor or config must be provided.

metadatamap from strings to anyOptional
An optional object that can be passed in to identify the run. It will be returned back to you in the response and webhooks. Maximum size is 10KB. To categorize runs for billing and usage tracking, include `extend:usage_tags` with an array of string values (e.g., `{"extend:usage_tags": ["production", "team-eng", "customer-123"]}`). Tags must contain only alphanumeric characters, hyphens, and underscores; any special characters will be automatically removed.

Response

Successfully extracted data from file
objectenum

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

Allowed values:
idstring

The unique identifier for this extract run.

Example: "exr_Xj8mK2pL9nR4vT7qY5wZ"

extractorobject or null

The extractor that was used for this run.

Availability: Present when an extractor reference was provided. Not present when using inline config.

extractorVersionobject or null

The version of the extractor that was used for this run.

Availability: Present when an extractor reference was provided. Not present when using inline config.

statusenum
The status of a processor run (extract, classify, or split): * `"PROCESSING"` - The run is in progress * `"PROCESSED"` - The run completed successfully * `"FAILED"` - The run failed * `"CANCELLED"` - The run was cancelled
Allowed values:
outputobject or map from strings to objects or null
The final output, either reviewed or initial. This is a union of two possible shapes: - **[JSON Schema output](https://docs.extend.ai/2026-02-09/product/extraction/output-types):** The current output format, returned for runs created with a JSON Schema config. - **[Legacy output](https://docs.extend.ai/2025-04-21/product/legacy/output-type-legacy):** A legacy output format from a previous API version. This shape is only returned for runs that were originally created with a legacy config. **Availability:** Present when `status` is `"PROCESSED"`.
initialOutputobject or map from strings to objects or null

The initial output from the extract run, before any review edits.

Availability: Present when reviewed is true.

reviewedOutputobject or map from strings to objects or null

The output after human review.

Availability: Present when reviewed is true.

failureReasonstring or null
The reason for failure. **Availability:** Present when `status` is `"FAILED"`. Possible values include: * `ABORTED` - The run was aborted by the user * `INTERNAL_ERROR` - An unexpected internal error occurred * `FAILED_TO_PROCESS_FILE` - Failed to process the file (e.g., OCR failure, file access issues) * `INVALID_PROCESSOR` - The processor configuration is invalid * `INVALID_CONFIGURATION` - The provided configuration is incompatible with the selected model * `PARSING_ERROR` - Failed to parse the extraction output * `PRE_PROCESSING_FAILURE` - An error occurred during preprocessing (e.g., chunking) * `POST_PROCESSING_FAILURE` - An error occurred during postprocessing * `OUT_OF_CREDITS` - Insufficient credits to run the extraction **Note:** Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.
failureMessagestring or null

A detailed message about the failure.

Availability: Present when status is "FAILED".

metadatamap from strings to any or null

Any metadata that was provided when creating the extract run.

Availability: Present when metadata was provided during creation.

reviewedboolean
Indicates whether the run has been reviewed by a human.
editedboolean
Indicates whether the run results have been edited during review.
editsmap from strings to objects or null

Details of edits made during review.

Availability: Present when edited is true.

configobject
The configuration used for this extract run. This is a union of two possible shapes: - **[JSON Schema config](https://docs.extend.ai/2026-02-09/product/extraction/schema):** The current config format. All runs created through this API version use this shape. - **[Legacy config](https://docs.extend.ai/2025-04-21/product/extraction/schema-legacy):** A fields-array config from a previous API version. This shape is only returned when retrieving runs that were originally created with the legacy format. This API version does not support creating runs with legacy configs.
fileobject
The file that was processed.
parseRunIdstring or null

The ID of the parse run that was used for this extract run.

Availability: Present when a parse run was created.

dashboardUrlstring
The URL to view the extract run in the Extend dashboard.
usageobject or null

Usage credits consumed by this run.

Availability: Present when status is "PROCESSED".

createdAtstringformat: "date-time"

The time (in UTC) at which the object was created. Will follow the RFC 3339 format.

Example: "2024-03-21T16:45:00Z"

updatedAtstringformat: "date-time"

The time (in UTC) at which the object was last updated. Will follow the RFC 3339 format.

Example: "2024-03-21T16:45:00Z"

Errors