<aside> 💡 Production URL: wss://ws.trever.io

</aside>

Authentication (as v1)

Before making any authenticated calls to the API, the user needs to login through our auth REST endpoint. The returned access_token must be passed as an auth message to an established websocket connection.

Request Message

{
	"type": "auth",
	"data": {
		"workspace": "<workspace>",
		"token": "<access_token>"
	}
} 

Response Message

{
	"type": "auth_result",
	"data": {
		"success": true
	}
}

Ping/Pong (as v1)

Trever provides Ping/Pong messages to keep websockets alive. The client must send a ping message over the websocket to the server, which responds with pong. This should happen every 20s. If no message has been sent over the websocket for one minute, the connection is closed.

Ping Message

{
	"type": "ping"
}

Pong Message

{
	"type": "pong",
	"data": {}
}

Errors (as v1)

{
  "type": "error",
  "data": {
    "code": 1234,
    "message": "this is a error"
  }
}

Endpoints

When connecting to a websocket endpoint please use the following headers: