Versioning a section
Once a section exists, iterate by creating new versions.versionNumber.
{ "status": "published" } and the section’s publishedVersion will reflect the new version on subsequent GET calls.
Versioning a template
Once a template exists, iterate by creating new versions. The published version stays live until you explicitly publish a new one.{ "status": "published" } and subsequent GET /documents/templates/{templateID} reflects the new publishedVersion.
Publishing a template version validates that every referenced section has a published version. Fix any unpublished sections before retrying the publish.
Independent versioning — what a template version captures
Sections and templates are versioned independently. A template version records:- the template’s instructions,
- which sections it references,
- the ordering of those sections.
This means reverting a template version does not roll back changes you made to individual sections. For example, if you edit section A, add a new section B to the template, then edit section C, reverting only the template keeps all three section changes. Reverting each section individually would restore its prior prompts and schema, but not affect the template’s composition. And because sections are shared across templates, reverting a section affects every template that references it.Practical takeaway: if you need to roll back a template and its sections to a known-good state, revert the template version first, then revert the individual section versions. There is no single operation that reverts both at once.