API reference
Generate PDFs programmatically with an API key and a single HTTP request.
The REST API lets you generate PDFs from your own application. The base URL is:
https://api.generatr.appAPI keys
PDF generation is authenticated with a per-organisation API key. Create one from Settings → API Keys. A key looks like:
wt_8985cf0a1b2c3d4e5f60718293a4b5c6d7e8f9012345abcdStore it securely
The full key is shown so you can copy it, but treat it like a password — it grants PDF generation for your organisation and counts against your quota.
Pass it as a Bearer token:
Authorization: Bearer wt_your_keyGenerate a PDF
POST /v1/render/{templateSlug}
Authorization: Bearer wt_your_key
Content-Type: application/json{
"data": {
"customer": { "name": "Acme Corp" },
"invoice": { "total": 1250 }
},
"lang": "en"
}data— the JSON object your template's Liquid placeholders read from.lang— optional language code for translations.
A successful call returns the binary PDF:
200 OK
Content-Type: application/pdfExample
curl -X POST https://api.generatr.app/v1/render/invoice \
-H "Authorization: Bearer wt_your_key" \
-H "Content-Type: application/json" \
-d '{ "data": { "invoice": { "total": 1250 } } }' \
--output invoice.pdfconst res = await fetch(
'https://api.generatr.app/v1/render/invoice',
{
method: 'POST',
headers: {
Authorization: 'Bearer wt_your_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({ data: { invoice: { total: 1250 } } }),
},
)
const pdf = await res.arrayBuffer()Save demo data
Capture a real payload from your system and replay it in the editor:
POST /v1/demo-data/{templateSlug}
Authorization: Bearer wt_your_key
Content-Type: application/jsonThe JSON body is stored as a named sample (auto-named {slug}-YYYY-MM-DD-HHmm)
and appears in the editor's sample-data dropdown. See
Sample data.
Errors & limits
| Status | Meaning |
|---|---|
401 | Missing or invalid API key |
404 | No template with that slug in your organisation |
429 | Monthly PDF quota exceeded for your plan |
400 | Invalid JSON body or template render error |
Each successful render counts towards your plan's monthly PDF quota. See Plans & account for the limits.