Skip to main content

ChannelMessage envelope

Snapshot: 0.9.17-patch1 · selected operations. This is a stored schema reference, not a fresh export or confirmation of behavior in another release. Scope and availability.

WebSocket message envelope exchanged on /ws/session. Include the payload object matching the message type.

This snapshot leaves payload objects open with additionalProperties: true. It does not define every payload field or establish which runtime actions a deployment supports.

Required means required within its containing object. Exact schema below retains all constraints and alternatives.

FieldTypeRequiredDescriptionConstraints
typestringYesNot described in snapshot.enum: ["chat","browser_action","action","action_result","audio","status","control","reconnect","ping","pong","error"]
sessionIdstringYesNot described in snapshot.—
messageIdstringYesNot described in snapshot.format: "uuid"
streamIdstringNoRedis stream id included on replayed runtime-to-browser messages.—
timestampnumberYesUnix timestamp in milliseconds.—
directionstringYesNot described in snapshot.enum: ["to_browser","to_ari"]
chatobjectNoPresent when type is chat.additionalProperties: true
browserActionobjectNoPresent when type is browser_action.additionalProperties: true
actionobjectNoPresent when type is action.additionalProperties: true
actionResultobjectNoPresent when type is action_result.additionalProperties: true
audioobjectNoPresent when type is audio.additionalProperties: true
statusobjectNoPresent when type is status.additionalProperties: true
controlobjectNoPresent when type is control; supports enable_text_chat and disable_text_chat commands.additionalProperties: true
reconnectobjectNoPresent when type is reconnect.additionalProperties: true
errorobjectNoPresent when type is error.additionalProperties: true

Exact schema​

{
"type": "object",
"description": "WebSocket message envelope exchanged on /ws/session. Include the payload object matching the message type.",
"required": [
"type",
"sessionId",
"messageId",
"timestamp",
"direction"
],
"properties": {
"type": {
"type": "string",
"enum": [
"chat",
"browser_action",
"action",
"action_result",
"audio",
"status",
"control",
"reconnect",
"ping",
"pong",
"error"
]
},
"sessionId": {
"type": "string"
},
"messageId": {
"type": "string",
"format": "uuid"
},
"streamId": {
"type": "string",
"description": "Redis stream id included on replayed runtime-to-browser messages."
},
"timestamp": {
"type": "number",
"description": "Unix timestamp in milliseconds."
},
"direction": {
"type": "string",
"enum": [
"to_browser",
"to_ari"
]
},
"chat": {
"type": "object",
"description": "Present when type is chat.",
"additionalProperties": true
},
"browserAction": {
"type": "object",
"description": "Present when type is browser_action.",
"additionalProperties": true
},
"action": {
"type": "object",
"description": "Present when type is action.",
"additionalProperties": true
},
"actionResult": {
"type": "object",
"description": "Present when type is action_result.",
"additionalProperties": true
},
"audio": {
"type": "object",
"description": "Present when type is audio.",
"additionalProperties": true
},
"status": {
"type": "object",
"description": "Present when type is status.",
"additionalProperties": true
},
"control": {
"type": "object",
"description": "Present when type is control; supports enable_text_chat and disable_text_chat commands.",
"additionalProperties": true
},
"reconnect": {
"type": "object",
"description": "Present when type is reconnect.",
"additionalProperties": true
},
"error": {
"type": "object",
"description": "Present when type is error.",
"additionalProperties": true
}
}
}

For token acquisition and the connection URL, see Request a session token.