Bring your own template JSON.
Use POST /api/v1/pdfs/custom-template when the layout is not in this deployment's preset catalog. Put the complete supported layout under template and send printable wording and populated values in separate labels and data maps. This route uses the shared PDF renderer without registering or changing a preset.
{
"template": {
"title": "{{data.documentTitle}}",
"pages": [{
"layout": "flow",
"blocks": [
{ "type": "heading", "text": "{{labels.heading}}" },
{ "type": "paragraph", "text": "{{data.summary}}" },
{ "type": "field", "label": "{{labels.owner}}", "value": "{{data.owner}}" }
]
}]
},
"labels": { "heading": "Project overview", "owner": "Prepared by:" },
"data": {
"documentTitle": "Project overview",
"summary": "A caller-defined layout populated by this request.",
"owner": "Alex Example"
}
}curl --fail-with-body \
-X POST '__API_ORIGIN__/api/v1/pdfs/custom-template' \
-H 'Content-Type: application/json' \
--data-binary '@custom-template.json' \
--output custom-document.pdf
# Add -H 'X-Api-Key: YOUR_KEY' when this deployment requires authentication.The template object follows the LegacyPdfRequest JSON schema: a title, one to 25 pages, supported page layouts, and optional rendering options or fonts. Keep labels and data outside that object. Unknown properties, invalid JSON types, unsupported layouts, missing bindings, and failed field validation return HTTP 400 with a JSON validation response. A successful request returns the PDF bytes. Use the preset route when you want a server-provided layout; use this route when you want to supply the layout too.