Generatr

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.app

API keys

PDF generation is authenticated with a per-organisation API key. Create one from Settings → API Keys. A key looks like:

wt_8985cf0a1b2c3d4e5f60718293a4b5c6d7e8f9012345abcd

Store 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_key

Generate 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"
}

A successful call returns the binary PDF:

200 OK
Content-Type: application/pdf

Example

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.pdf
const 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/json

The 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

StatusMeaning
401Missing or invalid API key
404No template with that slug in your organisation
429Monthly PDF quota exceeded for your plan
400Invalid JSON body or template render error

Each successful render counts towards your plan's monthly PDF quota. See Plans & account for the limits.