Tools API Blog
Sign in Create account

Fill PDF form

Fill form is an API that puts data into a PDF template that already has form fields (the kind of PDF where you can click and type). Great for generating filled contracts, applications or forms from n8n, Make or Zapier, with no servers to maintain.

How it works

You need a PDF template with form fields already built in (a plain PDF with no fields won't work; fillable forms are made with Adobe Acrobat or another form editor). You send the template and an object of values, and get back the filled PDF.

Don't know what fields your template has? Call the API WITHOUT the data object and it returns the list of available fields (their name and type) instead of filling anything: so you can discover them before automating. This also costs 1 credit, same as filling.

All you need

  • Your API key. Create it in your dashboard with "+ Create key". It's shown only once, so copy and save it.
  • In your automation platform, an "HTTP Request" step (n8n, Make, Zapier, Pipedream… all have one).
  • Your PDF template with form fields.

Step 1: discover your template's fields

In n8n's HTTP Request node:

  • Method: POST
  • URL: https://api.cofferdock.com/pdf-fill-form
  • Send Headers: on → add two: x-api-key = your key, and Content-Type = application/pdf
  • Send Body: on → choose the binary file option (in n8n: "n8n Binary File", with your template's binary property, usually data)

The response carries the list of fields with their name and type, e.g.: { "fields": [{ "name": "customer_name", "type": "text" }, { "name": "agree", "type": "checkbox" }] }. Use those exact names in step 2.

Step 2: fill the template

Switch the body to JSON (to send the template and the data together):

  • Send Body: JSON → { "file": "<your template in base64>", "data": { "customer_name": "Jane Doe", "agree": true } }
  • Send Headers: x-api-key = your key, Content-Type = application/json
  • Under Options → Response → Response Format: choose File (the response is already the filled PDF)

Convert your template to base64 with a Code node using {{'{{'}}$binary.data.toString('base64'){{'}}'}}, or with the Move Binary Data node.

If a field name doesn't exist in the template (say, a typo), that call does NOT fail: it fills the fields it recognizes and warns about the rest in the X-Warnings header (or in warnings if you ask for output=json).

Options (in the JSON)

OptionDefaultWhat it does
data-Object with { "field_name": "value" }. Omit it and the API responds with the field list instead of filling.
flattenfalsetrue "freezes" the PDF: values can no longer be edited in a PDF reader.

What you get back

Inspect mode: a JSON with the field list. Fill mode: the filled PDF itself (or in base64 with output=json).