Authenticate with your API key. It is in Settings → API, and also appears as Login Token on any task that delivers to WebSocket. Send the raw key without a
Bearer prefixConnection flow
1
Receive hello
As soon as the socket opens, the server sends:
2
Log in
Send your key:This must be your first message. Sending any other opcode first closes the connection with
user not logged in3
Start the heartbeat
Every
heartbeat_interval milliseconds, send { "op": 1 }. The server answers each one with { "op": 11 }.If a heartbeat is missed, the server sends { "op": 3, "text": "About to close the connection, no heartbeat" } and closes the socket4
Receive ready
A successful login returns
op 4. Its d object contains event: "LOGIN", expireAt, tasksLimit, globalMonitorTasksLimit, and tasks5
Receive events
Each notification arrives as
{ "op": 0, "d": { ...event } }. See Events for every shape of dOpcodes
Example
This Node.js client uses thews package. It logs in, keeps the heartbeat going, and reconnects with a growing delay when the connection drops
client.js
Reconnecting
The server does not resume a dropped session, and events sent while you are disconnected are not replayed. On every new connection, log in again and restart the heartbeatResetting your API key closes every open WebSocket connection. Update your clients with the new key