Edit File (Async)

Edit and manipulate PDF documents by detecting and filling form fields. The Edit Runs endpoint allows you to convert and edit documents and get an edit run ID that can be used to check status and retrieve results with the [Get Edit Run](https://docs.extend.ai/2026-02-09/developers/api-reference/endpoints/edit/get-edit-run) endpoint. For more details, see the [Edit File guide](https://docs.extend.ai/2026-02-09/product/editing/edit). See [Async Processing](https://docs.extend.ai/2026-02-09/developers/async-processing) for a full guide on polling helpers and webhooks. ## Polling with the SDK The SDK provides a `createAndPoll` / `create_and_poll` method that handles polling automatically, returning when the run reaches a terminal state (`PROCESSED` or `FAILED`): <Tabs> <Tab title="TypeScript"> ```typescript const result = await client.editRuns.createAndPoll({ file: { url: "https://..." }, config: { /* edit config */ } }); // Returns when the run reaches a terminal state console.log(result.output); ``` </Tab> <Tab title="Python"> ```python result = client.edit_runs.create_and_poll( file={"url": "https://..."}, config={ ... } # edit config ) # Returns when the run reaches a terminal state print(result.output) ``` </Tab> <Tab title="Java"> ```java var result = client.editRuns().createAndPoll(EditRunCreateRequest.builder() .file(FileInput.builder().url("https://...").build()) .config(EditConfig.builder().build()) .build()); // Returns when the run reaches a terminal state System.out.println(result.getOutput()); ``` </Tab> </Tabs>

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 edited. Files can be provided as a URL or an Extend file ID.
configobjectOptional
Configuration options for the editing process.

Response

Successfully initiated edit run
objectenum

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

Allowed values:
idstring

A unique identifier for the edit run.

Example: "edr_xK9mLPqRtN3vS8wF5hB2cQ"

fileobject
The input file that was submitted for editing.
statusenum
The status of the edit run: * `"PROCESSING"` - The file is still being processed * `"PROCESSED"` - The file was successfully edited * `"FAILED"` - The editing failed (see `failureReason` for details)
Allowed values:
failureReasonstring or null
The reason for failure. **Availability:** Present when `status` is `"FAILED"`. Possible values include: * `UNABLE_TO_DOWNLOAD_FILE` - Failed to load the requested file * `FILE_TYPE_NOT_SUPPORTED` - File type not supported. Edit runs currently require a PDF * `FILE_SIZE_TOO_LARGE` - The file exceeds the maximum allowed size * `CORRUPT_FILE` - The file appears to be corrupted and cannot be edited * `FIELD_DETECTION_ERROR` - An error occurred during field detection * `PASSWORD_PROTECTED_FILE` - The file is password protected and cannot be edited * `FAILED_TO_CONVERT_TO_PDF` - The file could not be converted to PDF for processing * `INTERNAL_ERROR` - An unexpected internal error occurred * `INVALID_OPTIONS` - The provided configuration options are invalid * `EMPTY_SCHEMA` - No schema was provided and no fields could be detected * `OUT_OF_CREDITS` - Insufficient credits to process the file **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 edit run, including any default values that were applied.
outputobject or null

The output of the edit run.

Availability: Present when status is "PROCESSED".

metricsobject or null

Metrics about the editing process.

Availability: Present when status is "PROCESSED".

usageobject or null

Usage credits consumed by this run.

Availability: Present when status is "PROCESSED", the run was created after October 7, 2025, and the customer is on the current billing system.

Errors