Integration
Generate PDFs from n8n
If you are already self-hosting n8n, the document step is the one piece you would otherwise write a service for. It is an HTTP Request node.
There is no official n8n app yet. This uses n8n's own HTTP and webhook steps, which is fully supported and takes about five minutes. If you would rather have a one-click app, email support@doc2api.co — demand is how we decide what to build next.
1. Send the values, get a document
Add a HTTP Request node (POST, JSON body) step and point it at your template's fill endpoint. Use your workspace's automation key — one key for everything, from your dashboard — rather than a per-template key, so you only paste a credential once however many automations you build.
Need the template id? GET /api/v1/templates lists them all by name with the same key, and GET /api/v1/me confirms the key works before you build anything on it.
| Method | POST |
| URL | https://www.doc2api.co/api/v1/templates/<TEMPLATE_ID>/fill |
| Header | X-Api-Key: d2a_auto_… |
| Header | Content-Type: application/json |
Body — your field names, under `data`:
{
"data": {
"customer_name": "Sarah Whitfield",
"invoice_ref": "INV-0042",
"amount_due": "1350.00"
},
"params": { "order_id": "A-1029" }
}The completed PDF comes back in the response. Add "preview": true while you are building the automation — the first 100 of those each month do not count against your documents.
2. Or have it delivered to you
Add a Webhook node step, copy the URL it gives you, and paste it into your template's webhook settings. Every completed document then arrives there on its own — with retries if n8n is briefly unreachable, which the synchronous call above cannot give you.
The delivery is signed, so you can prove it came from us: how to verify the signature.
Worth knowing about n8n
- Store the key as a Header Auth credential (name X-Api-Key) rather than typing it into the node, so it stays out of exported workflows.
- Set Response Format to JSON; to keep the PDF itself, follow with a second HTTP Request node on the pdf_url with Response Format set to File.
- Self-hosted n8n reaching our webhook needs to be publicly resolvable — our sender refuses private and link-local addresses.
Get a template and a key first
Upload the PDF you need filled, or design one, and you have the endpoint and key this needs. No account required to try it.