Templates / Versioning & rollback

Versioning & rollback

Templates separate what you are editing from what is live, so changing a template can never surprise your running integration.

Draft and versions

  • A template has one mutable draft: the HTML and sample data in the editor. Saving overwrites it.
  • Publishing freezes the current draft into an immutable version, numbered in order (1, 2, 3, ...). A version never changes after it is created.

Publishing also points the template at the new version and leaves your draft untouched, so you can keep editing toward the next version while the previous one stays live.

What the API renders

/v1/generate always renders the template's currently published version, never your draft. This is the core guarantee: you can edit and preview freely without affecting production, and a new version goes live only when you explicitly publish it.

A template that has never been published has no version to render, so the API returns template_not_published (422). Publish once and the call succeeds.

Version history

Every published version is kept. Open Versions from the editor for the full history: a timeline of the draft and every published version, where you can read any version's exact HTML and sample data, render it as a real preview, and compare two versions (or a version against your current draft) side by side to see precisely what changed.

Rolling back

From the history, go back to an earlier version by rolling back to it.

Rollback restores a chosen version's HTML and sample data into your draft. It does not change the live version by itself. To actually serve the older content, publish again after rolling back. This makes rollback safe: you can inspect and preview the restored draft before it goes live.

So the full "revert production" flow is: roll back to version N, preview to confirm, then publish (which creates a new version with that content and points the template at it).

Preview and the fidelity promise

The editor preview renders your draft as a real PDF through the identical Chromium engine, CSS, and page settings as /v1/generate. There is no separate "preview renderer" that can drift from production.

Because the only difference between previewing a draft and generating from a version is which HTML is rendered (and they are the same bytes once you publish), what you approve in the preview is what your users receive. Any visible difference between the two is treated as a bug, not an expected quirk.

Preview has no side effects: it never creates a generation and never counts against your quota.