Customer Service
CS API overview
Day-to-day integration is widget + site appKey; admin APIs follow console roles.
Model: domain → sites (appKey) → members / sessions / tickets / tags / quick replies / escalation.
These are logical gateway paths. Use the current brand's secure transport protocol; the Widget handles encryption and tokens. Visitor endpoints require the visitor JWT returned by the handshake, except for entry-token issuance and the handshake itself. Management endpoints use a signed-in user JWT and domain roles.
POST /api/v1/cs/entry-token— your backend issues a one-time entry token using site credentials; never exposeappSecretin the browserPOST /api/v1/cs/handshake— site handshake → visitor JWTPOST /api/v1/cs/identify— update visitor profilePOST /api/v1/cs/conversations— send message (auto-creates session)GET /api/v1/cs/conversations/current— current sessionGET /api/v1/cs/conversations/:id/messages— list conversation messagesPOST /api/v1/cs/conversations/:id/end— explicitly end the current visitor conversationPOST /api/v1/cs/conversations/:id/reassign— confirm agent reassignmentGET /api/v1/cs/conversations/:id/satisfaction— get rating statusPOST /api/v1/cs/conversations/:id/satisfaction— submit a satisfaction ratingGET /api/v1/cs/vouchers,GET /api/v1/cs/vouchers/:id— visitor vouchers and detailsGET /api/v1/cs/voucher-gifts/:id,POST /api/v1/cs/voucher-gifts/:id/claim— view and claim a voucher giftPOST /api/v1/ws/ticket— one-time WebSocket ticket
Widget public methods
init() initializes the widget; open(), close(), and toggle() control the panel; identify() updates profiles; setLocale() changes language; sendMessage() and sendOrderCard() send text and order cards; on() and off() manage subscriptions; getDiagnostics() returns diagnostics; shutdown() destroys the instance. Use endConversation() and startNewConversation() to end and restart conversations.
See Widget setup for initialization and lifecycle examples, and business data for profiles and orders. Secure entry does not accept identity updates through identify(); have your backend issue a new entry token.
Capability handshake
{ "available": true, "capabilities": { "visitorEndConversation": true } }
Expose visitor end when the capability is strictly true. A successful end returns { closed: true, alreadyEnded, conversation, satisfaction }. The conversation must have customerService.status="closed" and a monotonic stateVersion.
alreadyEnded=true is an idempotent retry of the same ended conversation. For HTTP 409, branch on errorCode, resync the current conversation, then decide whether to retry.
/end merely because the host page is hidden, refreshed, or the panel is collapsed. Call it only after the visitor explicitly confirms the end.Prefer the Widget for websites. Contracts: /api-spec and console responses.
Try the API demo or continue to team setup.
