Browse topics Chat for signed-in users
Connect your app
Chat for signed-in users
Connect your app’s login to customer conversations.
Enable chat for the project first. Your backend then exchanges its participate credential and verified user ID for short-lived customer access.
POST /api/v1/chat/projects/your-project/customer-sessions
Authorization: Bearer <project-secret>
Content-Type: application/json
{
"external_user_id": "your-verified-user-id",
"client_type": "browser",
"origin": "https://www.example.com"
}
Make this exchange on your server, without an Origin header. The JSON origin must match an enabled website. For a native customer app, use "client_type":"native" and omit the JSON origin.
- Return only the resulting
cc_token and expiry to the client. Subsequent calls useX-Chat-Token; browser fetches usecredentials: 'omit'. GET /api/v1/chat/conversationslists that customer's history. To start one, POST there withclient_conversation_id, a UUID retained across retries.- POST to
/api/v1/chat/conversations/{id}/messageswith a UUIDclient_message_idandbody. Retry an unacknowledged send with the same ID and body; conflicting reuse returns 409. - Read messages with
?after=0&limit=25; pass the returnednext_sequenceas the nextafter. POST{"sequence":…}to the conversation's/readpath after viewing them.
Tokens last one hour. Renew through your authenticated backend; history and message retry identity survive renewal. DELETE /api/v1/chat/session revokes the current customer token. Your app's logout must explicitly end its chat access.
Live updates
POST the conversation ID to /api/v1/chat/tickets, then connect to /api/v1/chat/ws. Send the one-use ticket in the first frame, never in the URL. Tickets last 60 seconds. The OpenAPI document's x-websockets section describes frames and reconnect cursors; HTTP history can also catch up after disconnection.
The supplied widget below uses anonymous visitor sessions. It does not automatically use your app's login or merge an anonymous chat into an account. Build your own customer UI for authenticated history; the repository's docs/chat.md includes the complete flow.
These docs describe the current source. Check your server’s /api/v1/openapi.json for the version you run.