User Data Stream (listenKey)
Description
Bots subscribing to private WebSocket channels (orders, balances, positions) authenticate the WebSocket connection with a listenKey issued by REST. The lifecycle mirrors Binance:
POST /fapi/v1/listenKey— issue (or refresh) the user's listenKey- Open the WebSocket and send
{"type":"auth","listenKey":"<key>"} - Subscribe to private channels after
auth_result.success === true - Optionally call
PUT /fapi/v1/listenKeyto extend TTL (the WebSocket connection itself also extends TTL implicitly while online) DELETE /fapi/v1/listenKeyto revoke
One active listenKey per user
Repeated POST returns the same active key and refreshes its TTL — it does not mint a new one. This matches Binance behavior. The TTL is 3600 seconds.
POST /fapi/v1/listenKey
Issue or refresh the caller's listenKey.
HTTP Request
POST /fapi/v1/listenKey (HMAC SHA256)
Weight
1
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| recvWindow | LONG | NO | See Endpoint Security Type |
| timestamp | LONG | YES | Timestamp |
Response Example
{
"listenKey": "a1b2c3d4e5f6g7h8i9j0klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01"
}
The key is a 64-character alphanumeric string ([A-Za-z0-9]).
PUT /fapi/v1/listenKey
Extend the TTL of the caller's active listenKey by another 3600 seconds.
HTTP Request
PUT /fapi/v1/listenKey (HMAC SHA256)