Skip to content

API Reference

We expose a public render endpoint and template CRUD endpoints.

Authentication

All API calls require an API key:

X-API-Key: <your_key>

Render

POST /api/public/render

Render either a raw template or a saved template with data.

Supported element types: text, heading, divider, list, image, row, table, spacer, pagebreak.

Raw template

json
{
  "elements": [
    { "type": "heading", "value": "Invoice {{ invoice.number }}", "level": 2 },
    { "type": "divider" },
    { "type": "text", "value": "Hello {{ customer.name }}" }
  ]
}

Saved template

json
{
  "template_id": "<template_id>",
  "data": {
    "customer": { "name": "ACME" },
    "total": 123.45
  }
}

Templates

POST /api/templates

json
{
  "name": "Invoice",
  "description": "Basic invoice",
  "template": {
    "elements": [
      { "type": "text", "value": "Invoice {{ invoice.number }}" }
    ]
  }
}

GET /api/templates

Returns templates for your team.

GET /api/templates/{id}

Returns a single template.

PUT /api/templates/{id}

json
{
  "name": "Invoice v2",
  "template": {
    "elements": [
      { "type": "text", "value": "Updated" }
    ]
  }
}

DELETE /api/templates/{id}

Deletes a template.


Live API Explorer

Below is a Swagger UI for trying the API directly. Enter your API key.