Generate PDFs, manage documents, 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. A value may also be an array of objects, which fills a repeating region in the template (see below) |
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 } |
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 } |
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 SEPARATE PDF with its own variables. Not to be confused with a repeating region inside a single document, which is an array within one entry. Business: max 100 rows. Enterprise: max 1,000 |
concurrency | number | Parallel generation limit (default 5, max 20) |
/api/v1/generate/facturxGenerate an EN 16931 electronic invoice as a PDF/A-3 with the CII XML embedded (Factur-X / ZUGFeRD). Business plan and up. Totals are derived from the lines, never accepted from the request, and the finished XML is validated against the CEN Schematron before a PDF is assembled: a failing invoice returns findings rather than a file. Takes no page settings, because templateId must be a layout already checked for the placeholders the invoice needs.
| Parameter | Type | Description |
|---|---|---|
templateIdrequired | string | A Factur-X template: "system-facturx-simple", "-detailed" or "-modern", each also in French ("-fr") and German ("-de"), or the UUID/alias of your own layout. It must declare a placeholder for all ten required business terms or the request is rejected before rendering |
invoicerequired | object | The invoice. Required: number (BT-1), issueDate (BT-2, YYYY-MM-DD), typeCode ("380" or "381"), currency (ISO 4217), seller, buyer, and at least one entry in lines. Optional: dueDate, deliveryDate, buyerReference, note, allowances, charges, paymentMeans, paymentTerms, prepaidAmount. All amounts are STRINGS, so no float rounding reaches a total |
invoice.targetProfile | string | Which profile to target. Only "EN16931" is generated today. A target, not a declaration: what the file actually is gets read back off BT-24 after the XML is built |
returnBlob | boolean | Defaults to TRUE here, unlike every other generate endpoint. An invoice carries the buyer identity, the amounts and the seller bank account, so the bytes come back in the response rather than being uploaded to a URL the PDF proxy serves without authentication. Send false to get a URL instead |
Create, read, update and delete documents. Give a document an alias and every endpoint here accepts that name in place of its ID. 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. :id accepts the UUID or the alias.
/api/v1/documents/:idUpdate a document in place. Send only the fields you want to change. Setting an alias is what makes a document callable by name from the rest of the API.
| Parameter | Type | Description |
|---|---|---|
title | string | New title |
slug | string | Alias, 1-50 characters of a-z, 0-9, dash and underscore. Send null or "" to remove it. Omit the field to leave the current alias alone: renaming a document never moves its alias. |
description | string | Free text description |
language | string | Language code |
categories | array | Category names |
content | object | The serialized layout. The variable schema is recomputed from it, so /schema stays in step. |
/api/v1/documents/:idDelete a document. :id accepts the UUID or the alias.
/api/v1/documents/:id/schemaGet the variable schema for a document. 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 without reading the document source.
/api/v1/documents/:id/duplicateDuplicate a document with optional title and language override. The alias is not copied: it is unique per organization and identifies the original.
| Parameter | Type | Description |
|---|---|---|
title | string | Title 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, design a document in the visual editor, generate your first PDF via API in about five minutes.