<aside> 💡 Production URL: wss://api.trever.io
</aside>
Before making any authenticated calls to the API, the user needs to login through our auth
endpoint. The returned access_token
must be passed as an auth
message to an established websocket connection.
The following auth
message with access_token
and workspace
must be sent to an established connection to authorize further interactions.
{
"type": "auth",
"data": {
"workspace": "<workspace>",
"token": "<access_token>"
}
}
{
"type": "auth_result",
"data": {
"success": true
}
}
POST /auth/login
{
"email": "the users email",
"password": "the users password"
}
{
"success": true,
"data": {
"id_token": "a token for user identification",
"access_token": "a token authorizing the user to perform certain actions",
"refresh_token": "a token to get a new access_token after the old one expired"
}
}
POST /auth/refresh
{
"access_token": "the access_token used before (can be expired",
"refresh_token": "the refresh_token returned from login"
}
{
"success": true,
"data": {
"id_token": "a token for user identification",
"access_token": "a token authorizing the user to perform certain actions"
}
}