Publish a new template version
update_templatePublish a new immutable version of an existing template. Versions are never edited in place: invoice@2 keeps rendering exactly as it did, and anything pinned to it is unaffected. Renders cached against the old version stay valid, and the new version starts with a cold cache. engine, schema, options and example are inherited from the previous version unless you send them, so a source-only change needs only template and source. Free.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| engine | No | Engine for the new version. Inherited from the previous version when omitted. | |
| schema | No | JSON Schema for the `data` payload. Inherited from the previous version when omitted — send `{}` only if you really want a version that validates nothing. | |
| source | Yes | One self-contained HTML document with inline CSS and Liquid expressions (`{{ customer.name }}`, `{% for line in line_items %}`). No file includes: everything the render needs must be in this string, or at a public https URL. Two extra filters ship by default: `money` and `date_medium`. For a PDF, use `@page { size: Letter; margin: 18mm }` to control pagination. | |
| example | No | A payload that renders correctly under the new version. Inherited when omitted. | |
| message | No | Change note for this version, like a commit message. | |
| options | No | Default render options. Inherited from the previous version when omitted. | |
| template | Yes | Name of an existing template. A new immutable version is published; earlier versions keep rendering, so anything pinned to `name@2` is unaffected. | |
| description | No | Replaces the template description. | |
| expected_pages | No | How many PDF pages a typical payload renders. Inherited from the previous version when omitted. This is the estimate the free tier and the spend cap are checked against before the render starts, so a template that runs to several pages must say so or a render that cannot fit the allowance will be started and then go over. It is not a limit: the render is billed on the pages it actually produced. |