Skip to content

Notifications ​

In-app inbox, push (FCM HTTP v1 and APNs) and email, behind the platform Notifier port. Every route needs a signed-in user (Authorization: Bearer <access token>) and is mounted under /v1. Responses use { data, meta }. Errors are RFC 9457 Problem Details.

Inbox ​

MethodPathBody / queryResponseErrors
GET/notifications?cursor&limit(1-100, default 20)&category&unread=truepage of Notification, meta.nextCursor, meta.hasMorePAGINATION_CURSOR_INVALID, VALIDATION_FAILED
GET/notifications/badge{ unread } (capped at 999)
POST/notifications/read-all{ category? }{ updated, unread }VALIDATION_FAILED
POST/notifications/:id/readNotificationNOTIFICATION_NOT_FOUND
POST/notifications/:id/unreadNotificationNOTIFICATION_NOT_FOUND
POST/notifications/:id/openNotification (read, and recorded as opened)NOTIFICATION_NOT_FOUND
DELETE/notifications/:id{ status: "ok" }NOTIFICATION_NOT_FOUND

Notification: id, type, category, priority, title, body, imageAssetId, deepLink, target { type, id } | null, actor { userId, profileId }, collapsedCount, isRead, readAt, createdAt, updatedAt. The list is newest first. An unread item with the same collapse key is replaced and moved to the top, and collapsedCount goes up.

Writes are limited to 120 a minute per user (RATE_LIMITED).

Preferences and settings ​

MethodPathBodyResponseErrors
GET/notifications/preferences{ settings, categories[] }
PUT/notifications/preferences{ changes: [{ type, channel: in_app|push|email, isEnabled }] } (1-200)same as GETNOTIFICATION_TYPE_UNKNOWN, NOTIFICATION_CHANNEL_LOCKED
GET/notifications/settingsSettings
PATCH/notifications/settingsany of { isPushEnabled, isEmailEnabled, quietHours { isEnabled, start "HH:MM", end "HH:MM" }, timeZone }SettingsNOTIFICATION_QUIET_HOURS_INVALID, VALIDATION_FAILED

categories[]: { code, name, isMarketing, types: [{ code, name, isConfigurable, channels: { in_app, push, email: { isAvailable, isEnabled } } }] }. Only channels a type uses can be switched. Receipts, payments, security and incoming calls can't be switched off at all.

Quiet hours are local to timeZone (default NOTIFY_DEFAULT_TIMEZONE). They can cross midnight. Non-critical pushes are held until the window ends, or dropped if they'd expire first. Critical notifications bypass quiet hours and daily caps.

Socket: /notify ​

The token is the realtime access token. Every emit goes to the person's own user:<id> room.

DirectionEventPayloadAck
client → serverbadge:get{}{ unread }
client → servernotification:read{ id }Notification
client → servernotification:open{ id }Notification
client → servernotifications:read_all{ category? }{ updated, unread }
server → clientnotification:created{ notification, unread }
server → clientnotification:updated{ notification, unread } (a collapse replaced it)
server → clientnotification:removed{ id, unread }
server → clientbadge:updated{ unread }

Commands are limited to 30 per 10 seconds per socket.

Push payload ​

FCM data and APNs custom keys: type, requestId, plus notificationId, deepLink, targetType, targetId when set. Calls (call.incoming) ring through PushKit (<bundle>.voip) on iOS, and through a high-priority FCM data message elsewhere. Message pushes (message.received) never carry a body.

For other modules ​

api.notify(request, tx?) takes a NotifyRequest (src/platform/ports/notifier.ts). type must be in the catalogue (notification_types). dedupeKey is unique, and a repeat is ignored. With tx, the request commits with the caller's transaction and is queued after the commit. Delivery is asynchronous: notify-critical for critical priority, notify-bulk for everything else. A followers audience is expanded in batches of 500.

Event: notifications.notification.opened { notificationId, userId, type, category, targetType, targetId, openedAt }.

Listening parties ​

The together module sends three types: together.party_scheduled (to invitees when a party is scheduled), together.party_starting (to invitees and presavers about 10 minutes before) and together.party_cancelled. All three are in the content category, and people can switch them per channel. Together fans out to presavers itself, in batches of users audiences, so notifications needs no new API for this.

Ports the integrator provides ​

PortMembersUsed by
followers (required)listFollowerUserIds(profileId, cursor, limit)followers audiences
engagement (optional)listContinueListening(cursor, limit), listWeeklyMixReady(weekKey, cursor, limit), listWeeklyDigests(weekKey, cursor, limit), listNewForYou(cursor, limit), listStreaksAtRisk(cursor, limit), listInactiveUsers(days, cursor, limit)engagement jobs; each returns { items, nextCursor }
trials (optional)listTrialsEndingBetween(from, to, cursor, limit)hourly trial-ending reminders
onInvalidPushTarget (optional)(deviceId, "push" | "voip")identity clears dead tokens

Without engagement or trials, those scheduled jobs do nothing.

Plemuz API v2