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:
| Value | Description |
|---|---|
ALL_MEMBERS | All active org members |
SPECIFIC_USER | Single user (requires targetUserId) |
ROLE | All users with a specific role |
List Notifications
GET /api/notifications
Authorization: Bearer <token>
Returns the authenticated user's notification inbox.
Query Parameters:
| Param | Type | Description |
|---|---|---|
read | boolean | Filter by read status |
page | int | Page number |
size | int | Page 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:
| Param | Type | Description |
|---|---|---|
organizationId | UUID | Filter by organisation |
status | string | SENT, FAILED, BOUNCED |
from | date | Date range start |
to | date | Date range end |
Email logs are retained for 90 days.
Get Email Log
GET /api/email-logs/{logId}
Authorization: Bearer <adminToken>