Cascade
Authentication

Authenticate

Must be called before accessing protected subscriptions (position, order, createorder, cancelorder)

Authenticate the WebSocket connection#

Must be called before accessing protected subscriptions (position, order, createorder, cancelorder)

Channel:WEBSOCKET
Tag:
Authentication

Authenticate the WebSocket connection with JWT token

Parameters

bearerstring

JWT authentication token

Payload
{
  "jsonrpc": "2.0",
  "method": "auth",
  "params": {
    "bearer": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9..."
  },
  "id": 1
}

Authentication success response

Parameters

message?string

Success message

Payload
{
  "jsonrpc": "2.0",
  "result": {
    "message": "Authenticated successfully"
  },
  "usIn": 1234567890123,
  "usOut": 1234567890456,
  "usDiff": 333,
  "id": 1
}

Error response for failed requests

Parameters

jsonrpcstring

JSON-RPC version

errorobject
usIninteger

Request received timestamp in milliseconds

usOutinteger

Response sent timestamp in milliseconds

usDiffinteger

Processing time in milliseconds

id?string | integer | null

Request identifier (if provided in request, otherwise null)

Payload
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32602,
    "message": "Invalid subscription params"
  },
  "usIn": 1234567890123,
  "usOut": 1234567890456,
  "usDiff": 333,
  "id": 2
}