Publications API
Publish, unpublish, schedule, and read published content.
Publications control what content is publicly live. Every method lives at cms.api.<collection>.<method> (use your collection name, e.g. cms.api.pages) and mirrors on the client as client.<collection>.<method> with identical types.
Publishing points a publication at the branch's existing head commit rather than creating a new one, so unlike the entry and block mutation APIs these methods do not return a commit envelope.
Publishing
Publish a Branch
Publish a branch, making its head commit the version your readers see live. You get back the resulting publication (publishing points at the existing head commit, so there is no new commit). Fails with PUBLICATION_APPROVAL_REQUIRED if the branch has open approval requests that are not all approved.
publication:create/{collection}/publishBranchconst data = await cms.api.pages.publishBranch({
body: {
rootId: 'root_home', // required
branchId: 'br_main', // required
},
});const { data, error } = await client.pages.publishBranch({
body: {
rootId: 'root_home', // required
branchId: 'br_main', // required
},
});rootIdstringrequiredThe root to publish.
branchIdstringrequiredThe branch whose head commit is published.
publishedBystringActor override; defaults to the current user.
publicationPublicationThe publication: `{ rootId, branchId, commitId, publishedBy, publishedAt, branchName }`.
The returned publication carries rootId, branchId, commitId, publishedBy, publishedAt, and branchName.
Unpublish a Branch
Take a branch's content offline by removing its publication. You get back which commit was live and when it came down. Fails with PUBLICATION_NOT_FOUND when no active publication exists for the root-branch pair.
publication:delete/{collection}/unpublishBranchconst data = await cms.api.pages.unpublishBranch({
body: {
rootId: 'root_home', // required
branchId: 'br_main', // required
},
});const { data, error } = await client.pages.unpublishBranch({
body: {
rootId: 'root_home', // required
branchId: 'br_main', // required
},
});rootIdstringrequiredThe root whose publication to remove.
branchIdstringrequiredThe branch whose publication to remove.
rootIdstringThe root whose publication was removed.
branchIdstringThe branch whose publication was removed.
unpublishedCommitIdstringThe commit that was live before it was taken offline.
unpublishedAtDateWhen the content was taken offline.
Scheduling
Schedule a Publish
Queue a branch to publish itself at a future time. Nothing goes live until the cron-driven admin.runScheduled processes the due row; the root (in scope) and branch are validated up front, so you catch bad ids now rather than at run time.
publication:create/{collection}/schedulePublicationconst data = await cms.api.pages.schedulePublication({
body: {
rootId: 'root_home', // required
branchId: 'br_main', // required
scheduledAt: '2026-01-01T00:00:00Z', // required
},
});const { data, error } = await client.pages.schedulePublication({
body: {
rootId: 'root_home', // required
branchId: 'br_main', // required
scheduledAt: '2026-01-01T00:00:00Z', // required
},
});rootIdstringrequiredThe root to publish when due.
branchIdstringrequiredThe branch whose head commit is published when due.
scheduledAtDaterequiredWhen the publish becomes due (ISO string or Date).
scheduledScheduledPublicationThe queued row: `{ id, rootId, branchId, action: 'publish', scheduledAt, processedAt }` (`processedAt` is null until the cron runs it).
The returned scheduled row carries id, rootId, branchId, action: 'publish', scheduledAt, and processedAt (null until run).
Schedule an Unpublish
Queue a branch's content to go offline at a future time. The content is taken down when admin.runScheduled processes the due row, so reach for this to expire content on a schedule.
publication:delete/{collection}/scheduleUnpublishconst data = await cms.api.pages.scheduleUnpublish({
body: {
rootId: 'root_home', // required
branchId: 'br_main', // required
scheduledAt: '2026-02-01T00:00:00Z', // required
},
});const { data, error } = await client.pages.scheduleUnpublish({
body: {
rootId: 'root_home', // required
branchId: 'br_main', // required
scheduledAt: '2026-02-01T00:00:00Z', // required
},
});rootIdstringrequiredThe root to unpublish when due.
branchIdstringrequiredThe branch whose publication is removed when due.
scheduledAtDaterequiredWhen the unpublish becomes due (ISO string or Date).
scheduledScheduledPublicationThe queued row, same shape as `schedulePublication` but with `action: 'unpublish'`.
The returned scheduled row is identical in shape to schedulePublication, with action: 'unpublish'.
Reading
Read Published Content
Fetch the live, published content for an entry, looked up by rootId, slug, or path (pass at least one). References are resolved inline and variables substituted unless you set raw. It runs the full auth chain (so plugin scope stays enforced) but is conventionally anonymous-readable.
/{collection}/getPublishedContentconst data = await cms.api.pages.getPublishedContent({
query: { slug: 'welcome' }, // one of rootId, slug, or path required
});const { data, error } = await client.pages.getPublishedContent({
query: { slug: 'welcome' }, // one of rootId, slug, or path required
});rootIdstringFetch this root directly. One of rootId, slug, or path is required.
slugstringResolve a root by slug; must be unique within the active scope.
pathstringResolve a root by path (for nested slugs).
rawbooleanIf true, skip variable substitution and link-path resolution.
branchNamestringResolve only this published branch (returned as a length-1 variants array). When omitted, all published branches are returned.
rootIdstringThe resolved entry id.
collectionstringThe collection the entry belongs to.
variants{ branchId, branchName, commitId, publishedAt, publishedBy, tree }[]One entry per published branch, each with a fully resolved block `tree`. A single-element array when you pass `branchName`.
abTest{ testId, trafficPercentage, controlBranchId }optionalPresent only when the entry has a running page-level A/B test with at least two published variant branches and a published control.
ancestors{ rootId, slug }[]optionalThe entry's ancestor chain. Present only for nested-slug collections.
Each variants item carries branchId, branchName, commitId, publishedAt, publishedBy, and a resolved block tree. ancestors is present only for nested-slug collections.
List Publications
List the publications in a collection, so you can see what is currently live and when it went out. Filter by root, branch, or date range. Publications of soft-deleted roots are excluded.
publication:read/{collection}/listPublicationsconst data = await cms.api.pages.listPublications({
query: { limit: 20, rootId: 'root_home' },
});const { data, error } = await client.pages.listPublications({
query: { limit: 20, rootId: 'root_home' },
});limitnumber= 20Page size, 1 to 100.
offsetnumber= 0Rows to skip.
rootIdstringFilter to publications of a specific root.
branchIdstringFilter to publications of a specific branch.
publishedAfterDateOnly publications on or after this date.
publishedBeforeDateOnly publications on or before this date.
sortDirection'asc' | 'desc'= 'desc'Sort order by publish date (newest first by default).
publicationsPublication[]The publications on this page. Each item: `{ rootId, branchId, commitId, publishedBy, publishedAt, branchName, rootProperties }`, plus `publishedByUser` when user enrichment is enabled.
totalnumberTotal publications matching the filter, ignoring limit/offset.
hasMorebooleanWhether more publications exist after this page.
Each publications item includes rootId, branchId, commitId, publishedBy, publishedAt, branchName, rootProperties, and (when user enrichment is enabled) publishedByUser.