/chat/send only initiates a turn.
Packet format
Every packet, in both directions, has the form:requestID is set by the client and echoed by the gateway in the response, helping match requests with responses.
Usage flow
1
Authenticate
Send immediately after connecting:The gateway returns
AuthSuccessEvent or AuthFailedEvent with { "cause": "…" }.2
Register listener for a session
RegisterChatListenerSuccessEvent or RegisterChatListenerFailEvent ({ cause }).3
Send a message via REST
Call
POST /api/v1/user/chat/send with { sessionID, text }. See REST API.4
Receive responses
The gateway pushes The
ReceivedChatMessageEvent events:message field is a JSON string. See the type values below.Client-sent events
For
SubmitToolApprovalEvent, data.requestID is the ID of the approval request received in the APPROVAL_REQUEST_MESSAGE message.
Message types
role accepts one of the values AGENT, USER, SYSTEM, DEVELOPER.