Skip to main content

Notifications API

Base path: /api/notifications

Push notifications are delivered via Firebase Cloud Messaging (FCM). All endpoints require Authorization: Bearer <token>.


Notifications

Send Notification

POST /api/notifications
Authorization: Bearer <adminToken>
{
"organizationId": "org-uuid",
"title": "Event Reminder",
"body": "Your event starts in 1 hour.",
"targetType": "ALL_MEMBERS",
"targetUserId": null,
"data": {
"type": "EVENT",
"eventId": "event-uuid"
}
}

Target Types:

ValueDescription
ALL_MEMBERSAll active org members
SPECIFIC_USERSingle user (requires targetUserId)
ROLEAll users with a specific role

List Notifications

GET /api/notifications
Authorization: Bearer <token>

Returns the authenticated user's notification inbox.

Query Parameters:

ParamTypeDescription
readbooleanFilter by read status
pageintPage number
sizeintPage size

Get Notification

GET /api/notifications/{notificationId}
Authorization: Bearer <token>

Update Notification (Mark Read)

PUT /api/notifications/{notificationId}
Authorization: Bearer <token>
{ "read": true }

Delete Notification

DELETE /api/notifications/{notificationId}
Authorization: Bearer <token>

Device Registration

To receive push notifications, the client app must register its FCM device token.

Register Device Token

POST /api/notifications/devices
Authorization: Bearer <token>
{
"fcmToken": "fcm-device-token-from-firebase-sdk",
"platform": "ANDROID",
"deviceName": "Pixel 8"
}

Platforms: ANDROID, IOS, WEB


Unregister Device Token

DELETE /api/notifications/devices/{tokenId}
Authorization: Bearer <token>

Call this on logout to stop receiving notifications on the device.


Email Logs (Admin)

List Email Logs

GET /api/email-logs
Authorization: Bearer <adminToken>

Query Parameters:

ParamTypeDescription
organizationIdUUIDFilter by organisation
statusstringSENT, FAILED, BOUNCED
fromdateDate range start
todateDate range end

Email logs are retained for 90 days.


Get Email Log

GET /api/email-logs/{logId}
Authorization: Bearer <adminToken>