Edit File

Edit and manipulate PDF documents by detecting and filling form fields. This is a synchronous endpoint that will wait for the edit operation to complete (up to 5 minutes) before returning results. For longer operations, use the [Edit File Async](https://docs.extend.ai/2025-04-21/developers/api-reference/edit-endpoints/edit-file-async) endpoint.

Authentication

AuthorizationBearer

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

Headers

x-extend-api-version"2025-04-21"Optional
API version to use for the request. If you 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/2025-04-21/developers/api-versioning) for more details.

Request

This endpoint expects an object.
fileobjectRequired
A file object containing either a URL or a fileId.
configobjectOptional

Configuration for the edit operation. Field values should be specified using extend_edit:value on each field in the schema.

Response

Successfully edited file
objectenum

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

Allowed values:
idstring

A unique identifier for the edit run. Will always start with "edit_run_"

Example: "edit_run_xK9mLPqRtN3vS8wF5hB2cQ"

fileIdstring
The identifier of the input file that was edited.
statusobject
Minimal edit run status object without edit results.
configobject
The configuration used for this edit run.
metricsobject
Metrics about the editing process.
editedFileobject
Information about the edited output file. Only present when status is "PROCESSED".
failureReasonstring
The reason for failure if status is "FAILED".
outputmap from strings to any

The extracted/detected field values from the edited document.

usageobject
Usage credits consumed by this edit run.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
404
Not Found Error
422
Unprocessable Entity Error
500
Internal Server Error