Generate PDFs, manage documents and templates, and configure webhooks via REST API. Available on Business plan and above.
All API requests require a Bearer token in the Authorization header. Tokens use the q_ prefix and are verified via SHA-256 hash lookup.
Generate API tokens in your Dashboard → Settings → API Tokens. API access requires a Business or Enterprise subscription.
Generate PDFs from templates with variable replacement, raw HTML or Markdown. All endpoints accept page settings (margins, font family, columns, headers, footers) and support returnBlob: true for binary response.
/api/v1/generate/templateGenerate a PDF from a template with variable replacement. Supports caching, print-ready output (CMYK, trim marks) and debug mode.
| Parameter | Type | Description |
|---|---|---|
templateIdrequired | string | UUID of the template, or the custom ID you set in the dashboard (e.g. "monthly_invoice") |
variables | object | Key-value pairs for template placeholders. Supports text, html, markdown, qrcode, barcode and formfield content types |
returnBlob | boolean | Return binary PDF instead of download URL |
printReady | object | Print-ready output: { cmyk, outlineFonts, trimMarks, bleedMm } (Business+ only) |
noCache | boolean | Skip cache and regenerate |
debug | boolean | Include debug information in response |
/api/v1/generate/htmlGenerate a PDF from raw HTML. Accepts page settings for margins, font family, columns, headers and footers.
| Parameter | Type | Description |
|---|---|---|
htmlrequired | string | HTML content to render as PDF |
returnBlob | boolean | Return binary PDF instead of download URL |
pageSize | string | Page size preset: a4, letter, legal, a3, a5 (default: a4). Ignored when pageWidthMm/pageHeightMm are set |
pageWidthMm | number | Custom page width in mm (50-1000). Use with pageHeightMm instead of pageSize |
pageHeightMm | number | Custom page height in mm (50-2000). Use with pageWidthMm instead of pageSize |
margins | object | Page margins in mm: { top, right, bottom, left } (each 0-100) |
styles | object | Typography: { h1Size, h2Size, h3Size, h4Size, h5Size, h6Size, pSize, lineHeight } |
fontFamily | string | Font family for the document (any Google Font name) |
columns | number | Number of text columns, 1-4 (default: 1) |
header | object | Header config: { content, isVisible, alignment, horizontalAlignment } |
footer | object | Footer config: { content, isVisible, alignment, horizontalAlignment } |
language | string | Language code, e.g. en, sv (default: en) |
printReady | object | Print-ready output: { cmyk, outlineFonts, trimMarks, bleedMm } (Business+ only) |
/api/v1/generate/markdownGenerate a PDF from Markdown. Converted to HTML internally, then rendered with the same engine.
| Parameter | Type | Description |
|---|---|---|
markdownrequired | string | Markdown content to render as PDF |
returnBlob | boolean | Return binary PDF instead of download URL |
pageSize | string | Page size preset: a4, letter, legal, a3, a5 (default: a4). Ignored when pageWidthMm/pageHeightMm are set |
pageWidthMm | number | Custom page width in mm (50-1000). Use with pageHeightMm instead of pageSize |
pageHeightMm | number | Custom page height in mm (50-2000). Use with pageWidthMm instead of pageSize |
margins | object | Page margins in mm: { top, right, bottom, left } (each 0-100) |
styles | object | Typography: { h1Size, h2Size, h3Size, h4Size, h5Size, h6Size, pSize, lineHeight } |
fontFamily | string | Font family for the document (any Google Font name) |
columns | number | Number of text columns, 1-4 (default: 1) |
header | object | Header config: { content, isVisible, alignment, horizontalAlignment } |
footer | object | Footer config: { content, isVisible, alignment, horizontalAlignment } |
language | string | Language code, e.g. en, sv (default: en) |
printReady | object | Print-ready output: { cmyk, outlineFonts, trimMarks, bleedMm } (Business+ only) |
/api/v1/generate/batchGenerate multiple PDFs from one template. Each row provides its own set of variables. Returns per-row success/failure status.
| Parameter | Type | Description |
|---|---|---|
templateIdrequired | string | UUID of the template, or the custom ID you set in the dashboard (e.g. "monthly_invoice") |
rowsrequired | array | Array of variable objects. Each entry generates one PDF with its own variables. Business: max 100 rows. Enterprise: max 1,000 |
concurrency | number | Parallel generation limit (default 5, max 20) |
Create, list, read and delete documents and templates. All list endpoints support pagination and language filtering.
/api/v1/documentsList all documents in your organization. Supports pagination and language filtering.
/api/v1/documentsCreate a new document.
| Parameter | Type | Description |
|---|---|---|
titlerequired | string | Document title |
language | string | Language code (defaults to organization default) |
/api/v1/documents/:idGet a single document by ID.
/api/v1/documents/:idDelete a document.
/api/v1/documents/:id/duplicateDuplicate a document with optional title and language override.
| Parameter | Type | Description |
|---|---|---|
title | string | Title for the duplicate |
language | string | Language for the duplicate |
/api/v1/templatesList all templates in your organization. Supports pagination, language filtering, and ?include=schema to embed the variable list on each row (handy for agents that need to pick a template and bind data in one round trip).
/api/v1/templatesCreate a new template.
| Parameter | Type | Description |
|---|---|---|
namerequired | string | Template name |
language | string | Language code |
/api/v1/templates/:idGet a single template by ID.
/api/v1/templates/:id/schemaGet the variable schema for a template. Returns each placeholder name, its content type (text, html, markdown, qrcode, barcode, formfield), whether a default value is set (required = no default), and the number of occurrences. Use this so agents can bind their own data to your templates without reading the template source.
/api/v1/templates/:idDelete a template.
/api/v1/templates/:id/duplicateDuplicate a template with optional name and language override.
| Parameter | Type | Description |
|---|---|---|
name | string | Name for the duplicate |
language | string | Language for the duplicate |
Get notified when events happen. Register a URL and select which events to subscribe to. Every payload is HMAC-SHA256 signed so you can verify authenticity.
/api/v1/webhooksList all webhooks in your organization.
/api/v1/webhooksCreate a new webhook. Returns the signing secret once. Payloads include X-Quaterio-Signature (HMAC-SHA256) and X-Quaterio-Event headers.
| Parameter | Type | Description |
|---|---|---|
urlrequired | string | HTTPS URL to receive webhook events |
eventsrequired | string[] | Events to subscribe to: document.created, document.updated, document.deleted, document.exported, template.created, template.updated, template.deleted, content.created, content.updated, content.deleted |
description | string | Optional label for this webhook (max 500 chars) |
/api/v1/webhooks/:idGet a single webhook by ID.
/api/v1/webhooks/:idDelete a webhook.
Each delivery includes two headers for verification:
| Header | Description |
|---|---|
X-Quaterio-Signature | HMAC-SHA256 of the raw body, prefixed with sha256= |
X-Quaterio-Event | The event type, e.g. document.exported |
List endpoints return paginated results. Use query parameters to control page size and offset.
| Parameter | Default | Description |
|---|---|---|
| page | 1 | Page number |
| perPage | 20 | Items per page (max 100) |
| lang | — | Filter by language code (e.g. en, sv, de) |
All errors return a consistent JSON structure with an error code and human-readable message.
| HTTP Status | Description |
|---|---|
| 400 | Validation error (missing or invalid parameters) |
| 401 | Missing or invalid API token |
| 403 | Insufficient tier (API requires Business or Enterprise) |
| 404 | Resource not found |
| 500 | Internal server error |
Sign up, create a template in the visual editor, generate your first PDF via API in about five minutes.