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

Releases API

Group multiple entries' branches into a bundle and publish them atomically.

A release bundles several entries (roots), each pinned to one of its branches, so they can be published together in a single atomic operation. These methods live on the system namespace at cms.api.releases.<method> and mirror on the client as client.releases.<method> with identical types. A release is not per-collection: one release may span entries from different collections.

A release starts as a draft you build up with items, then flips to published when publishRelease succeeds. Item mutations only work while the release is a draft. Publishing points each item at its branch's existing head commit rather than creating new ones, so none of these methods returns a commit envelope.

Create a Release

Start a new, empty draft release and get it back to work with. Fill it with entries using addToRelease or setReleaseItems, then ship them together with publishRelease.

release:create
POST/releases/createRelease
const { data, error } = await client.releases.createRelease({
  body: { title: 'Spring launch' }, // required
});
Parameters
titlestringrequired

Human-readable name for the release (non-empty).

Returns
releaseRelease

The new draft release: `{ id, title, status: 'draft', createdBy, createdAt, publishedAt: null }`.

The returned release carries id, title, status: 'draft', createdBy, createdAt, and publishedAt (null until published).

Add an Entry to a Release

Add one entry to a draft release, pinned to the branch you want it to publish from. It upserts on (releaseId, rootId), so re-adding a root that's already in the release just swaps which branch it will publish, and the root and branch are validated up front. Fails with RELEASE_NOT_FOUND, RELEASE_NOT_DRAFT, ROOT_NOT_FOUND, or BRANCH_NOT_FOUND.

release:update
POST/releases/addToRelease
const { data, error } = await client.releases.addToRelease({
  body: {
    releaseId: 'rel_abc123', // required
    rootId: 'root_home', // required
    branchId: 'br_main', // required
  },
});
Parameters
releaseIdstringrequired

The draft release to add to.

rootIdstringrequired

The root (entry) to include.

branchIdstringrequired

The branch of that root to publish when the release publishes.

Returns
itemReleaseItem

The created or updated member: `{ id, releaseId, rootId, branchId }`.

The returned item carries id, releaseId, rootId, and branchId.

Remove an Entry from a Release

Drop one entry (by rootId) from a draft release. Fails with RELEASE_NOT_FOUND or RELEASE_NOT_DRAFT.

release:update
POST/releases/removeFromRelease
const { data, error } = await client.releases.removeFromRelease({
  body: {
    releaseId: 'rel_abc123', // required
    rootId: 'root_home', // required
  },
});
Parameters
releaseIdstringrequired

The draft release.

rootIdstringrequired

The root to remove.

Returns
removedboolean

Whether a matching item was deleted — `true` if the root was in the release, `false` otherwise.

The returned removed is true when a matching item was deleted, false otherwise.

Set a Release's Items

Replace a draft release's entire member list in one shot. Every item is validated first, then the old items are cleared and the new set inserted in a single transaction. Duplicate roots are rejected with RELEASE_DUPLICATE_ROOT; it also fails with RELEASE_NOT_FOUND, RELEASE_NOT_DRAFT, ROOT_NOT_FOUND, or BRANCH_NOT_FOUND.

release:update
POST/releases/setReleaseItems
const { data, error } = await client.releases.setReleaseItems({
  body: {
    releaseId: 'rel_abc123', // required
    items: [{ rootId: 'root_home', branchId: 'br_main' }], // required
  },
});
Parameters
releaseIdstringrequired

The draft release.

items{ rootId: string; branchId: string }[]required

The complete new member list. Replaces all existing items; roots must be unique.

Returns
itemsReleaseItem[]

The new member set after replacement — one `{ id, releaseId, rootId, branchId }` per item (empty if you passed an empty list).

Get a Release

Fetch a single release together with its items. Fails with RELEASE_NOT_FOUND.

release:read
GET/releases/getRelease
const { data, error } = await client.releases.getRelease({
  query: { releaseId: 'rel_abc123' }, // required
});
Parameters
releaseIdstringrequired

The release to fetch.

Returns
releaseRelease

The release row: `{ id, title, status, createdBy, createdAt, publishedAt }`.

itemsReleaseItem[]

The entries in the release, each `{ id, releaseId, rootId, branchId }`.

List Releases

Page through your releases, newest first, optionally narrowed to one status. Every query field is optional.

release:read
GET/releases/listReleases
const { data, error } = await client.releases.listReleases({
  query: { status: 'draft', limit: 20 },
});
Parameters
status'draft' | 'published'

Filter by release status.

limitnumber= 20

Page size, 1 to 100.

offsetnumber= 0

Rows to skip.

Returns
releasesRelease[]

The releases on this page, newest first.

totalnumber

Total releases matching the status filter, ignoring limit/offset.

hasMoreboolean

Whether more releases exist after this page.

Publish a Release

Publish every entry in the release atomically. Each item runs the same publish machinery as pages.publishBranch, all inside one database transaction: if any item fails (for example an unapproved branch under a policy that requires approval), the whole set rolls back and nothing goes live. On success the release flips to published. Fails with RELEASE_NOT_FOUND, RELEASE_NOT_DRAFT, RELEASE_EMPTY, ROOT_NOT_FOUND, BRANCH_NOT_FOUND, or PUBLICATION_APPROVAL_REQUIRED.

publication:create
POST/releases/publishRelease
const { data, error } = await client.releases.publishRelease({
  body: { releaseId: 'rel_abc123' }, // required
});
Parameters
releaseIdstringrequired

The draft release to publish.

publishedBystring

Fallback actor id, used only when the request has no session user (the request user takes precedence).

Returns
releaseRelease

The updated release, now `status: 'published'` with a set `publishedAt`.

publicationsPublication[]

One publication per item: `{ rootId, branchId, commitId, publishedBy, publishedAt, branchName }`.

The updated release has status: 'published' and a set publishedAt; publications holds one publication per item.

On this page