Notifications API
API for managing notifications and notification preferences
Endpoints
List Notifications
Get a list of notifications
http
GET /api/rpc/user/smartNotifications/listParameters
| Name | Type | Description |
|---|---|---|
| page | number | Page (default: 1) |
| limit | number | Items per page (default: 20) |
| unread | boolean | Show only unread |
Mark as Read
Mark notifications as read
http
POST /api/rpc/user/smartNotifications/markReadBody
json
{
"notificationIds": ["notif_1", "notif_2"]
}Notification Preferences
View and set notification preferences
http
GET /api/rpc/user/notificationPreferences
PATCH /api/rpc/user/notificationPreferencesBody (PATCH)
json
{
"email": {
"bookingConfirmed": true,
"bookingCancelled": true,
"reminder24h": true,
"reminder1h": true,
"reviewRequest": true
},
"sms": {
"bookingConfirmed": true,
"reminder1h": true
},
"push": {
"newBooking": true,
"newMessage": true
}
}Provider Notifications
Notifications for providers
http
GET /api/rpc/provider/notifications/list
POST /api/rpc/provider/notifications/sendExample Code
typescript
// Get notifications
const notifications = await fetch(
'/api/rpc/user/smartNotifications/list?unread=true',
{ headers: { 'Authorization': 'Bearer YOUR_API_KEY' } },
);
// Mark as read
await fetch('/api/rpc/user/smartNotifications/markRead', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ notificationIds: ['notif_1'] }),
});
// Set notification preferences
await fetch('/api/rpc/user/notificationPreferences', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: { bookingConfirmed: true },
sms: { reminder1h: true },
}),
});