Aggregated unread counts
GET
/users/me/unread-countsReturn the authenticated user's unread chat, announcement, and notification counts in a single request. Intended for surfaces that render several badges at once, such as tab bars and app icons.
| Auth | Login required |
|---|
Query parameters
sincestringOnly count notifications created at or after this timestamp (ISO 8601). Chat counts are based on read position and are unaffected.
Notes
`announcements` is a subset of `notifications` (announcements are also unread notifications). `badge` is the sum of unread messages and non-chat unread notifications, ready to use as an app icon badge.
Response
| Field | Type | Description |
|---|---|---|
chat.messages | number | Total unread messages. |
chat.rooms | number | Number of chat rooms with unread messages. |
chat.byCategory | object | Unread messages per category (chat / event / community). |
announcements | number | Unread announcement notifications. |
notifications | number | Unread notifications across all types. |
badge | number | Count to display as an app icon badge. |
Request
curl https://api.4s.link/users/me/unread-counts \-H "Authorization: Bearer 4s_at_..."
Example response
{"chat": {"messages": 12,"rooms": 3,"byCategory": { "chat": 5, "event": 4, "community": 3 }},"announcements": 2,"notifications": 5,"badge": 15}