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

Comments API

Threaded review comments on merge requests and blocks.

Comment methods let reviewers open threads on a merge request or a block, reply, mention users, and resolve or reopen the discussion. They live at cms.api.<collection>.<method> and mirror on the client at client.<collection>.<method> with identical types. Examples below use pages as the sample collection.

These endpoints operate on comment threads and messages, not on content commits, so no method returns a commit envelope.

Open a Comment Thread

Open a new review thread with an initial message, so reviewers can flag something on a merge request or a block. targetType picks the anchor: 'mergeRequest' requires mergeRequestId, 'block' requires blockId. Anyone you list in mentions gets a notification.

comment:create
POST/{collection}/createCommentThread
const { data, error } = await client.pages.createCommentThread({
  body: {
    targetType: 'mergeRequest', // required
    mergeRequestId: 'mr_8fd21c', // required when targetType is 'mergeRequest'
    body: 'Can we tighten the hero copy before merging?', // required
    mentions: ['user_editor'],
  },
});
Parameters
targetType'mergeRequest' | 'block'required

What the thread is attached to.

bodystringrequired

Initial message text (non-empty).

mergeRequestIdstring

Merge request to attach to. Required when targetType is 'mergeRequest'; also infers rootId.

blockIdstring

Block to attach to. Required when targetType is 'block'.

commitIdstring

Optional commit to pin the thread to a specific snapshot.

rootIdstring

Optional root ID. Inferred from the merge request when omitted.

mentionsstring[]

User IDs to mention in the initial message.

Returns
threadCommentThread

The new thread: `{ id, status, targetType, rootId, mergeRequestId, blockId, commitId, createdBy, createdAt, ... }`.

messageCommentMessage

The initial message, with its resolved `mentions` (the author is stripped out).

Reply to a Thread

Reply to an existing thread, optionally nested under a parent message. The thread's creator and every mentioned user get notified.

comment:create
POST/{collection}/createCommentMessage
const { data, error } = await client.pages.createCommentMessage({
  body: {
    threadId: 'thr_1a2b3c', // required
    body: 'Updated, ready for another look.', // required
  },
});
Parameters
threadIdstringrequired

Thread to reply in.

bodystringrequired

Message text (non-empty).

parentMessageIdstring

Parent message for a nested reply.

mentionsstring[]

User IDs to mention in this message.

Returns
messageCommentMessage

The new reply, with its resolved `mentions` and `parentMessageId` when nested.

List Comment Threads

Page through comment threads, filtered by what they're attached to (merge request, block, commit, root), by status, or by who was mentioned. Each thread comes back with its message count and first/latest message, so you can render a list without a second round-trip. Every query field is optional.

comment:read
GET/{collection}/listCommentThreads
const { data, error } = await client.pages.listCommentThreads({
  query: {
    status: 'open',
    limit: 50,
  },
});
Parameters
mergeRequestIdstring

Filter by merge request.

blockIdstring

Filter by block.

commitIdstring

Filter by commit.

rootIdstring

Filter by root.

status'open' | 'resolved'

Filter by thread status.

mentionedUserIdstring

Only threads mentioning this user.

limitnumber= 20

Page size, 1 to 100.

offsetnumber= 0

Rows to skip.

Returns
threadsCommentThreadSummary[]

The threads on this page, newest first. Each carries `messageCount`, `firstMessage`, `latestMessage`, and enriched `createdByUser` / `resolvedByUser`.

totalnumber

Total threads matching the filters, ignoring limit/offset.

hasMoreboolean

Whether more threads exist after this page.

Get a Thread with Its Messages

Load a single thread together with all of its messages in chronological order, so you can render the full discussion. Deleted messages still come back, but with their body masked to null.

comment:read
GET/{collection}/getCommentThread
const { data, error } = await client.pages.getCommentThread({
  query: { threadId: 'thr_1a2b3c' }, // required
});
Parameters
threadIdstringrequired

Thread to fetch.

