Reference

HTTP API

The n8n node is a thin client over this API. Any HTTP client can call it the same way. Documents are returned as binary in the response body — never hosted at a URL.

auth headers
x-api-key: pk_live_your_key
# or
Authorization: Bearer pk_live_your_key
request (application/json)
{
  "template": "invoice",        // one of the starter ids
  // OR (mutually exclusive — sending both is INVALID_REQUEST):
  "html": "<html>…</html>",     // raw HTML; a Handlebars template when data is non-empty
  "data": { "any": "json" },     // template variables; missing vars render blank
  "format": "pdf",              // "pdf" (default) | "png" (PNG returns the FIRST page only)
  "options": {                   // all optional
    "pageSize": "A4",           // A3 | A4 | A5 | Letter | Legal | Tabloid
    "landscape": false,
    "margin": { "top": "10mm", "right": "10mm", "bottom": "10mm", "left": "10mm" },
    "printBackground": true,
    "scale": 1.0                 // 0.1 – 2
  }
}
HeaderMeaning
x-request-idUnique id for this render — quote it to support.
x-pdfmill-pagesPage count of the rendered PDF.
x-pdfmill-duration-msServer-side render time in milliseconds.
bash
curl -s https://api.pdfmill.dev/v1/render \
  -H 'content-type: application/json' \
  -H 'x-api-key: pk_live_your_key' \
  -d '{"template":"invoice","data":{"invoiceNumber":"INV-1","total":42,"currency":"USD"}}' \
  -o invoice.pdf
response
{
  "templates": [
    { "id": "invoice", "name": "Invoice", "source": "starter" },
    { "id": "quote", "name": "Quote", "source": "starter" }
  ]
}
LimitDefaultError when exceeded
Request payload2 MBPAYLOAD_TOO_LARGE
Rendered output20 MBOUTPUT_TOO_LARGE
Pages per document50OUTPUT_TOO_LARGE
Render wall-clock30 sRENDER_TIMEOUT
Rate limit (per key)120 / minBUSY