Docs

Templates

Use stored Handlebars templates when the same layout will render many times with different data. Create and publish a draft, then pass templateId plus templateData to POST /v1/pdf. One-off HTML still belongs on POST /v1/pdf with html.

Create a draft, publish it, then send templateId plus templateData. Same API key. HTML is UTF-8 JSON, not Base64. templateId may be the UUID or slug.

Lifecycle

Draft → publish → render. You can keep editing a draft while a published version stays live.

MethodPathJob
GET/v1/templatesList
POST/v1/templatesCreate draft (engine: handlebars)
GET / PATCH / DELETE/v1/templates/:idRead, update draft, delete
POST/v1/templates/:id/publishPublish the active draft
POST/v1/templates/:id/discardDrop unpublished draft changes
POST/v1/templates/:id/duplicateClone
GET/v1/templates/:id/versionsVersion history
POST/v1/templates/:id/restoreRestore a version
POST/v1/templates/validateValidate HTML + sampleData
POST/v1/templates/previewChromium preview of unsaved HTML
POST/v1/templates/generateAI create/edit (billed on success)

Render

POST /v1/pdf with templateId and templateData. Optional templateVersion pins a published version. Request options override saved PDF options for that job. strict: true fails on missing paths.

POST /v1/pdf
{
  "templateId": "invoice",
  "templateData": { "number": "INV-1042", "total": 1458 }
}

AI generate

POST /v1/templates/generate with a prompt. Successful generations debit the AI template rate ($0.05 at launch). Failures are not billed.