Skip to Content
ConceptsTemplate Lifecycle

Template Lifecycle

A template carries a name, its output formats (pdf, xlsx, or both), an ordered list of sections, typed variables, and a status:

Draft

Every template starts as a draft. Drafts are fully editable and visible in the dashboard and in list endpoints, but cannot be renderedPOST /v1/render against a draft returns:

400 Template is not published

Published

Publishing (the dashboard’s Publish button, or POST /v1/templates/:id/publish) makes the template renderable. You can keep editing a published template — it stays renderable while you do.

Publishing is a dashboard/REST action. The SDK clients intentionally don’t expose publish/archive — the SDK surface is focused on rendering and reading templates.

Archived

Deleting a template (dashboard delete, or DELETE /v1/templates/:id) is a soft delete: status becomes archived, the template disappears from list results, and it can no longer be rendered. Nothing is destroyed — documents already rendered from it keep working.

Versions

Every update to a template creates a version entry. GET /v1/templates/:id/versions returns the full history, newest first — useful for auditing what a template looked like when a given document was rendered.

Scoping: who sees which templates

  • Secret key (sk_live_…): sees and manages all templates in the organization.
  • Public key (pk_live_…): scoped to the authenticated end user (the x-user-id from the frontend handshake) — lists return only that user’s templates.