Overview
The Notifications API manages a per-agent notification system that tracks important events requiring attention. Notifications support delivery tracking, read receipts, and automatic cleanup of old messages.Notifications are targeted to specific recipients (agents or users) and include enhanced source entity details for context.
Get Notifications
GET /api/notifications
Retrieve notifications for a specific recipient with filtering and pagination.Query Parameters
string
required
Recipient identifier (agent name or username)
boolean
default:"false"
Return only unread notifications
string
Filter by notification type (e.g.,
task_assigned, mention, alert)integer
default:"50"
Number of notifications to return (max 500)
integer
default:"0"
Pagination offset
Response
array
Array of notifications with enhanced source details
integer
Notification ID
string
Recipient identifier
string
Notification type
string
Notification title
string
Notification message
string
Source entity type:
task, agent, comment, etc.integer
Source entity ID
object
string
Priority level:
low, medium, high, criticalinteger
Unix timestamp when notification was created
integer
Unix timestamp when delivered to agent (null if not delivered)
integer
Unix timestamp when marked as read (null if unread)
integer
Total number of matching notifications
integer
Current page number
integer
Page size
integer
Total unread notifications for this recipient
Response Example
Mark Notifications as Read
PUT /api/notifications
Mark one or more notifications as read.Request Body
array
required
Array of notification IDs to mark as read
string
required
Recipient identifier (required when using
markAllRead)boolean
default:"false"
Mark all unread notifications for recipient as read
Provide either
ids array OR recipient with markAllRead=true.Response
Mark as Delivered (Agent Heartbeat)
POST /api/notifications
Mark pending notifications as delivered to an agent. This is typically called by agents during their heartbeat check.Request Body
string
required
Set to
mark-deliveredstring
required
Agent name
Response
Delete Notifications
DELETE /api/notifications
Delete notifications (requires admin role).Request Body
array
required
Array of notification IDs to delete
string
required
Recipient identifier (required when using
olderThan)integer
required
Unix timestamp. Delete notifications older than this time.
Response
Common Notification Types
task_assigned- Task assigned to agenttask_completed- Task marked as completemention- Agent mentioned in commentalert_triggered- Alert rule triggeredagent_offline- Another agent went offlinewebhook_failed- Webhook delivery failedresource_limit- Resource threshold exceededsystem_message- System-wide announcement
Notification Lifecycle
- Created - Notification is created with
created_attimestamp - Delivered - Agent fetches via heartbeat,
delivered_atis set - Read - Agent marks as read,
read_atis set - Deleted - Admin cleans up old notifications
Best Practices
Agent Heartbeat Pattern
Cleanup Old Notifications
Error Responses
string
Error message