Notifications
Manage user notifications for approvals, system updates, and alerts.
Get Notifications
GET
/api/notificationsGet paginated notifications for the current user.
| Query Param | Type | Required | Description |
|---|---|---|---|
page | number | Optional | Page number (default: 1) |
limit | number | Optional | Items per page (default: 20) |
{
"notifications": [
{
"id": "...",
"type": "approval",
"title": "New Join Request",
"message": "John Doe requested to join the company",
"body": "...",
"link": "/approvals",
"readAt": null,
"createdAt": "2024-01-15T10:30:00Z"
}
],
"total": 50,
"unreadCount": 5
}
Mark All Read
PATCH
/api/notificationsMark all notifications as read.
{
"success": true
}
Delete All Read
DELETE
/api/notificationsDelete all read notifications.
{
"success": true
}
Mark Notification Read
PATCH
/api/notifications/[id]Mark a specific notification as read.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Required | Notification ID (path param) |
{
"notification": {
"id": "...",
"readAt": "2024-01-15T11:00:00Z"
}
}
Delete Notification
DELETE
/api/notifications/[id]Delete a specific notification.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Required | Notification ID (path param) |
{
"success": true
}
Notification Types
| Type | Description |
|---|---|
info | General information |
approval | Approval request notifications |
project | Project-related updates |
deadline | Deadline reminders |
system | System notifications |