Documentation

Templates API

Manage reusable Handlebars templates.

POST /v1/templates

jsonexample
{
  "name": "invoice-v1",
  "html": "<h1>Invoice {{number}}</h1>",
  "sample_data": { "number": 1042 }
}

GET /v1/templates

jsonexample
{
  "data": [
    {
      "id": "tpl_01HX...",
      "name": "invoice-v1",
      "slug": "invoice-v1",
      "html": "<h1>Invoice {{number}}</h1>",
      "sample_data": { "number": 1042 },
      "created_at": "2026-04-10T14:00:00Z",
      "updated_at": "2026-04-10T14:00:00Z"
    }
  ]
}

GET /v1/templates/:idOrSlug

bashexample
curl https://api.pdfend.com/v1/templates/invoice-v1 \
  -H "Authorization: Bearer pk_live_..."

PATCH /v1/templates/:id

jsonexample
{
  "html": "<h1>Invoice #{{number}} — updated</h1>"
}

DELETE /v1/templates/:id

bashexample
curl -X DELETE https://api.pdfend.com/v1/templates/tpl_01HX... \
  -H "Authorization: Bearer pk_live_..."