⚠️ Work in progress — createCMS is pre-1.0 and not production-ready (not tested in production). Expect breaking changes.
createCMS
Reference

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
POST/{collection}/publishBranch
const { data, error } = await client.pages.publishBranch({
  body: {
    rootId: 'root_home', // required
    branchId: 'br_main', // required
  },
});
Parameters
rootIdstringrequired

The root to publish.

branchIdstringrequired

The branch whose head commit is published.

publishedBystring

Actor override; defaults to the current user.

Returns
publicationPublication

The 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
POST/{collection}/unpublishBranch
const { data, error } = await client.pages.unpublishBranch({
  body: {
    rootId: 'root_home', // required
    branchId: 'br_main', // required
  },
});
Parameters
rootIdstringrequired

The root whose publication to remove.

branchIdstringrequired

The branch whose publication to remove.

Returns
rootIdstring

The root whose publication was removed.

branchIdstring

The branch whose publication was removed.

unpublishedCommitIdstring

The commit that was live before it was taken offline.

unpublishedAtDate

When 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
POST/{collection}/schedulePublication
const { data, error } = await client.pages.schedulePublication({
  body: {
    rootId: 'root_home', // required
    branchId: 'br_main', // required
    scheduledAt: '2026-01-01T00:00:00Z', // required
  },
});
Parameters
rootIdstringrequired

The root to publish when due.

branchIdstringrequired

The branch whose head commit is published when due.

scheduledAtDaterequired

When the publish becomes due (ISO string or Date).

Returns
scheduledScheduledPublication

The 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
POST/{collection}/scheduleUnpublish
const { data, error } = await client.pages.scheduleUnpublish({
  body: {
    rootId: 'root_home', // required
    branchId: 'br_main', // required
    scheduledAt: '2026-02-01T00:00:00Z', // required
  },
});
Parameters
rootIdstringrequired

The root to unpublish when due.

branchIdstringrequired

The branch whose publication is removed when due.

scheduledAtDaterequired

When the unpublish becomes due (ISO string or Date).

Returns
scheduledScheduledPublication

The 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.

Anonymous read
GET/{collection}/getPublishedContent
const { data, error } = await client.pages.getPublishedContent({
  query: { slug: 'welcome' }, // one of rootId, slug, or path required
});
Parameters
rootIdstring

Fetch this root directly. One of rootId, slug, or path is required.

slugstring

Resolve a root by slug; must be unique within the active scope.

pathstring

Resolve a root by path (for nested slugs).

rawboolean

If true, skip variable substitution and link-path resolution.

branchNamestring

Resolve only this published branch (returned as a length-1 variants array). When omitted, all published branches are returned.

Returns
rootIdstring

The resolved entry id.

collectionstring

The 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 }optional

Present 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 }[]optional

The 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
GET/{collection}/listPublications
const { data, error } = await client.pages.listPublications({
  query: { limit: 20, rootId: 'root_home' },
});
Parameters
limitnumber= 20

Page size, 1 to 100.

offsetnumber= 0

Rows to skip.

rootIdstring

Filter to publications of a specific root.

branchIdstring

Filter to publications of a specific branch.

publishedAfterDate

Only publications on or after this date.

publishedBeforeDate

Only publications on or before this date.

sortDirection'asc' | 'desc'= 'desc'

Sort order by publish date (newest first by default).

Returns
publicationsPublication[]

The publications on this page. Each item: `{ rootId, branchId, commitId, publishedBy, publishedAt, branchName, rootProperties }`, plus `publishedByUser` when user enrichment is enabled.

totalnumber

Total publications matching the filter, ignoring limit/offset.

hasMoreboolean

Whether more publications exist after this page.

Each publications item includes rootId, branchId, commitId, publishedBy, publishedAt, branchName, rootProperties, and (when user enrichment is enabled) publishedByUser.

On this page