Skip to main content

Authentication requests

Query session status​

{
"id": "5494febb-d167-46a2-996d-70533eb4d976",
"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": {
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A", // `null` if the connection is not authenticated.
"authorizedSince": 1649729878532, // `null` if the connection is not authenticated.
"connectedSince": 1649729873021,
"returnRateLimits": false,
"serverTime": 1649730611671,
"userDataStream": true // Is User Data Stream subscription active?
}
}

Log out of the session​

{
"id": "5494febb-d167-46a2-996d-70533eb4d976",
"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?
}
}

Log in with API key (USER_DATA)​

{
"id": "5494febb-d167-46a2-996d-70533eb4d976",
"method": "session.logon",
"params": {
"timestamp": 1770736694138,
"apiKey": "vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A",
"signature": "15af09e41c36f3cc61378c2fbe2c33719a03dd5eba8d0f9206fbda44de717c88"
}
}

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.

Note: Only Ed25519 keys are supported for this feature.

Weight: 2

Parameters:

NameTypeMandatoryDescription
apiKeySTRINGYES
recvWindowDECIMALNOMaximum: 60000.
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.
timestampLONGYESUnix timestamp used to sign the request, in milliseconds or microseconds. The value must reflect the current client
time and is validated by the server for signed endpoints.
signatureSTRINGYES

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?
}
}