Skip to main content

Events

This page documents various incoming and outgoing events.

Client -> Server#

Authenticate#

Authenticate with Revolt.

{    "type": "Authenticate",    "token": "{token}"}

BeginTyping#

Tell other users that you have begun typing in a channel.

{    "type": "BeginTyping",    "channel": "{channel_id}"}

EndTyping#

Tell other users that you have stopped typing in a channel.

{    "type": "EndTyping",    "channel": "{channel_id}"}

Ping#

Ping the server, you can specify a timestamp that you'll receive back.

{    "type": "Ping",    "data": 0}

Server -> Client#

Error#

An error occurred which meant you couldn't authenticate.

{    "type": "Error",    "error": "{error_id}"}

The {error_id} can be one of the following:

  • LabelMe: uncategorised error
  • InternalError: the server ran into an issue
  • InvalidSession: authentication details are incorrect
  • OnboardingNotFinished: user has not chosen a username
  • AlreadyAuthenticated: this connection is already authenticated

Authenticated#

The server has authenticated your connection and you will shortly start receiving data.

{    "type": "Authenticated"}

Pong#

Ping response from the server.

{    "type": "Pong",    "data": 0}

Ready#

Data for use by client, data structures match the API specification.

{    "type": "Ready",    "users": [{..}],    "servers": [{..}],    "channels": [{..}]}

Message#

Message received, the event object has the same schema as the Message object in the API with the addition of an event type.

{    "type": "Message",    [..]}

MessageUpdate#

Message edited or otherwise updated.

{    "type": "MessageUpdate",    "id": "{message_id}",    "data": {..}}
  • data field contains a partial Message object.

MessageDelete#

Message has been deleted.

{    "type": "MessageDelete",    "id": "{message_id}",    "channel": "{channel_id}"}

ChannelCreate#

Channel created, the event object has the same schema as the Channel object in the API with the addition of an event type.

{    "type": "ChannelCreate",    [..]}

ChannelUpdate#

Channel details updated.

{    "type": "ChannelUpdate",    "id": "{channel_id}",    "data": {..},    "clear": "{field}"}
  • data field contains a partial Channel object.
  • clear is an optional field which specifies an optional object field to remove, one of:
    • Icon
    • Description

ChannelDelete#

Channel has been deleted.

{    "type": "ChannelDelete",    "id": "{channel_id}"}

ChannelGroupJoin#

A user has joined the group.

{    "type": "ChannelGroupJoin",    "id": "{channel_id}",    "user": "{user_id}"}

ChannelGroupLeave#

A user has left the group.

{    "type": "ChannelGroupLeave",    "id": "{channel_id}",    "user": "{user_id}"}

ChannelStartTyping#

A user has started typing in this channel.

{    "type": "ChannelStartTyping",    "id": "{channel_id}",    "user": "{user_id}"}

ChannelStopTyping#

A user has stopped typing in this channel.

{    "type": "ChannelStopTyping",    "id": "{channel_id}",    "user": "{user_id}"}

ChannelAck#

You have acknowledged new messages in this channel up to this message ID.

{    "type": "ChannelAck",    "id": "{channel_id}",    "user": "{user_id}",    "message_id": "{message_id}"}

ServerUpdate#

Server details updated.

{    "type": "ServerUpdate",    "id": "{server_id}",    "data": {..},    "clear": "{field}"}
  • data field contains a partial Server object.
  • clear is an optional field which specifies an optional object field to remove, one of:
    • Icon
    • Banner
    • Description

ServerDelete#

Server has been deleted.

{    "type": "ServerDelete",    "id": "{server_id}"}

ServerMemberUpdate#

Server member details updated.

{    "type": "ServerMemberUpdate",    "id": {        "server": "{server_id}",        "user": "{user_id}"    },    "data": {..},    "clear": "{field}"}
  • data field contains a partial Server Member object.
  • clear is an optional field which specifies an optional object field to remove, one of:
    • Nickname
    • Avatar

ServerMemberJoin#

A user has joined the group.

{    "type": "ServerMemberJoin",    "id": "{server_id}",    "user": "{user_id}"}

ServerMemberLeave#

A user has left the group.

{    "type": "ServerMemberLeave",    "id": "{server_id}",    "user": "{user_id}"}

ServerRoleUpdate#

Server role has been updated or created.

{    "type": "ServerRoleUpdate",    "id": "{server_id}",    "role_id": "{role_id}",    "data": {..},    "clear": "{field}"}
  • data field contains a partial Server Role object.
  • clear is an optional field which specifies an optional object field to remove, one of:
    • Colour

ServerRoleDelete#

Server role has been deleted.

{    "type": "ServerRoleDelete",    "id": "{server_id}",    "role_id": "{role_id}"}

UserUpdate#

User has been updated.

{    "type": "UserUpdate",    "id": "{user_id}",    "data": {..},    "clear": "{field}"}
  • data field contains a partial User object.
  • clear is an optional field which specifies an optional object field to remove, one of:
    • ProfileContent
    • ProfileBackground
    • StatusText
    • Avatar

UserRelationship#

Your relationship with another user has changed.

{    "type": "UserRelationship",    "id": "{your_user_id}",    "user": "{other_user_id}",    "status": "{status}"}
  • status field matches Relationship Status in API.