Create a template
create_templateCreate a new custom PDF template owned by this account: a name, a unique slug, a Handlebars/HTML body, and optional CSS and JSON Schema. The slug is what render_pdf then takes as template. Custom templates are a paid feature — on the Free plan this returns 403 FORBIDDEN before anything is created. The slug must be unique within the account and must not collide with a built-in system slug (invoice, receipt, quote, …); both cases come back 422, and the fix for an already-taken slug is update_template rather than a retry. A brand-new template has no published version, so it renders straight from what you supply here — publish_template only becomes necessary once you start cutting versions. Requires a Kamy API key with the templates:write scope; without a key, returns dashboard setup instructions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | No | Stylesheet applied at render time. Max 1 MB. | |
| html | Yes | Handlebars/HTML body of the document. Max 5 MB. | |
| name | Yes | Human-readable template name. | |
| slug | Yes | Stable identifier the render tools take as `template`. Unique per account, and it may not collide with a built-in system slug (invoice, receipt, quote, …) — both cases are rejected with 422. | |
| tags | No | Up to 10 free-form labels. | |
| schema | No | JSON Schema describing the data payload the template expects. Defaults to {}. | |
| isPublic | No | When true, other accounts can list and render it. Defaults to false. | |
| description | No | What this template is for. |