Private User Channel

View as Markdown

Create a listenKey first:

1POST /v1/private/user/listen-key

Response example:

1{
2 "code": 0,
3 "message": "success",
4 "data": {
5 "listenKey": "f57cb61ef604ce76be09e753a5dbdd8c",
6 "expireAt": 1777539918867
7 },
8 "requestId": "req-listen-key"
9}

listenKey is valid for 60 minutes by default. Renewal every 30 minutes is recommended.

Renew

1PUT /v1/private/user/listen-key
2Content-Type: application/json
1{ "listenKey": "f57cb61ef604ce76be09e753a5dbdd8c" }

Close

1DELETE /v1/private/user/listen-key
2Content-Type: application/json
1{ "listenKey": "f57cb61ef604ce76be09e753a5dbdd8c" }

Connect to private WebSocket

wss://6mm.com/ws?listenKey=YOUR_LISTEN_KEY

Compatible JWT connection method:

wss://6mm.com/ws?token=YOUR_ACCESS_TOKEN

After authentication succeeds, the server automatically subscribes the connection to the current user’s private channel. No manual subscription is required.

Successful authentication acknowledgement:

1{ "event": "auth", "success": true, "data": "1188041528" }

Common private events

EventDescription
ORDER_TRADE_UPDATEOrder status changes, including new order, amendment, trade, and cancellation
ACCOUNT_UPDATEAccount balance and position changes

Private push message wrapper:

1{
2 "topic": "user.5794",
3 "ts": 1771047000000,
4 "data": {
5 "eventType": "ORDER_TRADE_UPDATE"
6 }
7}

REST query endpoints and WebSocket private streams use separate schemas. Clients should parse each schema independently and should not assume field names are identical.

Common differences

DomainREST fieldWebSocket field
Order statusstatusorderStatus
Frozen balancefrozenMarginfrozenBalance
Margin modemarginModemarginMode, returned as a string in positions and streams