Guides / Versions and drafts
Guides / versions-and-drafts
Versions and drafts
Snapshots, publishing, restoring and comparing versions.
Updated Nov 20, 2026by docs seedVersion 1
Every save is a full snapshot with its author, note and changed fields.
Drafts#
With versions: { drafts: true } (the default), saving a published document changes its working copy only. The public page keeps showing the published version until someone publishes. The list shows these documents as Modified since publish.
With drafts: false, every save publishes (useful for release notes).
Publish, unpublish, archive#
await cms.publish(actor, "posts", "hello");
await cms.unpublish(actor, "posts", "hello"); // back to draft
await cms.archive(actor, "posts", "hello"); // hidden, keptrepublishedAt records when a document goes public again.
Restore and compare#
await cms.restore(actor, "posts", "hello", 3, { publish: true });
const diff = await cms.diff(actor, "posts", "hello", 3, 5);The Version history screen shows the same: side by side or unified, with word highlights.
Limits#
versions.max (default 100) keeps the newest N versions per document; the published version is always kept.