Operators / Live Chat
Endpoints that power the live-chat operator panel: take over a conversation from the AI, message visitors, manage status, transfer and block. All require authentication, except the SSE stream which authenticates via a token query parameter.
Messaging & lifecycle
/api/v1/operator/message AuthSend an operator message to a conversation.
{ "conversation_id": 50, "content": "Hi, this is Alex.", "image_url": "" }{ "success": true }/api/v1/operator/accept/{id} AuthAccept (take over) a conversation — switches mode to operator.
{ "success": true }/api/v1/operator/close/{id} AuthClose a conversation.
{ "success": true }/api/v1/operator/transfer/{id} AuthTransfer a conversation to another operator.
{ "operator_id": 7 }{ "success": true }/api/v1/operator/typing AuthSend a typing indicator.
{ "conversation_id": 50 }{ "success": true }/api/v1/operator/note AuthAdd a private note to a conversation.
{ "conversation_id": 50, "content": "VIP customer" }{ "success": true }/api/v1/operator/proactive-message AuthSend a proactive message to an online visitor.
{ "site_id": 1, "session_id": "sess_…", "content": "Need help?" }{ "success": true }/api/v1/operator/upload-image AuthUpload an image to send to a visitor (multipart).
{ "success": true, "url": "https://cdn…" }Status & realtime
/api/v1/operator/stream PublicSSE stream of live events. Authenticated via ?token=JWT (EventSource cannot send headers).
(text/event-stream)
/api/v1/operator/heartbeat AuthKeep the operator marked online (send every ~30s).
{ "site_ids": [1, 2] }{ "success": true }/api/v1/operator/status AuthGet the operator’s online status.
{ "success": true, "online": true }/api/v1/operator/set-status AuthSet online/offline for a site.
{ "site_id": 1, "online": true }{ "success": true }/api/v1/operator/fcm-token AuthRegister a push (FCM) token.
{ "token": "…" }{ "success": true }/api/v1/operator/fcm-token AuthRemove a push token.
{ "success": true }Chats & visitors
/api/v1/operator/active-chats AuthActive chats for the current site.
{ "success": true, "chats": [ … ] }/api/v1/operator/all-active-chats AuthActive chats across all sites.
{ "success": true, "chats": [ … ], "current_user_id": 3 }/api/v1/operator/all-chat-counts AuthPending/active counts.
{ "success": true, "pending": 2, "active": 5 }/api/v1/operator/online-visitors AuthOnline visitors on a site.
{ "success": true, "visitors": [ … ] }/api/v1/operator/all-online-visitors AuthOnline visitors across all sites.
{ "success": true, "visitors": [ … ] }/api/v1/operator/operators AuthList operators (for transfers).
{ "success": true, "operators": [ … ] }/api/v1/operator/blocked AuthList blocked visitors.
{ "success": true, "visitors": [ … ] }/api/v1/operator/conversation/{id} AuthGet conversation details.
{ "success": true, "conversation": { … } }/api/v1/operator/conversation/{id}/visitor AuthUpdate a visitor’s custom data (name/email/phone/info).
{ "name": "Jane", "email": "[email protected]" }{ "success": true }/api/v1/operator/conversation/{id}/block AuthBlock/unblock a visitor. block_type: both | ai | operator.
{ "blocked": true, "block_type": "both" }{ "success": true }Translation
/api/v1/operator/translation/toggle AuthEnable/disable live translation for a conversation.
{ "conversation_id": 50, "enabled": true }{ "success": true }/api/v1/operator/translation/set-lang AuthSet the visitor’s language for translation.
{ "conversation_id": 50, "lang": "de" }{ "success": true }