Obtain real-time WebSocket connection URLs, authentication tokens, and session listenKeys to establish bi-directional live chat streams for peer-to-peer (C2C) orders.
/sapi/v1/c2c/chat/retrieveChatCredential
This endpoint provisions dynamic connection credentials for Binance's real-time C2C (P2P) Chat WebSocket service.
It returns the target WebSocket secure URI (wssUrl), temporary authentication credentials (token), and the user session stream key (listenKey).
Automated customer support bots, instant notification daemons, and live trading terminals invoke this endpoint prior to establishing WebSocket sockets to transmit and receive live buyer/seller chat messages with sub-second latency.
Header parameters accepted by the endpoint.
| Header | Type | Required | Description |
|---|---|---|---|
clientType |
STRING | Required |
Client Device Type initiating the request (e.g., WEB, APP, WEB_MOBILE).
|
x-gray-env |
STRING | Optional | Environment flag identifier used for internal gray/stage testing. |
x-trace-id |
STRING | Optional | Custom client trace ID for request lifecycle tracking and debugging. |
x-user-id |
STRING | Optional | Target user identifier for context validation. |
Use the returned wssUrl along with the authorized token / listenKey to open persistent WebSocket streams. Reconnect and refresh credentials periodically or upon receiving connection termination frames.
Example GET request using cURL to fetch real-time chat credentials.
curl -X GET \
'https://api.binance.com/sapi/v1/c2c/chat/retrieveChatCredential' \
-H 'clientType: WEB'
Example response returned on successful credential retrieval.
{
"code": "000000",
"message": "success",
"data": {
"wssUrl": "wss://c2c-chat-ws.binance.com/ws",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"listenKey": "d34db33f987654321abcdef123456789",
"expireTime": 1786957200000
},
"success": true
}
| Field | Type | Description |
|---|---|---|
code |
STRING |
Standard Binance status code ("000000" indicates success).
|
message |
STRING | Response execution feedback or status message. |
data.wssUrl |
STRING | Target WebSocket host endpoint for initiating live real-time chat socket connections. |
data.token |
STRING | Authentication bearer token passed in WebSocket connection handshake. |
data.listenKey |
STRING | Unique session listenKey representing the authenticated user stream. |
data.expireTime |
LONG | Credential validity expiration timestamp in milliseconds. |
success |
BOOLEAN | Indicates overall request execution result. |
Workflow for initializing real-time C2C Chat WebSocket streaming.
wssUrl.
Connect automated conversational agents to process incoming buyer payment questions instantly with zero polling lag.
Listen to live trade chat streams to trigger immediate desktop, Telegram, or SMS alerts when counterparty replies.
Embed high-performance bi-directional order chat widgets directly inside custom web or desktop merchant apps.
This article is part of our complete learning guide covering professional cross-exchange cryptocurrency arbitrage.
Explore the Spot Arbitrage Guide →This article is part of our complete learning guide covering Binance P2P automation, merchant tools, and automated trading.
Explore the Binance P2P Automation Guide →