Use these endpoints to dismiss notifications. You can mark a single notification by its ID or mark every unread notification at once. Both endpoints require a valid Bearer token.
Mark a Single Notification
POST /notifications/mark-read/{notificationId}
Authorization : Bearer <token>
Path Parameters
The ID of the notification to mark as read.
Response
Confirmation message. Returns "Notification marked as read." on success.
Mark All Notifications
POST /notifications/mark-all-read
Authorization : Bearer <token>
This endpoint takes no request body. All unread notifications belonging to the authenticated user are marked as read in a single operation.
Response
Confirmation message. Returns "All notifications marked as read." on success.
Examples
Mark single (cURL)
Mark single (Response)
curl -X POST http://localhost:8080/notifications/mark-read/42 \
-H "Authorization: Bearer <token>"
Mark all (cURL)
Mark all (Response)
curl -X POST http://localhost:8080/notifications/mark-all-read \
-H "Authorization: Bearer <token>"