Skip to content
Talk to our solutions team

API

All routes and connections require a JWT and the four CPET headers (X-Customer, X-Product, X-Env, X-Tenant).

wss://<host>/chat/join

The JWT may be supplied via the Authorization header, a jwt cookie, or a ?token=<jwt> query parameter (the query form is what makes browser WebSocket auth possible). The authenticated user id is the identity; the connection is implicitly subscribed to every chat the user belongs to.

{ "action": "<action>", "body": { } }
actionbodyEffect
listchats{}List the caller’s chats
getmessages{chatid, threadid, since}Fetch messages since a timestamp (empty = all); replies to the calling socket only
publishmessage{chatid, threadid, message, blocks:{data:[…]}, clientidentifier}Post a message; fanned out to all members
createchat{name, chattype, visibility, members:{data:[…]}}Create a chat; pushed to all members
lastseentill{chatid, threadid, seentill}Advance the caller’s read marker
listfilesinchat{chatid, meta, media, depth, subfolder}List files shared in a chat
userevent.action{chatid, threadid, …}Broadcast a transient event (typing, presence) to chat members

Success:

{ "action": "<action>", "status": "success", "response": { "data": { } } }

Error:

{ "status": "error", "error": { "code": "rtc-…", "message": "" } }

Server-pushed (no client request):

FramePayload
publishmessageresponse.data.chatid, response.data.rtmchatthreadmessage, and the echoed clientidentifier (for optimistic-UI dedupe)
createchatThe new chat, pushed to every member
lastseentillRead-marker updates
notification.receivedresponse.data.inappnotification — an in-app notification
userevent.actionresponse.data{userid, chatid, threadid, …}

getmessages, listchats, and listfilesinchat reply only to the requesting socket; publishmessage, createchat, lastseentill, and notifications fan out to all recipients’ sockets.

A message’s blocks.data[] carries structured content, each {type, id, detail}. Types include mentions, reactions, files, code, text, and more. A mention or reaction block additionally generates an in-app notification to the referenced users.

MethodPathPurpose
POST/chat/singleCreate a 1:1 chat — {name, visibility, members:{data:[{id,type}]}}
POST/chat/groupCreate a group chat
GET/chat/info/:chatidChat + its default thread
GET/chat/fetch/:chatid/thread/:threadid/since/:timestampPage of messages (newest first)
POST/chat/message/:chatidPost a message (REST equivalent of publishmessage)
PATCH/chat/listThe caller’s chats
GET/chat/joinWebSocket upgrade
MethodPathPurpose
POST / PUT/chat/botRegister / update a bot — {name, displayname, config:{…}, avatar, state}
GET/chat/bot/:botidFetch a bot
PATCH/chat/botlistList bots

A bot’s config holds the callback URLs the service invokes when a conversation starts, a message is posted, or a conversation closes.

Files shared in a chat are stored through the Content block:

MethodPathPurpose
POST/chat/id/:chatid/file?filename=&description=&media=Upload (raw body)
PUT/chat/id/:chatid/file/:fileidReplace
GET/chat/id/:chatid/file/:fileidDownload (streamed)
DELETE/chat/id/:chatid/file/:fileidDelete
PATCH/chat/id/:chatid/fileList files
MethodPathPurpose
POST/notifications/sendUsed by the Notifications block to push in-app notifications to live connections — {status, notifications:[…]}

GET /health, GET /ready — unauthenticated.