Workflow overview
- Upload the PDF form via the file upload endpoint
- Extract fields via
POST /tools/pdf/form-fields— returns field names, types, options, and current values - Fill fields via
POST /tools/pdf/fill-form— set values for each field by name - Poll the job via
GET /tools/jobs/{jobId}until status isCOMPLETED - 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 themetadata.fields array of the completed job:
Field object properties
Each field in themetadata.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
Thefields object maps field names (as returned by the form-fields endpoint) to their values:
Response (after polling)
Complete example
1. Upload the PDF form
2. Extract form fields
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.