Returns
threadCommentThread

The thread, with enriched `createdByUser` / `resolvedByUser`.

messagesCommentMessage[]

Every message in the thread, oldest first. Deleted messages come back with `body: null`; author profiles attach as `authorUser` when user enrichment is on.

Edit a Message

Edit the text of a message you wrote, and optionally replace its mentions. Only the original author may edit, and system messages cannot be edited.

comment:update
POST/{collection}/updateCommentMessage
const { data, error } = await client.pages.updateCommentMessage({
  body: {
    messageId: 'msg_9f8e7d', // required
    body: 'Revised: tightened the hero copy.', // required
  },
});
Parameters
messageIdstringrequired

Message to edit.

bodystringrequired

New message text (non-empty).

mentionsstring[]

When provided, replaces the message's mentions.

Returns
messageCommentMessage

The edited message, with `editedAt` set and its current `mentions`.

Resolve a Thread

Mark a thread as resolved once its discussion is settled. A system message is appended recording who resolved it, and you get both the updated thread and that message back.

comment:update
POST/{collection}/resolveCommentThread
const { data, error } = await client.pages.resolveCommentThread({
  body: { threadId: 'thr_1a2b3c' }, // required
});
Parameters
threadIdstringrequired

Thread to resolve.

Returns
threadCommentThread

The thread, now resolved: `status: 'resolved'` with `resolvedBy` and `resolvedAt` set.

messageCommentMessage

The appended system message recording the resolution (`messageType: 'system'`, `systemType: 'threadResolved'`).

Reopen a Thread

Reopen a resolved thread when the discussion isn't finished after all. A system message is appended recording the reopening, and you get both the updated thread and that message back.

comment:update
POST/{collection}/reopenCommentThread
const { data, error } = await client.pages.reopenCommentThread({
  body: { threadId: 'thr_1a2b3c' }, // required
});
Parameters
threadIdstringrequired

Thread to reopen.

Returns
threadCommentThread

The thread, reopened: `status: 'open'` with `resolvedBy` / `resolvedAt` cleared.

messageCommentMessage

The appended system message recording the reopening (`systemType: 'threadReopened'`).

Delete a Thread

Soft-delete a thread so it drops out of list and get. Its messages and mentions stay in the database and are removed only when the owning root is pruned.

comment:delete
POST/{collection}/deleteCommentThread
const { data, error } = await client.pages.deleteCommentThread({
  body: { threadId: 'thr_1a2b3c' }, // required
});
Parameters
threadIdstringrequired

Thread to soft-delete.

Returns
threadIdstring

The id of the soft-deleted thread.

Delete a Message

Soft-delete a single message so its body is masked on retrieval. Only the original author may delete, and system messages cannot be deleted.

comment:delete
POST/{collection}/deleteCommentMessage
const { data, error } = await client.pages.deleteCommentMessage({
  body: { messageId: 'msg_9f8e7d' }, // required
});
Parameters
messageIdstringrequired

Message to soft-delete.

Returns
messageCommentMessage

The soft-deleted message, returned with `body: null` and `deletedAt` set.

List a User's Mentions

Page through the mentions a user has received, each with the message and thread it came from, so you can build a mentions inbox. Filter to a single thread with threadId.

comment:read
GET/{collection}/listMentions
const { data, error } = await client.pages.listMentions({
  query: {
    mentionedUserId: 'usr_1', // required
    limit: 50,
  },
});
Parameters
mentionedUserIdstringrequired

User whose mentions to list.

threadIdstring

Restrict to mentions in one thread.

limitnumber= 20

Page size, 1 to 100.

offsetnumber= 0

Rows to skip.

Returns
mentionsMention[]

The mentions on this page, newest first. Each has `id`, `mentionedUserId`, `mentionedBy`, `createdAt`, plus the full `message` and `thread` it belongs to.

totalnumber

Total mentions matching the filters, ignoring limit/offset.

hasMoreboolean

Whether more mentions exist after this page.

On this page