Authorization
AuthorizationRequiredBearer <token>API key from Settings page. Keys start with p4_live_ prefix.
In: header
Request Body
application/jsonRequirednameRequiredstringTemplate name. A slug is auto-generated from this.
htmlstringHTML template content. Supports Handlebars {{variables}}.
pdf_formatobjectPage format configuration. If omitted, defaults to A4 portrait with 20mm top/bottom and 15mm left/right margins.
sample_dataobjectDefault sample values for preview
header_component_idstringHeader component ID (comp_xxx)
footer_component_idstringFooter component ID (comp_xxx)
Template created
Generate a PDF
Render a PDF from a saved template or raw HTML. Pass `template_id` to use a saved template, or `html` for one-off renders. Variables in `{{handlebars}}` syntax are replaced with values from `data`. Returns the PDF as binary data (`application/pdf`).
Delete a template
Permanently delete a template. This action cannot be undone. Requires `full_access` API key scope.