Notifications

List notifications

GET /api/notifications
ParamTypeDefaultDescription
limitnumber50Max notifications
offsetnumber0Offset for pagination
const notifications = await client.listNotifications(50, 0)
notifications = client.list_notifications(limit=50, offset=0)

Mark notification as read

PATCH /api/notifications/:id/read
await client.markNotificationRead('notification-id')
client.mark_notification_read("notification-id")

Mark all as read

POST /api/notifications/read-all
await client.markAllNotificationsRead()
client.mark_all_notifications_read()

Mark scope as read

POST /api/notifications/read-scope

Mark all notifications for a specific server or channel as read.

FieldTypeDescription
serverIdstringServer ID (optional)
channelIdstringChannel ID (optional)
await client.markScopeRead({ serverId: 'server-id' })
client.mark_scope_read(server_id="server-id")

Get unread count

GET /api/notifications/unread-count
const { count } = await client.getUnreadCount()
result = client.get_unread_count()
count = result["count"]

Get scoped unread counts

GET /api/notifications/scoped-unread

Returns unread counts grouped by server/channel.

const scoped = await client.getScopedUnread()
scoped = client.get_scoped_unread()

Get notification preferences

GET /api/notifications/preferences
const prefs = await client.getNotificationPreferences()
prefs = client.get_notification_preferences()

Update notification preferences

PATCH /api/notifications/preferences
FieldTypeDescription
strategystringall, mention_only, or none
mutedServerIdsstring[]Server IDs to mute
mutedChannelIdsstring[]Channel IDs to mute
const updated = await client.updateNotificationPreferences({
  strategy: 'mention_only',
  mutedServerIds: ['server-1'],
})
updated = client.update_notification_preferences(
    strategy="mention_only",
    mutedServerIds=["server-1"],
)