Skip to main content

WebSocket Events

Real-time events over Socket.IO on the /v1 namespace.

Connection Configuration​

PropertyValue
TransportWebSocket (Socket.IO protocol)
Namespace/v1
URL{baseUrl}/v1
AuthSame Firebase JWT headers as REST
Query paramsworkspaceId=<id>
Auto-reconnectEnabled

Client-to-Server Events​

workspace.subscribe​

Subscribe to real-time events for one or more workspaces.

{ "workspace_ids": ["string"] }

workspace.unsubscribe​

Unsubscribe from workspace events.

{ "workspace_ids": ["string"] }

message.send​

Send a message via WebSocket (alternative to the REST POST .../messages endpoint).

{
"workspace_id": "string",
"conversation_id": "string",
"local_id": "string",
"content": { "type": "text", "text": "string" },
"mentions": [
{ "agent_id": "string", "agent_name": "string", "offset": 0, "length": 0 }
],
"attachments": []
}

The server responds with message.send.ack on success or message.send.error on failure.

Server-to-Client Events​

message.new​

New message in any conversation within the connected workspace.

{
"message": {
"id": "string",
"conversation_id": "string",
"role": "user | agent | system",
"content": "MessageContent",
"status": "pending | sent | delivered | read | failed",
"created_at": "ISO8601",
"updated_at": "ISO8601",
"local_id": "string | null",
"agent": "AgentData | null",
"attachments": ["AttachmentData"],
"mentions": ["MentionData"]
}
}

message.updated​

Message modified (e.g., action card resolved, status changed). Same payload shape as message.new.

message.chunk​

Streamed text token during agent response generation. Emitted for each partial text delta.

{
"message_id": "string",
"conversation_id": "string",
"agent_id": "string",
"chunk": "string"
}

message.done​

Signals that streaming is complete for a message.

{
"message_id": "string",
"conversation_id": "string",
"agent_id": "string",
"status": "delivered | failed"
}

message.status​

Delivery status transition for a message (e.g., pending to delivered, delivered to read).

{
"message_id": "string",
"conversation_id": "string",
"local_id": "string | null",
"status": "sent | delivered | read"
}

agent.status​

Agent status changed. conversation_id is set when the status is tied to a specific conversation (e.g., thinking, writing). Omitted for workspace-wide statuses like online.

{
"agent_id": "string",
"status": "online | reading | thinking | writing | pending | error | offline",
"conversation_id": "string | omitted"
}

agent.tool​

Agent tool call activity during streaming.

{
"agent_id": "string",
"conversation_id": "string",
"tool": "string",
"status": "running | done",
"query": "string | omitted",
"args": "object | omitted",
"created_at": "ISO8601 | omitted"
}

agent.delegation​

Agent-to-agent delegation activity. Emitted when one agent hands off work to another.

{
"from": {
"id": "string",
"name": "string",
"role": "string",
"slug": "string",
"avatar": "string",
"status": "string"
},
"to": {
"id": "string",
"name": "string",
"role": "string",
"slug": "string",
"avatar": "string",
"status": "string"
},
"conversation_id": "string",
"status": "running | completed | failed",
"message_preview": "string | omitted",
"message_id": "string | omitted",
"created_at": "ISO8601 | omitted"
}

artifact.updated​

Artifact creation, update, or review activity.

{
"artifact_id": "string",
"conversation_id": "string | omitted",
"title": "string",
"version": 0,
"action": "created | updated | reviewed",
"agent_id": "string",
"agent_slug": "string"
}

usage.update​

Per-LLM-call token usage update. Emitted inline during streaming so the mobile app can show real-time token counters.

{
"agent_id": "string",
"conversation_id": "string",
"message_id": "string",
"model": "string",
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"call_sequence": 0
}

Workflow Events​

Workflow execution progress events. All share the same payload shape.

Event names: workflow.started, workflow.step.started, workflow.step.completed, workflow.step.approval_required, workflow.completed, workflow.failed

{
"workflow_id": "string",
"execution_id": "string",
"workflow_name": "string",
"conversation_id": "string | omitted",
"status": "string",
"step_index": 0,
"step_name": "string | omitted",
"agent_slug": "string | omitted",
"error": "string | omitted"
}

message.send.ack​

Acknowledgment after a message.send is persisted.

{
"local_id": "string",
"message_id": "string",
"conversation_id": "string",
"status": "sent"
}

message.send.error​

Error response when a message.send fails.

{
"local_id": "string",
"conversation_id": "string",
"error": "string"
}

workspace.subscribed​

Acknowledgment after a workspace.subscribe succeeds.

{ "workspace_ids": ["string"] }

Event Summary​

EventDirectionDescription
workspace.subscribeClient to ServerSubscribe to workspace events
workspace.unsubscribeClient to ServerUnsubscribe from workspace events
message.sendClient to ServerSend message via WebSocket
message.newServer to ClientNew message created
message.updatedServer to ClientMessage modified
message.chunkServer to ClientStreamed text token
message.doneServer to ClientStream complete
message.statusServer to ClientDelivery status change
message.send.ackServer to ClientMessage send acknowledged
message.send.errorServer to ClientMessage send failed
agent.statusServer to ClientAgent status change
agent.toolServer to ClientTool call activity
agent.delegationServer to ClientAgent-to-agent delegation
artifact.updatedServer to ClientArtifact created/updated
usage.updateServer to ClientToken usage update
workspace.subscribedServer to ClientSubscription confirmed
workflow.*Server to ClientWorkflow progress events