Notifications
In-app notifications belong to the authenticated user. List, unread-count, and mark-all-read operations also respect the current workspace context, while account-wide notifications remain visible. No workspace or account identifier is required in request bodies.
Endpoints
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /notifications | List notifications (paginated) | JWT |
| GET | /notifications/unread-count | Get unread notification count | JWT |
| PATCH | /notifications/:id/read | Mark one notification as read | JWT |
| POST | /notifications/mark-all-read | Mark all notifications as read | JWT |
| PATCH | /notifications/:id/archive | Archive a notification | JWT |
GET /notifications
List notifications for the authenticated user. Returns paginated results ordered by most recent first.
Request
Authentication: JWT Bearer token
| Parameter | Type | Required | Description |
|---|---|---|---|
first | integer | No | Page size; default 20, maximum 50 |
after | string | No | Unchanged data.pageInfo.endCursor from the previous page |
status | string | No | unread, read, or archived |
category | string | No | transactional, product_update, newsletter, marketing, waitlist, cold_outreach, or admin_broadcast |
When data.pageInfo.hasNextPage is true, request the next page with after. Do not send the old limit or offset parameters; they are not supported.
Response
Response Example
{
"data": {
"edges": [],
"pageInfo": {
"hasNextPage": false,
"endCursor": null
}
}
}Response Fields
| Field | Type | Description |
|---|---|---|
data.edges | object[] | Each entry has a node notification and an opaque cursor |
data.pageInfo | object | Pagination state; no total count is returned |
Each data.edges[].node contains the following notification fields:
| Field | Type | Description |
|---|---|---|
id | string | Notification ID |
title | string | Notification title |
body | string | Notification body text |
icon | string | null | Optional icon identifier |
actionUrl | string | null | Optional deep-link URL |
category | string | A category value from the request table above |
priority | string | low, normal, or high |
status | string | unread, read, or archived |
readAt | string | null | ISO 8601 — when the notification was read |
expiresAt | string | null | ISO 8601 — when the notification expires |
createdAt | string | ISO 8601 |
Code Examples
curl "https://api.chainabit.com/api/v1/notifications?first=20" \
-H "Authorization: Bearer $TOKEN"GET /notifications/unread-count
Get the count of unread notifications for the authenticated user. Use this to drive badge indicators in your UI.
Request
Authentication: JWT Bearer token
Response
{
"data": {
"count": 3
}
}Code Examples
curl "https://api.chainabit.com/api/v1/notifications/unread-count" \
-H "Authorization: Bearer $TOKEN"PATCH /notifications/:id/read
Mark an owned notification as read. The readAt timestamp is set to the time of the request; repeating the operation can refresh that timestamp. An ID that does not belong to you returns 404.
Request
Authentication: JWT Bearer token
Response
{
"data": {
"status": "read"
}
}Code Examples
Use the
idfrom a notification in List Notifications's response as$NOTIFICATION_ID.
curl -X PATCH "https://api.chainabit.com/api/v1/notifications/$NOTIFICATION_ID/read" \
-H "Authorization: Bearer $TOKEN"POST /notifications/mark-all-read
Mark all unread notifications as read for the authenticated user in a single operation.
Request
Authentication: JWT Bearer token
Response
{
"data": {
"status": "all_read"
}
}Code Examples
curl -X POST "https://api.chainabit.com/api/v1/notifications/mark-all-read" \
-H "Authorization: Bearer $TOKEN"PATCH /notifications/:id/archive
Archive an owned notification. The record is retained and can still appear in an unfiltered list; use status=unread or status=read when you only want those states. Repeating the archive operation leaves it archived. An ID that does not belong to you returns 404.
Request
Authentication: JWT Bearer token
Response
{
"data": {
"status": "archived"
}
}Code Examples
Reuses
$NOTIFICATION_IDfrom List Notifications's response.
curl -X PATCH "https://api.chainabit.com/api/v1/notifications/$NOTIFICATION_ID/archive" \
-H "Authorization: Bearer $TOKEN"Error Reference
| Status | When it occurs |
|---|---|
| 401 | Missing or expired JWT token |
| 403 | Notification belongs to another user |
| 404 | Notification ID does not exist |
| 422 | Invalid UUID format for :id |