Skip to main content

edit.run()

Edits a PDF document synchronously based on provided instructions.
client.edit.run(
    document_url="https://example.com/document.pdf",
    edit_instructions="Fill in the form fields with the provided data",
    edit_options={...},
    form_schema=[...],
    priority=False
)

Parameters

document_url
string
required
The URL of the document to be processed. You can provide one of the following:
  1. A publicly available URL
  2. A presigned S3 URL
  3. A reducto:// prefixed URL obtained from the /upload endpoint after directly uploading a document
edit_instructions
string
required
The instructions for the edit. Describe what changes should be made to the document.
edit_options
object
Configuration options for the edit operation.
form_schema
Iterable[FormSchema]
Form schema for PDF forms. List of widgets with their types, descriptions, and bounding boxes. Only works for PDFs.
priority
boolean
If True, attempts to process the job with priority if the user has priority processing budget available. By default, sync jobs are prioritized above async jobs.

Response

EditResponse
object
Returns the edited document.
result
object
The edited document data.

edit.run_job()

Edits a PDF document asynchronously and returns a job ID immediately.
response = client.edit.run_job(
    document_url="https://example.com/document.pdf",
    edit_instructions="Fill in the form fields with the provided data",
    edit_options={...},
    form_schema=[...],
    priority=False,
    webhook={"url": "https://example.com/webhook"}
)

print(response.job_id)  # Use this to check job status later

Parameters

document_url
string
required
The URL of the document to be processed. You can provide one of the following:
  1. A publicly available URL
  2. A presigned S3 URL
  3. A reducto:// prefixed URL obtained from the /upload endpoint after directly uploading a document
edit_instructions
string
required
The instructions for the edit. Describe what changes should be made to the document.
edit_options
object
Configuration options for the edit operation.
form_schema
Iterable[FormSchema]
Form schema for PDF forms. List of widgets with their types, descriptions, and bounding boxes. Only works for PDFs.
priority
boolean
If True, attempts to process the job with priority if the user has priority processing budget available. By default, sync jobs are prioritized above async jobs.
webhook
WebhookConfigNew
Webhook configuration to receive notification when the job completes.

Response

EditRunJobResponse
object
job_id
string
The ID of the asynchronous job. Use client.job.get(job_id) to retrieve the result when the job completes.