Skip to content

Fill a form

POST
/v1/pdf/forms/fill
curl -H "X-Api-Key: $KEY" -F files=@form.pdf \
-F 'data={"name":"Ada","date":"2026-11-06","agree":true}' \
http://localhost:9027/v1/pdf/forms/fill -o filled.pdf

Fills a PDF form from data, applying tags in annotations, optionally flattening the result.

Media typemultipart/form-data
object
ctx

JSON object visible as ctx, sent as text.

string | null
data

JSON object, sent as text or as a file; a field named customer.name takes that path.

string | null

Example

{"customer": {"name": "Ada"}}
files
required

The PDF with form fields, and optionally tags in annotations.

string format: binary
flatten

Fix the values into the page content.

boolean | null
outputFilename
string | null
stripAnnotations

Remove the annotations that carried tags. Default true.

boolean | null

The filled PDF

Media typeapplication/pdf

The file, as bytes.

string format: binary

Accepted; the result goes to the webhook

The request is wrong

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}

The template failed to render

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}

Not supported in this version

Media typeapplication/json

The JSON body of every error response.

object
error
required

A stable, machine-readable kind.

string
message
required

What went wrong, for a person.

string

Example

{
"error": "invalid_request",
"message": "unknown step 'teleport'"
}