Skip to main content

Broadcast

POST /agent/broadcast

Send a message to all agents connected to a volume via WebSocket. Useful for inter-agent communication and notifications.

Request​

Body:

FieldTypeRequiredDescription
volume_idstring (UUID)YesTarget volume
messagestringYesMessage content (1–10,000 chars)
event_typestringNoCustom event type (default: agent_broadcast)

Response​

{
"status": "broadcast_sent"
}

WebSocket Event​

Connected agents receive the broadcast as a WebSocket message:

{
"type": "agent_broadcast",
"volume_id": "...",
"from_agent": "my-agent",
"agent_id": "a1b2c3d4-...",
"message": "New data available in the research collection",
"timestamp": "2024-01-15T10:30:00Z"
}

Example​

curl -X POST https://api.sharedmemory.ai/agent/broadcast \
-H "Authorization: Bearer sm_agent_..." \
-H "Content-Type: application/json" \
-d '{
"volume_id": "a1b2c3d4-...",
"message": "Finished processing Q4 reports",
"event_type": "processing_complete"
}'