Skip to main content
The PDF form tools let you inspect form fields in a PDF document, then fill them with values programmatically. This is a two-step workflow: first extract the field names and types, then fill the fields with your data.

Workflow overview

  1. Upload the PDF form via the file upload endpoint
  2. Extract fields via POST /tools/pdf/form-fields — returns field names, types, options, and current values
  3. Fill fields via POST /tools/pdf/fill-form — set values for each field by name
  4. Poll the job via GET /tools/jobs/{jobId} until status is COMPLETED
  5. Download the filled PDF via GET /tools/files/{fileId}/download
All files for tool actions must be uploaded via POST /tools/files/upload (the tools file upload). Do not use the temporary image upload endpoint (POST /images/upload) — that is only for render jobs (JSON/Markdown rendering). The two upload endpoints use separate storage systems.

Step 1: Extract form fields

Use the form-fields endpoint to discover what fields exist in a PDF.

Request

Request body

Response (after polling)

The form-fields action is metadata-only — there is no output file. The result is returned in the metadata.fields array of the completed job:

Field object properties

Each field in the metadata.fields array has the following properties:

Supported field types

Step 2: Fill form fields

Once you know the field names and types, use the fill-form endpoint to set values.

Request

Request body

Fields object

The fields object maps field names (as returned by the form-fields endpoint) to their values:
For dropdown, radio, and optionlist fields, the value must exactly match one of the available options returned by the form-fields endpoint. Mismatched values will be skipped.

Response (after polling)

Complete example

1. Upload the PDF form

2. Extract form fields

Poll until completed:
The metadata.fields array tells you exactly which fields exist, their types, and available options.

3. Fill the form

Use the field names and types from step 2:

4. Poll and download

Flatten vs. non-flatten

Flattening is irreversible — once flattened, the form fields cannot be edited again. Always keep the original PDF if you need to re-fill with different values.

Error handling