Skip to main content

Authentication

Use this message to authenticate a client to the exchange, allowing them to submit orders, fetch positions and more.

Clients only need to authenticate once for any given WebSocket session.

If the WebSocket connection is closed and reopened, it is necessary to authenticate again.

Authentication Request

NameTypeComments
credentials_secretstringJWT token generated from an API Key
user_tagstringClient defined tag used to identify the request

Example

{
"authenticate": {
"credentials_secret": "jwt-token",
"user_tag": "unique_request_id"
}
}

Authentication Response

If the authentication is successful, the following message is sent

{
"command_response": {
"error_code": "0",
"error_text": "",
"user_tag": "unique_request_id"
}
}

If the authentication failed, an error message is sent

{
"command_response": {
"error_code": "10",
"error_text": "auth server rejected the authenticate request, Unauthorized",
"user_tag": "unique_request_id"
}
}