Establishing a connection

To get started, you should have:

  • A WebSocket URL, which is found from the API root.
  • A valid session or bot token.

You may authenticate in one of two ways:

You should listen out for Error events to find out if your credentials are incorrect or if something goes wrong here.

After authenticating, the server will respond with Authenticated then it will send a Ready event containing useful data.

The server will now start sending relevant events as they come in.

You should Ping the server every 10 to 30 seconds to prevent your connection being dropped.

Bots receive all events, normal users do not receive UserUpdate events fanned out through servers by default, read more here.

Query Parameters

The Bonfire service supports additional query parameters:

ParameterDescriptionValuesRequired
versionDescribes the protocol version in use.1No †
formatIn what format to send packets, default is JSON.json, msgpackNo
tokenSession token for authenticating the connecting user.No

version may become compulsary in the future, please set it to 1 if you can.

You may specify these in the connection URL: wss://ws.revolt.chat?version=1&format=json.