Overview
The Notifications API manages real-time alerts for vulnerability assignments, status changes, comments, and team activity. Notifications appear in the dashboard header and provide quick navigation to relevant resources.Server Actions
getNotifications
Retrieve recent notifications for the authenticated user. Returns:Whether the operation succeeded
Notification data object
markAsRead
Mark a specific notification as read.The ID of the notification to mark as read
Whether the operation succeeded
markAllAsRead
Mark all unread notifications as read for the current user. Returns:Whether the operation succeeded
deleteNotification
Delete a specific notification.The ID of the notification to delete
Whether the operation succeeded
createNotification
Create a new notification (typically used by other server actions).Notification data object
ID of the user to notify
Notification type (e.g., VULNERABILITY_ASSIGNED, STATUS_CHANGED, COMMENT_ADDED)
Notification title
Notification message body
Optional link to related resource
Whether the operation succeeded
The created notification object
Notification Types
VULNERABILITY_ASSIGNED
VULNERABILITY_ASSIGNED
Triggered when a vulnerability is assigned to a user. Includes link to the vulnerability detail page.
STATUS_CHANGED
STATUS_CHANGED
Triggered when a vulnerability status changes (e.g., OPEN → IN_PROGRESS → RESOLVED). Notifies assigned user and vulnerability creator.
COMMENT_ADDED
COMMENT_ADDED
Triggered when someone comments on a vulnerability the user is involved with (created or assigned to).
APPROVAL_REQUIRED
APPROVAL_REQUIRED
Triggered when a non-admin user creates a vulnerability that requires admin approval.
Notification Schema
Each notification object contains:Security
- All notification operations are scoped to the authenticated user
- Users can only access their own notifications
createNotificationis used internally by other server actions- Revalidates dashboard cache after mutations
Integration Example
Related APIs
Vulnerabilities
Assignment triggers notifications
Comments
Comments trigger notifications