Files
ritmex-bot/docs/binance/binance-spot/websocket-api_authentication-requests.md
T
2026-02-27 10:52:43 +08:00

4.0 KiB
Raw Blame History

title, source, fetched_at
title source fetched_at
Authentication requests | Binance Open Platform https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests 2026-02-26T10:38:12.599Z

Note: Only Ed25519 keys are supported for this feature.

Log in with API key (SIGNED)

{    "id": "c174a2b1-3f51-4580-b200-8528bd237cb7",    "method": "session.logon",    "params": {        "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",        "signature": "1cf54395b336b0a9727ef27d5d98987962bc47aca6e13fe978612d0adee066ed",        "timestamp": 1649729878532    }}

Authenticate WebSocket connection using the provided API key.

After calling session.logon, you can omit apiKey and signature parameters for future requests that require them.

Note that only one API key can be authenticated. Calling session.logon multiple times changes the current authenticated API key.

Weight: 2

Parameters:

Name

Type

Mandatory

Description

apiKey

STRING

YES

recvWindow

DECIMAL

NO

The value cannot be greater than 60000.
Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

signature

STRING

YES

timestamp

LONG

YES

Data Source: Memory

Response:

{    "id": "c174a2b1-3f51-4580-b200-8528bd237cb7",    "status": 200,    "result": {        "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",        "authorizedSince": 1649729878532,        "connectedSince": 1649729873021,        "returnRateLimits": false,        "serverTime": 1649729878630,        "userDataStream": false // is User Data Stream subscription active?    }}

Query session status

{    "id": "b50c16cd-62c9-4e29-89e4-37f10111f5bf",    "method": "session.status"}

Query the status of the WebSocket connection, inspecting which API key (if any) is used to authorize requests.

Weight: 2

Parameters: NONE

Data Source: Memory

Response:

{    "id": "b50c16cd-62c9-4e29-89e4-37f10111f5bf",    "status": 200,    "result": {        // if the connection is not authenticated, "apiKey" and "authorizedSince" will be shown as null        "apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",        "authorizedSince": 1649729878532,        "connectedSince": 1649729873021,        "returnRateLimits": false,        "serverTime": 1649730611671,        "userDataStream": true     // is User Data Stream subscription active?    }}

Log out of the session

{    "id": "c174a2b1-3f51-4580-b200-8528bd237cb7",    "method": "session.logout"}

Forget the API key previously authenticated. If the connection is not authenticated, this request does nothing.

Note that the WebSocket connection stays open after session.logout request. You can continue using the connection, but now you will have to explicitly provide the apiKey and signature parameters where needed.

Weight: 2

Parameters: NONE

Data Source: Memory

Response:

{    "id": "c174a2b1-3f51-4580-b200-8528bd237cb7",    "status": 200,    "result": {        "apiKey": null,        "authorizedSince": null,        "connectedSince": 1649729873021,        "returnRateLimits": false,        "serverTime": 1649730611671,        "userDataStream": false // is User Data Stream subscription active?    }}