Notifications
The per-user inbox, via cms.api.notifications.
Notifications are the per-user inbox. The CMS raises them on @mentions in comments, approval decisions, merge-request activity, and publishing. Methods live under cms.api.notifications and mirror on the client as client.notifications.<method> with identical types.
These endpoints operate on the recipient's inbox, not on content commits, so no method returns a commit envelope. Every endpoint scopes to the authenticated user: reads and mutations only ever touch the current user's own notifications, and acting on another user's notification fails with NOTIFICATION_RECIPIENT_MISMATCH.
The whole notifications namespace is omitted when the CMS is configured with notifications: false.
Methods
List Notifications
Fetch a page of your notifications (newest first, archived ones excluded) so you can render an inbox. Filter by type, collection, or read status, or leave every query field off to pull the latest across the board.
notification:read/notifications/listconst data = await cms.api.notifications.list({
query: { unreadOnly: true, limit: 10 },
});const { data, error } = await client.notifications.list({
query: { unreadOnly: true, limit: 10 },
});typeNotificationTypeFilter by notification type (see Types below for the full set).
unreadOnlybooleanWhen true, returns only unread notifications.
collectionstringFilter to notifications about one collection.
limitnumber= 20Page size, 1 to 100.
offsetnumber= 0Rows to skip.
notificationsNotificationListItem[]This page of notifications, newest first. Each carries id, recipientId, actorId, type, title, body, resourceType, resourceId, collection, meta, readAt, and createdAt.
totalnumberTotal matching notifications across all pages, ignoring limit/offset.
hasMorebooleanWhether more notifications exist after this page.
unreadCountnumberCount of all your unread notifications, independent of the current page or filters.
unreadCount is the count of all unread notifications for the user, independent of the current page or filters. Each item carries id, recipientId, actorId, type, title, body, resourceType, resourceId, collection, meta, readAt, and createdAt. Pass the transport-level withUser: true flag to also include actorUser (the acting user, limited to your user config's exposeColumns allowlist) on each item.
Mark Notifications Read
Mark a notification as read once you've seen it. Pass a notificationId to clear a single one, or omit it entirely to mark your whole unread inbox as read in one call. You get back how many were actually flipped.
notification:update/notifications/markNotificationsReadconst data = await cms.api.notifications.markNotificationsRead({
body: { notificationId: 'notif_8fd21c' }, // omit body to mark all unread as read
});const { data, error } = await client.notifications.markNotificationsRead({
body: { notificationId: 'notif_8fd21c' }, // omit body to mark all unread as read
});notificationIdstringNotification to mark read. Omit to mark all unread notifications read.
markedCountnumberHow many notifications this call flipped to read.
Mark Notifications Unread
Flag a notification as unread so it resurfaces for later. Pass a notificationId to reopen one, or omit it to mark all of your read notifications unread. You get back how many were flipped.
notification:update/notifications/markNotificationsUnreadconst data = await cms.api.notifications.markNotificationsUnread({
body: { notificationId: 'notif_8fd21c' }, // omit body to mark all read as unread
});const { data, error } = await client.notifications.markNotificationsUnread({
body: { notificationId: 'notif_8fd21c' }, // omit body to mark all read as unread
});notificationIdstringNotification to mark unread. Omit to mark all read notifications unread.
markedCountnumberHow many notifications this call flipped to unread.
Archive a Notification
Archive a notification to drop it from your active inbox, so it stops showing up in list. Use it to clear out items you're done with without losing the underlying record.
notification:delete/notifications/archiveNotificationconst data = await cms.api.notifications.archiveNotification({
body: { notificationId: 'notif_8fd21c' }, // required
});const { data, error } = await client.notifications.archiveNotification({
body: { notificationId: 'notif_8fd21c' }, // required
});notificationIdstringrequiredThe notification to archive.
notificationIdstringThe id of the notification that was archived.
Types
type is one of: mention, comment, threadResolved, threadReopened, approvalRequested, approvalApproved, approvalRejected, mergeRequestOpened, mergeRequestMerged, mergeRequestClosed, mergeRequestReopened, published, custom.