In-App Notification Repository
API Contract
REST
/api/v1/notifications
8 endpoints
GET
/api/v1/notifications/api/v1/notifications
List all in-app notifications for the authenticated user
Public
Response Example
{
"data": [
{
"notification_id": "notif_881",
"user_id": "user_042",
"type": "assignment_reminder",
"title": "Follow-up reminder: Lars Eriksson",
"body": "You haven't contacted Lars Eriksson in 16 days. Please reach out.",
"read": false,
"dismissed": false,
"created_at": "2026-03-26T08:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 3
}
}
GET
/api/v1/notifications/api/v1/notifications/:id
Get a single notification by ID
Public
Response Example
{
"notification_id": "notif_881",
"user_id": "user_042",
"type": "assignment_reminder",
"title": "Follow-up reminder: Lars Eriksson",
"body": "You haven't contacted Lars Eriksson in 16 days. Please reach out.",
"data": {
"assignment_id": "asgn_001",
"mentee_name": "Lars Eriksson"
},
"read": false,
"dismissed": false,
"created_at": "2026-03-26T08:00:00Z"
}
POST
/api/v1/notifications/api/v1/notifications
Create a new in-app notification for a user
Public
Request Example
{
"user_id": "user_042",
"type": "assignment_reminder",
"title": "Follow-up reminder: Lars Eriksson",
"body": "You haven't contacted Lars Eriksson in 16 days.",
"data": {
"assignment_id": "asgn_001"
}
}
Response Example
{
"notification_id": "notif_882",
"user_id": "user_042",
"type": "assignment_reminder",
"read": false,
"dismissed": false,
"created_at": "2026-03-26T10:15:00Z"
}
PUT
/api/v1/notifications/api/v1/notifications/:id
Update a notification (mark read, update content)
Public
Request Example
{
"read": true
}
Response Example
{
"notification_id": "notif_881",
"read": true,
"updated_at": "2026-03-26T10:16:00Z"
}
DELETE
/api/v1/notifications/api/v1/notifications/:id
Delete a notification
Public
Response Example
{
"deleted": true,
"notification_id": "notif_881"
}
PUT
/api/v1/notifications/api/v1/notifications/:id/read
Mark a notification as read
Public
Response Example
{
"notification_id": "notif_881",
"read": true,
"read_at": "2026-03-26T10:17:00Z"
}
PUT
/api/v1/notifications/api/v1/notifications/:id/dismiss
Dismiss a notification
Public
Response Example
{
"notification_id": "notif_881",
"dismissed": true,
"dismissed_at": "2026-03-26T10:18:00Z"
}
PUT
/api/v1/notifications/api/v1/notifications/read-all
Mark all notifications as read for the authenticated user
Public
Response Example
{
"updated_count": 3
}