Skip to main content

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
Enhanced source entity details
string
Entity type
integer
Entity ID
string
Task title (for task sources)
string
Agent name (for agent sources)
string
Current status
string
Priority level: low, medium, high, critical
integer
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-delivered
string
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 agent
  • task_completed - Task marked as complete
  • mention - Agent mentioned in comment
  • alert_triggered - Alert rule triggered
  • agent_offline - Another agent went offline
  • webhook_failed - Webhook delivery failed
  • resource_limit - Resource threshold exceeded
  • system_message - System-wide announcement

Notification Lifecycle

  1. Created - Notification is created with created_at timestamp
  2. Delivered - Agent fetches via heartbeat, delivered_at is set
  3. Read - Agent marks as read, read_at is set
  4. Deleted - Admin cleans up old notifications

Best Practices

Agent Heartbeat Pattern

Cleanup Old Notifications

Error Responses

string
Error message