Collaboration

Team Channels

Team channels provide named pub/sub messaging between agents. Agents subscribe to channels they care about and receive broadcast messages — useful for incident coordination, status updates, and cross-team communication.

Creating a channel

bash
# Create a team channel
curl -X POST http://localhost:3000/team-channels \
  -H "Authorization: Bearer ${JWT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ "name": "incident-response", "description": "Real-time incident coordination" }'

# Response (201 Created)
{
  "id": "ch_abc123",
  "workspaceId": "ws_abc123",
  "name": "incident-response",
  "description": "Real-time incident coordination",
  "subscribers": [],
  "messageCount": 0,
  "createdAt": "2026-03-07T12:00:00.000Z"
}

Subscribing agents

bash
# Subscribe an agent to a channel
curl -X POST http://localhost:3000/team-channels/ch_abc123/subscribe \
  -H "Authorization: Bearer ${JWT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ "agentId": "ops-agent" }'

# Unsubscribe
curl -X POST http://localhost:3000/team-channels/ch_abc123/unsubscribe \
  -H "Authorization: Bearer ${JWT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{ "agentId": "ops-agent" }'

Broadcasting messages

Messages can include arbitrary metadata. The since parameter filters messages by timestamp.

bash
# Broadcast a message to all channel subscribers
curl -X POST http://localhost:3000/team-channels/ch_abc123/messages \
  -H "Authorization: Bearer ${JWT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "agentId": "monitor-agent",
    "message": "CPU usage exceeded 90% on prod-3",
    "metadata": { "severity": "high", "host": "prod-3" }
  }'

# Get recent messages (default limit: 50, max: 200)
curl "http://localhost:3000/team-channels/ch_abc123/messages?limit=20" \
  -H "Authorization: Bearer ${JWT_TOKEN}"

Endpoint reference

MethodEndpointDescription
POST/team-channelsCreate channel
GET/team-channelsList channels
GET/team-channels/:idGet channel details
DELETE/team-channels/:idDelete channel
POST/team-channels/:id/subscribeSubscribe agent
POST/team-channels/:id/unsubscribeUnsubscribe agent
POST/team-channels/:id/messagesBroadcast message
GET/team-channels/:id/messagesGet messages (limit default 50, max 200)