The Edit endpoint allows you to programmatically edit PDF documents by detecting form fields and filling them with provided data. This endpoint is ideal for:
If you need Extend to detect the form fields and generate a starter schema first, use Generate Edit Schema.
Edit schemas support root-level JSON Schema conditionals, so you can make fields required or optional based on other form values. Supported keywords include dependentRequired, if / then / else, allOf, oneOf, anyOf, and not.
This is useful for forms where follow-up fields only apply to a subset of users. If you do not already have a schema for the form, you can generate one with the Generate Edit Schema API and then refine the conditional logic.
Create an edit run to edit a PDF document. All edit operations are asynchronous - the endpoint returns immediately with an edit run ID that can be used to poll for results.
Request Body
*One of url or id must be provided.
Response
Retrieve the status and results of an edit run. Poll this endpoint until status is PROCESSED or FAILED.
Path Parameters
Response (Processing)
Response (Completed)
Delete an edit run and all associated data. This operation is permanent and cannot be undone.
Path Parameters
Response
The config object controls how documents are edited.
instructions string
Natural language instructions for the edit operation. Use this to provide context or specific guidance on how to fill the form.
schemaGenerationInstructions string
Additional instructions used when Extend needs to generate a schema from the PDF. This is useful when you want to bias field detection or naming without providing a full schema yourself.
schema object
A JSON Schema defining the structure of fields to edit. The schema uses extend_edit:* properties to specify PDF field types, bounding box positions, text styling options, values to fill, and optional signature image fills.
The type property supports the following formats:
Each field in the schema can include:
Field values are specified directly on each field using extend_edit:value. This replaces the legacy input object approach.
For signature fields, you can provide an image instead of a text value:
For fields that require character-by-character input (like SSN, phone numbers, or policy numbers), use combing: true with a maxLength:
advancedOptions.flattenPdf boolean
When enabled, flattens the PDF after editing, making form fields non-editable. This is useful for generating final documents. Default: false.
advancedOptions.tableParsingEnabled boolean
When enabled, parses table structures in the document. Default: false.
advancedOptions.radioEnumsEnabled boolean
When enabled, imported radio fields are modeled as enums in the schema, ensuring only one of the radio widgets is filled.
advancedOptions.nativeFieldsOnly boolean
When enabled, only native AcroForm fields from the PDF are used in the schema.
When an error occurs, the API returns a structured error response:
Implement polling for all operations - All edit runs are async. Poll GET /edit_runs/{id} until status is PROCESSED or FAILED.
Flatten for final documents - Enable flattenPdf: true when generating final documents to prevent further editing.
Use extend_edit:value on each field - Specify values directly on each field in your schema using the extend_edit:value property.
Use instructions for context - Provide clear instructions when field mapping isn’t straightforward.
Handle errors gracefully - Implement retry logic for retryable errors like OCR_ERROR and INTERNAL_ERROR.
Enable table parsing for forms with tables - Set tableParsingEnabled: true for forms with large regions of empty table cells you want filled.
Use correct bounding box format - Bounding boxes use left, top, right, bottom coordinates (pixel values).