Gateway Events

Gateway connections are WebSockets, meaning they're bidirectional and either side of the WebSocket can send events to the other. The following events are split up into two types:

  • Send events are Gateway events sent by a client to Discord (like when identifying with the Gateway)
  • Receive events are Gateway events that are sent by Discord to a client. These events typically represent something happening inside of a guild where the user is a member of, like a channel being updated.

All Gateway events are encapsulated in a Gateway payload.

For more information about interacting with the Gateway, you can reference the Gateway documentation.

Event Names

In practice, event names are UPPER-CASED with under_scores joining each word in the name. For instance, Channel Create would be CHANNEL_CREATE and Voice State Update would be VOICE_STATE_UPDATE.

For readability, event names in the following documentation are typically left in Title Case.

Gateway Payload Structure

Gateway event payloads have a common structure, but the contents of the associated data (d) varies between the different events.

FieldTypeDescription
opintegerGateway Opcode, which indicates the payload type
d?JSON valueEvent data
s? 1?integerSequence number of event used for resuming sessions and heartbeating
t? 1?stringEvent name for this payload (DISPATCH Opcode only)

1 These fields are received only, and null when the op is not DISPATCH.

Example Gateway Payload (Send)
{
"op": 2,
"d": {}
}
Example Gateway Payload (Receive)
{
"op": 0,
"d": {},
"s": 42,
"t": "GATEWAY_EVENT_NAME"
}

Send Events

Send events are Gateway events encapsulated in an event payload, and are sent by a client to Discord through a Gateway connection.

NameDescription
IdentifyTrigger the initial handshake with the Gateway
ResumeResume a dropped Gateway connection
HeartbeatMaintain an active Gateway connection
Update PresenceUpdate the client's presence
Update Voice StateJoin, move, or disconnect the client from a voice channel or call
Ping Voice ServerPing the Discord voice servers
Request Guild MembersRequest members for one or more guilds
Request Call ConnectRequest a private channels's pre-existing call information
Request Soundboard SoundsRequest soundboard sounds for one or more guilds
Update Guild SubscriptionsUpdate subscriptions for a guild
Connect LobbyJoin a lobby
Disconnect LobbyLeave a lobby
Update Lobby Voice StateUpdate the client's voice state in a lobby
Create StreamCreate a stream for the client (Go Live)
Delete StreamEnd a client stream
Watch StreamWatch a user's stream
Ping StreamPing a user stream's voice server
Set Stream PausedPause/resume a client stream
Create Embedded ActivityLaunch an embedded activity in a voice channel or call
Update Embedded ActivityUpdate an embedded activity
Delete Embedded ActivityDelete an embedded activity
Request Forum UnreadsRequest thread-only channel unread counts
Remote CommandSend a remote command to an embedded (Xbox, PlayStation) voice session
Request Deleted Entity IDsRequest deleted entity IDs not matching a given hash for a guild
Request Soundboard SoundsRequest soundboard sounds for one or more guilds
Create Speed TestCreate a voice speed test
Delete Speed TestDelete a voice speed test
Request Last MessagesRequest last messages for a guild's channels
Search Recent MembersRequest recently-joined members for a guild
Request Channel StatusesRequest voice channel statuses for a guild

Identify

Used to trigger the initial handshake with the Gateway.

Details about identifying is in the Gateway documentation.

Identify Structure
FieldTypeDescription
tokenstringAuthentication token
propertiesclient properties objectClient and system information
compress?booleanWhether this connection uses legacy payload compression (default false)
large_threshold?integerTotal number of members where, for bots, the Gateway will stop sending offline members in the guild member list, or, for users, stop sending non-stateful events for guilds without a subscription (25-250, default 25 for bots and 250 for users) {/ TODO: Verify default /}
shard?array[integer, integer]The connection's shard (shard_id, num_shards), used for connection sharding
presence? 1update presence objectInitial presence information
intents? 2integerThe Gateway intents you wish to receive
capabilities?integerThe Gateway capabilities you wish to enable
client_state?client state objectThe client's current cache state, used for reducing unneeded information transmission on re-identify

1 For user accounts, the status and activities specified may not always be respected. The field should only be used when re-identifying to communicate the last known presence of the user.

2 Required for bots on API v8 and above.

Example Identify
{
"op": 2,
"d": {
"token": "my_token",
"properties": {
"os": "linux",
"browser": "disco",
"device": "disco"
},
"compress": false,
"presence": {
"activities": [],
"status": "unknown",
"since": 0,
"afk": false
},
"capabilities": 16381,
"client_state": {
"api_code_version": 0,
"guild_versions": {}
}
}
}

Resume

Used to replay missed events when a disconnected client resumes.

Details about resuming are in the Gateway documentation.

Resume Structure
FieldTypeDescription
tokenstringAuthentication token
session_idstringExisting session ID
seqintegerLast sequence number received
Example Resume
{
"op": 6,
"d": {
"token": "randomstring",
"session_id": "30f32c5d54ae86130fc4a215c7474263",
"seq": 1337
}
}

Heartbeat

Used to maintain an active Gateway connection. Must be sent every heartbeat_interval milliseconds after the Opcode 10 Hello payload is received. The inner d key is the last sequence number—s—received by the client. If you have not yet received one, send null. Fires a Heartbeat ACK Gateway event.

Details about heartbeats are in the Gateway documentation.

Example Heartbeat
{
"op": 1,
"d": 251
}

Update Presence

Sent by the client to indicate a presence update.

Update Presence Structure
FieldTypeDescription
activitiesarray[activity object]The user's activities
statusstringthe user's new status
sinceintegerUnix timestamp (in milliseconds) of when the client went idle, or 0 if it is not
afkbooleanWhether or not the client is AFK, used to determine whether to dispatch mobile push notifications
Example Update Presence
{
"op": 3,
"d": {
"since": 0,
"activities": [
{
"application_id": "383226320970055681",
"assets": {
"large_image": "565945350846939145",
"large_text": "Editing a TEXT file",
"small_image": "565945770067623946",
"small_text": "Visual Studio Code"
},
"buttons": ["View Repository"],
"created_at": "1695164784863",
"details": "Editing index.astro",
"flags": 0,
"id": "d11307d8c0abb135",
"name": "Visual Studio Code",
"session_id": "30f32c5d54ae86130fc4a215c7474263",
"state": "Workspace: vendicated.dev",
"timestamps": {
"start": "1695164482423"
},
"type": 0
}
],
"status": "online",
"afk": false
}
}

Update Voice State

Sent when a client wants to join, move, or disconnect from a voice channel.

Update Voice State Structure
FieldTypeDescription
guild_id?snowflakeThe ID of the guild the voice channel is in, if any
channel_id?snowflakeThe ID of the voice or private channel the client wants to join (null if disconnecting)
self_mutebooleanWhether the client is muted
self_deafbooleanWhether the client is deafened
self_video?booleanWhether the client is streaming video to the channel
preferred_region?stringThe preferred voice region ID for the voice channel (not guaranteed)
flags?integerThe client's voice flags
Example Update Voice State
{
"op": 4,
"d": {
"guild_id": "41771983423143937",
"channel_id": "127121515262115840",
"self_mute": false,
"self_deaf": false,
"self_video": false,
"flags": 3
}
}

Ping Voice Server

Sent when a client wants to ping a voice server. The inner d key should be set to null.

Example Ping Voice Server
{
"op": 5,
"d": null
}

Request Guild Members

Used to request all members for a guild or a list of guilds. When initially connecting, if you don't have the GUILD_PRESENCES Gateway intent, or if the guild is over 75k members, it will only send members who are in voice, plus the member for you (the connecting user). Otherwise, if a guild has over large_threshold members (value in the Gateway Identify), it will only send members who are online, have a role, have a nickname, or are in a voice channel, and if it has under large_threshold members, it will send all members. If a client wishes to receive additional members, they need to explicitly request them via this operation. Fires multiple Guild Members Chunk events with up to 1000 members per chunk until all members that match the request have been sent.

Due to our privacy and infrastructural concerns with this feature, there are some limitations that apply:

  • For bots, the GUILD_PRESENCES privileged intent is required to request presences
  • For bots, the GUILD_MEMBERS privileged intent is required to request the entire member list (query of "" and limit of 0)
  • For users, the MANAGE_ROLES, KICK_MEMBERS, or BAN_MEMBERS permissions are required to request the entire member list (query of "" and limit of 0)
  • For bots, only one guild ID may be requested at a time
  • Requesting a prefix (query parameter) will return a maximum of 100 members
  • user_ids will be limited to 100 members
Request Guild Members Structure
FieldTypeDescription
guild_idarray[snowflake] | snowflakeID(s) of the guild(s) to get members for
query? 1stringString that the username/nickname starts with, or an empty string to return all members
limit? 2integerMaximum number of members to send matching the query (0-100, must be 0 with an empty query)
presences?booleanWhether the presence of matched members will be returned
user_ids? 1snowflake or array of snowflakesThe user IDs to request (max 100)
nonce? 3stringNonce to identify the Guild Members Chunk response

1 One of query or user_ids is required.

2 Required when specifying query.

3 The nonce can only be up to 32 bytes. If you send an invalid nonce, it will be ignored, and the reply member chunk(s) will not have a nonce set.

Example Request Guild Members
{
"op": 8,
"d": {
"guild_id": ["41771983444115456"],
"query": "",
"limit": 0
}
}

Request Call Connect

Used to request a private channel's pre-existing call data, created before the Gateway connection was established. Fires a Call Create Gateway event if a call is found.

Request Call Connect Structure
FieldTypeDescription
channel_idsnowflakeID of the DM or group DM channel
Example Request Call Connect
{
"op": 13,
"d": {
"channel_id": "957057010334048288"
}
}

Request Soundboard Sounds

Used to request soundboard sounds for a list of guilds. Fires a Soundboard Sounds Gateway event for every guild in response.

Request Soundboard Sounds Structure
FieldTypeDescription
guild_idsarray[snowflake]The IDs of the guilds to get soundboard sounds for
Example Request Soundboard Sounds
{
"op": 31,
"d": {
"guild_ids": ["41771983444115456", "1015060230222131221", "811255666990907402"]
}
}

Request Last Messages

Used to request the last messages (indicated by the last_message_id field) from channels. Fires a Last Messages Gateway event with up to 100 messages that match the request.

Request Last Messages Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
channel_idsarray[snowflake]The IDs of the channels to request last messages for (max 100)
Example Request Last Messages
{
"op": 34,
"d": {
"guild_id": "957057010334048288",
"channel_ids": ["1145501524013895733", "1145501524013895734"]
}
}

Search Recent Members

Used to search the 10,000 most recently joined members in a guild. Fires a Guild Members Chunk Gateway event with up to 1000 members that match the request.

Search Recent Members Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild to search members for
query 1stringString that the username/nickname starts with, or an empty string to return all members
continuation_token 2?snowflakeThe member ID to continue pagination from
nonce? 3stringNonce to identify the Guild Members Chunk response

1 When a query is provided, results are limited to one member.

2 Pagination is based on the joined_at field descending. To paginate, you provide the member ID of the member that joined the earliest in the previously received Guild Members Chunk. You can only paginate up to 10,000 members back from the most recently joined member.

3 The nonce can only be up to 32 bytes. If you send an invalid nonce, it will be ignored, and the reply member chunk will not have a nonce set.

Example Search Recent Members
{
"op": 35,
"d": {
"guild_id": "957057010334048288",
"query": "",
"continuation_token": null
}
}

Request Channel Statuses

Used to request the voice channel statuses for a guild. Fires a Channel Statuses Gateway event with the requested statuses.

Request Channel Statuses Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
Example Request Channel Statuses
{
"op": 36,
"d": {
"guild_id": "957057010334048288"
}
}

Receive Events

Received events are Gateway events encapsulated in an event payload, and are sent by Discord to a client through a Gateway connection. Most received events correspond to dispatch events that happen relevant to the current user and the guilds it is a member of.

NameDescription
HelloDefines the heartbeat interval
Heartbeat ACKAcknowledges a received client heartbeat
ReconnectIndicates the server is going away, client should reconnect to Gateway and resume
Invalid SessionFailure response to Identify or Resume, or indicates an invalid active session
DispatchDispatches an event to the client

Hello

Sent on connection to the WebSocket. Defines the heartbeat interval that the client should heartbeat to.

Hello Structure
FieldTypeDescription
_tracearray[string]An array of stringified JSON values representing the connection trace, used for debugging
heartbeat_intervalintegerThe interval (in milliseconds) the client should heartbeat at
Example Hello
{
"op": 10,
"d": {
"heartbeat_interval": 41250,
"_trace": ["[\"gateway-prd-us-east1-c-6w69\",{\"micros\":0.0}]"]
},
"s": null,
"t": null
}

Heartbeat ACK

Sent in response to receiving a heartbeat to acknowledge that it has been received.

Details about heartbeats are in the Gateway documentation.

Example Heartbeat ACK
{
"op": 11,
"d": null,
"s": null,
"t": null
}

Reconnect

The reconnect event is dispatched when a client should reconnect to the Gateway (and resume their existing session, if they have one). This event usually occurs during deploys to migrate sessions gracefully off old hosts.

Example Reconnect
{
"op": 7,
"d": null,
"s": null,
"t": null
}

Invalid Session

Sent to indicate one of at least three different situations:

  • The Gateway could not initialize a session after receiving an Opcode 2 Identify
  • The Gateway could not resume a previous session after receiving an Opcode 6 Resume
  • The Gateway has invalidated an active session and is requesting client action

The inner d key is a boolean that indicates whether the session may be resumable. See Connecting and Resuming for more information.

Example Invalid Session
{
"op": 9,
"d": false,
"s": null,
"t": null
}

Dispatch Events

These events directly correspond with a specific action or state change that has occurred in the platform.

NameDescription
ReadyInitial state information
Ready SupplementalSupplemental information for the initial state, not critical to beginning use of the platform
ResumedAcknowledges a successful Resume
Auth Session ChangeCurrent session's associated auth session ID changed
Authenticator CreateWebAuthn authenticator was created
Authenticator UpdateWebAuthn authenticator was updated
Authenticator DeleteWebAuthn authenticator was deleted
Application Command Permissions UpdateApplication command permission was updated
Auto Moderation Rule CreateAutoMod rule was created
Auto Moderation Rule UpdateAutoMod rule was updated
Auto Moderation Rule DeleteAutoMod rule was deleted
Auto Moderation Action ExecutionAutoMod rule was triggered and an action was executed (e.g. a message was blocked)
Auto Moderation Mention Raid DetectionAutoMod mention raid incident was detected
Call CreatePrivate channel call was created
Call UpdatePrivate channel call was updated
Call DeletePrivate channel call was deleted
Channel CreateNew guild channel created
Channel UpdateChannel was updated
Channel DeleteChannel was deleted
Channel StatusesResponse to Request Channel Statuses
Voice Channel Status UpdateVoice channel status was updated
Channel Pins UpdateMessage was pinned or unpinned
Channel Recipient AddUser joined a group DM channel
Channel Recipient RemoveUser was removed from a group DM channel
DM Settings Upsell ShowDM privacy settings upsell modal was triggered
Thread CreateThread was created, also sent when being added to a private thread
Thread UpdateThread was updated
Thread DeleteThread was deleted
Thread List SyncSent when gaining access to a channel, contains all active threads in that channel
Thread Member UpdateThread member for the current user was updated
Thread Members UpdateUser(s) were added to or removed from a thread
Friend Suggestion CreateFriend suggestion was created
Friend Suggestion DeleteFriend suggestion was deleted
Guild CreateGuild became available or user joined a new guild
Guild UpdateGuild was updated
Guild DeleteGuild became unavailable, or user left/was removed from a guild
Guild Audit Log Entry CreateGuild audit log entry was created
Guild Ban AddUser was banned from a guild
Guild Ban RemoveUser was unbanned from a guild
Guild Emojis UpdateGuild emoji were updated
Guild Stickers UpdateGuild stickers were updated
Guild Join Request CreateGuild join request was created
Guild Join Request UpdateGuild join request was updated
Guild Join Request DeleteGuild join request was deleted
Guild Member AddUser joined a guild
Guild Member RemoveUser was removed from a guild
Guild Member UpdateGuild member was updated
Guild Members ChunkResponse to Request Guild Members
Guild Role CreateGuild role was created
Guild Role UpdateGuild role was updated
Guild Role DeleteGuild role was deleted
Guild Scheduled Event CreateGuild scheduled event was created
Guild Scheduled Event UpdateGuild scheduled event was updated
Guild Scheduled Event DeleteGuild scheduled event was deleted
Guild Scheduled Event User AddUser subscribed to a guild scheduled event
Guild Scheduled Event User RemoveUser unsubscribed from a guild scheduled event
Guild Soundboard Sound CreateGuild soundboard sound was created
Guild Soundboard Sound UpdateGuild soundboard sound was updated
Guild Soundboard Sound DeleteGuild soundboard sound was deleted
Soundboard SoundsResponse to Request Soundboard Sounds
Guild Integrations UpdateGuild integration was updated
Integration CreateGuild integration was created
Integration UpdateGuild integration was updated
Integration DeleteGuild integration was deleted
Interaction CreateUser used an interaction, such as an Application Command
Invite CreateGuild invite to a channel was created
Invite DeleteGuild invite to a channel was deleted
Message CreateMessage was created
Message UpdateMessage was edited
Message DeleteMessage was deleted
Message Delete BulkMultiple messages were deleted at once
Message Poll Vote AddUser voted on a poll
Message Poll Vote RemoveUser removed a vote on a poll
Message Reaction AddUser reacted to a message
Message Reaction Add ManyMany users reacted to a message
Message Reaction RemoveUser removed a reaction from a message
Message Reaction Remove AllAll reactions were explicitly removed from a message
Message Reaction Remove EmojiAll reactions for a given emoji were explicitly removed from a message
Recent Mention DeleteRecent message that mentioned the current user was acknowledged
Last MessagesResponse to Request Last Messages
OAuth2 Token RevokeOAuth2 application was deauthorized
Presence UpdateUser presence was updated
Relationship AddUser had a relationship added
Relationship UpdateUser had a relationship updated
Relationship RemoveUser had a relationship removed
Stage Instance CreateStage instance was created
Stage Instance UpdateStage instance was updated
Stage Instance DeleteStage instance was deleted or closed
Typing StartUser started typing in a channel
User UpdateCurrent user changed
User Application RemoveUser uninstalled an application
User Connections UpdateUser connection was created, updated, or deleted
User Note UpdateUser note was updated
User Required Action UpdateUser's required action was updated
User Settings UpdateUser settings were updated
Voice State UpdateUser joined, left, or moved a voice channel
Voice Server UpdateVoice connection server was updated
Voice Channel Effect SendUser sent an effect in a voice channel the current user is connected to
Webhooks UpdateChannel webhook was created, update, or deleted

Ready

Sent when a client has completed the initial handshake with the Gateway (for new sessions). The Ready event is the largest and most complex event the Gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform.

Ready Structure
FieldTypeDescription
_tracearray[string]An array of stringified JSON values representing the connection trace, used for debugging
vintegerAPI version
useruser objectThe connected user
user_settings 1 4 (deprecated)user settings objectThe client settings for the user
user_settings_proto? 1stringThe base-64 encoded preloaded user settings for the user, (if missing, defaults are used)
guilds 2 6array[gateway guild object]The guilds the user is in
guild_join_requests 1array[partial guild join request]Active guild join requests the user has
relationships 1array[relationship]The relationships the user has with other users
friend_suggestion_count? 1integerThe number of friend suggestions the user has
private_channels 1array[channel object]The DMs and group DMs the user is participating in
connected_accountsarray[connection]The third-party accounts the user has linked
notes 1 5map[snowflake, string]A mapping of user IDs to notes the user has made for them
presences 6array[presence object]The presences of the user's non-offline friends and implicit relationships (depending on the NO_AFFINE_USER_IDS Gateway capability).
merged_presences 6merged presences objectThe presences of the user's non-offline friends and implicit relationships (depending on the NO_AFFINE_USER_IDS Gateway capability), and any guild presences sent at startup
merged_members 6 7array[array[guild member object]]The members of the user's guilds, in the same order as the guilds array
users 6array[partial user object]The deduped users across all objects in the event
application?gateway application objectThe application of the connected user, if it is a bot
session_idstringUnique session ID, used for resuming connections
session_typestringThe type of session that was started
auth_session_id_hash 1stringThe hash of the auth session ID corresponding to the auth token used to connect
auth_token? 1 3stringThe refreshed auth token for this user; if present, the client should discard the current auth token and use this in subsequent requests to the API
analytics_token 1stringThe token used for analytical tracking requests
authenticator_typesarray[integer]The types of multi-factor authenticators the user has enabled
required_action? 1stringThe action a user is required to take before continuing to use Discord
country_code 1stringThe detected ISO 3166-1 alpha-2 country code of the user's current IP address
geo_ordered_rtc_regionsarray[string]A geo-ordered list of RTC regions that can be used when when setting a voice channel's rtc_region or updating the client's voice state
tutorial 1 8?tutorial objectThe tutorial state of the user, if any
shard?array[integer, integer]The shard information (shard_id, num_shards) associated with this session, if sharded
resume_gateway_urlstringWebSocket URL for resuming connections
api_code_version 1integerThe API code version, used when re-identifying with client state v2
experiments 1array[user experiment object]User experiment rollouts for the user
guild_experiments 1array[guild experiment object]Guild experiment rollouts for the user

1 Feature is not available to or not tracked for bots. This field may be empty, omitted, or null.

2 For bots, guilds start out as unavailable when they connect to the Gateway. As they become available, the bot will be notified via Guild Create events.

3 Requires the AUTH_TOKEN_REFRESH Gateway capability.

4 Omitted when using the USER_SETTINGS_PROTO Gateway capability.

5 Omitted when using the LAZY_USER_NOTES Gateway capability.

6 When using the DEDUPE_USER_OBJECTS Gateway capability, presences, as well as each guild's presences array, is replaced by merged_presences. In addition, each guild's members array will be collapsed into merged_members. Finally, the users array will contain the user objects for every user in the event. Any user object in the event will be omitted, with an ID left in its place (e.g. user_id in member objects, recipient_ids in private channel objects, etc.).

7 When using the PRIORITIZED_READY_PAYLOAD Gateway capability, merged_members in Ready will only include the client's member object for each guild. The rest will be sent in the Ready Supplemental event. See the gateway guild object documentation for more information about included data.

8 The tutorial state is cleared after a period of inactivity. A null tutorial means no indicators will be shown.

Session Type
ValueDescription
normalA normal client session
Merged Presences Structure
FieldTypeDescription
friendsarray[presence object]Presences of the user's friends and implicit relationships (depending on the NO_AFFINE_USER_IDS Gateway capability)
guilds 1array[array[presence object]]Presences of the user's guilds, in the same order as the guilds array in Ready

1 See the gateway guild object documentation for more information about included data.

Tutorial Structure
FieldTypeDescription
indicators_suppressedboolWhether the user has suppressed all tutorial indicators
indicators_confirmedarray[string]An array of the tutorial indicators the user has confirmed
Gateway Application Structure
FieldTypeDescription
idsnowflakeThe ID of the application
flagsintegerThe application's flags

Ready Supplemental

Sent soon after Ready, with additional data that is not critical to begin interacting with the platform.

If this event is enabled, any fields received in it that are also present in Ready will not be received in Ready (unless otherwise specified).

Ready Supplemental Structure
FieldTypeDescription
guildsarray[supplemental guild object]The guilds the user is in
merged_members 1array[array[member object]]The members of the user's guilds, in the same order as the guilds array
merged_presences 1merged presences objectThe presences of the user's non-offline friends and implicit relationships (depending on the NO_AFFINE_USER_IDS Gateway capability), and any guild presences sent at startup
lazy_private_channelsarray[channel object]Additional DMs and group DMs the user is participating in, omitted from Ready because they were already in client state cache
disclosearray[string]Upcoming changes that the client should disclose to the user

1 See the gateway guild object documentation for more information about included data.

Supplemental Guild Structure
FieldTypeDescription
idsnowflakeThe ID of the guild
voice_statesarray[voice state object]States of members currently in voice channels

Resumed

Sent when a client has sent a resume payload to the Gateway (for resuming existing sessions). Signifies the end of event replaying.

Resumed Structure
FieldTypeDescription
_tracearray[string]An array of stringified JSON values representing the connection trace, used for debugging
Example Resumed
{
"_trace": [
"[\"gateway-prd-us-east1-c-6w69\",{\"micros\":4493,\"calls\":[\"id_created\",{\"micros\":0,\"calls\":[]},\"session_lookup_time\",{\"micros\":4163,\"calls\":[]},\"session_lookup_finished\",{\"micros\":17,\"calls\":[]},\"discord-sessions-prd-2-31\",{\"micros\":66}]}]"
]
}

Authentication

Auth Session Change

Sent when the current session's associated auth session ID changes.

Auth Session Change Structure
FieldTypeDescription
auth_session_id_hashstringThe hash of the auth session ID corresponding to the auth token used to connect

Authenticator Create

Sent when a WebAuthn authenticator is created. The inner payload is an authenticator object.

Authenticator Update

Sent when a WebAuthn authenticator is updated. The inner payload is an authenticator object.

Authenticator Delete

Sent when a WebAuthn authenticator is deleted.

Authenticator Delete Structure
FieldTypeDescription
idstringThe ID of the authenticator
typestringThe type of authenticator

Application Commands

Application Command Permissions Update

Sent when an application command's permissions are updated. The inner payload is an application command permissions object.

Auto Moderation

Auto Moderation Rule Create

Sent when a rule is created. The inner payload is an automod rule object. Requires the MANAGE_GUILD permission.

Auto Moderation Rule Update

Sent when a rule is updated. The inner payload is an automod rule object. Requires the MANAGE_GUILD permission.

Auto Moderation Rule Delete

Sent when a rule is deleted. The inner payload is an automod rule object. Requires the MANAGE_GUILD permission.

Auto Moderation Action Execution

Sent when a rule is triggered and an action is executed (e.g. message is blocked). Requires the MANAGE_GUILD permission.

Auto Moderation Action Execution Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild where the action was executed
actionautomod action objectThe action that was executed
rule_idsnowflakeThe ID of the rule that was triggered
rule_trigger_typeintegerThe trigger type of the rule that was triggered
user_idsnowflakeThe ID of the user which generated the content that triggered the rule
channel_id?snowflakeThe ID of the channel in which the user content was posted
message_id?snowflakeThe ID of the message that triggered the rule
alert_system_message_id?snowflakeThe ID of the AutoMod system message posted as a result of this action
contentstringThe user message content
matched_keyword?stringThe word or phrase configured that triggered the rule
matched_content?stringThe substring in content that triggered the rule

Auto Moderation Mention Raid Detection

Sent when a mention raid is detected. Requires the MANAGE_GUILD permission.

Auto Moderation Mention Raid Detection Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild where the mention raid was detected
decision_idstringThe ID of the decision that was executed
suspicious_mention_activity_untilISO8601 timestampWhen the mention activity restrictions will end

Calls

Call Create

Sent when a user creates a call in a private channel, or to inform the client of an existing call after a Request Call Connect.

Call Create Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the private channel this call is occuring in
message_idsnowflakeThe ID of the message associated with the call
regionstringThe voice region ID the call is hosted from
ringingarray[snowflake]The IDs of the users that are being rung to join the call
voice_statesarray[voice state object]The voice states of the users already in the call

Call Update

Sent when metadata about a call changes.

Call Update Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the private channel this call is occuring in
message_idsnowflakeThe ID of the message associated with the call
regionstringThe voice region ID the call is hosted from
ringingarrayThe IDs of the users that are being rung to join the call

Call Delete

Sent when a call is deleted, or becomes unavailable due to an outage.

Call Delete Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the private channel this call is occuring in
unavailable?booleanWhether the call is unavailable due to an outage

Channels

Channel Create

Sent when a new guild channel is created, relevant to the current user. The inner payload is a channel object.

Channel Update

Sent when a channel is updated. The inner payload is a channel object. This is not sent when the field last_message_id or status is altered. To keep track of the last_message_id changes, you must listen for Message Create events (or Thread Create events for thread-only channels). To keep track of the status changes, you must listen for Voice Channel Status Update events.

This event may reference roles or guild members that no longer exist in a guild.

Channel Delete

Sent when a channel relevant to the current user is deleted. The inner payload is a channel object.

Channel Statuses

Sent in response to Request Channel Statuses. Contains the statuses for all voice channels that have one set.

Channel Statuses Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
channelsarray[channel status object]The voice channels with statuses
Channel Status Structure
FieldTypeDescription
idsnowflakeThe ID of the channel
statusstringThe status of the voice channel (max 500 characters)

Voice Channel Status Update

Sent when a voice channel's status is updated.

Voice Channel Status Update Structure
FieldTypeDescription
idsnowflakeThe ID of the voice channel
guild_idsnowflakeThe ID of the guild
status?stringThe status of the voice channel (max 500 characters)

Channel Pins Update

Sent when a message is pinned or unpinned in a text channel. This is not sent when a pinned message is deleted.

Channel Pins Update Structure
FieldTypeDescription
guild_id?snowflakeThe ID of the guild
channel_idsnowflakeThe ID of the channel
last_pin_timestamp??ISO8601 timestampWhen the most recent pinned message was pinned

Channel Recipient Add

Sent when a user is added to a group direct message channel.

Channel Recipient Add Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel
userpartial user objectThe user who was added

Channel Recipient Remove

Sent when a user is removed from a group direct message channel.

Channel Recipient Remove Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel
userpartial user objectThe user who was removed

DM Settings Upsell Show

May be sent when a user rejects a message request.

DM Settings Upsell Show Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild

Thread Create

Sent when a thread is created, relevant to the current user, or when the current user is added to a thread. The inner payload is a channel object.

  • When a thread is created, includes an additional newly_created boolean field.
  • When being added to an existing private thread, includes the optional member field.
Thread Create Structure Extra Fields
FieldTypeDescription
newly_created?booleanWhether the thread was just created

Thread Update

Sent when a thread is updated. The inner payload is a channel object. This is not sent when the field last_message_id is altered. To keep track of the last_message_id changes, you must listen for Message Create events.

Thread Delete

Sent when a thread relevant to the current user is deleted. The inner payload is a subset of the channel object, containing just the id, guild_id, parent_id, and type fields.

Thread List Sync

Sent to sync a guild's active thread list, or to sync specific channel lists when the current user gains access to a channel within a guild.

For bots, all active threads are synced at startup. For user accounts, only joined threads are synced, and the full list is sent through this event on subscription.

Thread List Sync Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
channel_ids?array[snowflake]The parent channel IDs whose threads are being synced (may contain channel IDs that have no active threads so you know to clear that data); if omitted, then threads were synced for the entire guild
threadsarray[channel object]All active threads in the given channels that the current user can access
membersarray[thread member object]All thread member objects from the synced threads for the current user, indicating which threads the current user has been added to

Thread Member Update

Sent when the thread member object for the current user is updated. The inner payload is a thread member object with an extra guild_id field. For bots, his event largely is just a signal that you are a member of the thread. See the threads docs for more details.

Thread Member Update Structure Extra Fields
FieldTypeDescription
guild_idsnowflakethe id of the guild

Thread Members Update

Sent when anyone is added to or removed from a thread. If the current user does not have the GUILD_MEMBERS Gateway intent, then this event will only be sent if the current user was added to or removed from the thread.

Thread Members Update Structure
FieldTypeDescription
idsnowflakeThe ID of the thread
guild_idsnowflakeThe ID of the guild
member_countintegerThe approximate number of members in the thread, capped at 50
added_members? 1array[thread member object]The users who were added to the thread
removed_member_ids?array of snowflakesThe IDs of the users who were removed from the thread

1 Also include member and nullable presence fields.

Friend Suggestions

Friend Suggestion Create

Sent when a friend suggestion is created. The inner payload is a friend suggestion object.

Friend Suggestion Delete

Sent when a friend suggestion is deleted.

Friend Suggestion Delete Structure
FieldTypeDescription
suggested_user_idsnowflakeThe ID of the suggested user

Guilds

Gateway Guild Object

Guild objects received over the Gateway have extended attributes that are not provided in the REST API.

Gateway Guild Structure
FieldTypeDescription
joined_atISO8601 timestampWhen this guild was joined
largebooleanWhether this is considered a large guild
unavailable?booleanWhether the guild is unavailable due to an outage
geo_restricted? 6booleanWhether the guild is not available in your current region
member_countintegerTotal number of members in this guild
voice_states 4array[voice state object]States of members currently in voice channels
members 1array[guild member object]Members in the guild
channelsarray[channel object]Channels in the guild
threads 3array[channel object]All active threads in the guild that current user has permission to view
presences 2array[presence object]Presences of included guild members; will only include non-offline members for large guilds
stage_instancesarray[stage instance object]Stage instances in the guild
guild_scheduled_eventsarray[guild scheduled event object]Scheduled events in the guild
data_mode 5stringThe data mode for this object
properties 5partial guild objectThe properties of the guild; an otherwise-normal guild object that is missing the below fields
stickersarray[sticker object]Custom guild stickers
rolesarray[role object]Roles in the guild
emojisarray[emoji object]Custom guild emojis
premium_subscription_countintegerThe number of premium subscriptions (boosts) the guild currently has

1 For bots without the GUILD_PRESENCES Gateway intent, user accounts, or guilds with over 75k members, this will only include the client's member and users in voice channels. User accounts additionally receive friends and implicit relationships (depending on the NO_AFFINE_USER_IDS Gateway capability), as well as users they have an open DM with.

2 User accounts only receive presences for non-offline friends and implicit relationships (depending on the NO_AFFINE_USER_IDS Gateway capability), as well as users they have an open DM with. Bots with the GUILD_PRESENCES Gateway intent receive all presences.

3 User accounts are only synced threads they have been added to. Bots are synced all threads.

4 Omitted when using the PRIORITIZED_READY_PAYLOAD Gateway capability.

5 Requires the CLIENT_STATE_V2 Gateway capability. Without the capability, the properties field will be merged into the main object, along with the rest of the extended attributes.

6 Geo-restricted guilds will also be marked as unavailable and will not be joinable or accessable.

Unavailable Guild Object

A partial guild object. Represents an offline guild, or a guild the client is not connected to yet.

Unavailable Guild Structure
FieldTypeDescription
idsnowflakeThe ID of the guild
unavailable?booleanWhether the guild is unavailable due to an outage
geo_restricted?booleanWhether the guild is not available in your current region
Example Unavailable Guild
{
"id": "41771983423143937",
"unavailable": true
}
Data Mode
ValueDescription
fullThe full guild object is sent
partialGuild data already in the client state cache is omitted
unavailableThe guild is unavailable due to an outage

Guild Create

This event can be sent in three different scenarios:

  1. When a bot is initially connecting, to lazily load and backfill information for all unavailable guilds sent in the Ready event. Guilds that are unavailable due to an outage or geo-restricted will send a Guild Delete event.
  2. When a Guild becomes available again to the client.
  3. When the current user joins a new Guild.

The inner payload can be:

Guild Update

Sent when a guild is updated. The inner payload is a guild object.

Guild Delete

Sent when a guild becomes or was already unavailable due to an outage, or when the user leaves or is removed from a guild. The inner payload is an unavailable guild object. If the unavailable field is not set, the user was removed from the guild.

Guild Audit Log Entry Create

Sent when a guild audit log entry is created. The inner payload is an Audit Log Entry object. Requires the VIEW_AUDIT_LOG permission.

Guild Ban Add

Sent when a user is banned from a guild.

Guild Ban Add Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
userpartial user objectThe banned user

Guild Ban Remove

Sent when a user is unbanned from a guild.

Guild Ban Remove Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
userpartial user objectThe unbanned user

Guild Emojis Update

Sent when a guild's emojis have been updated.

Guild Emojis Update Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
emojisarray[emoji object]The emojis in the guild

Guild Stickers Update

Sent when a guild's stickers have been updated.

Guild Stickers Update Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
stickersarray[sticker object]The stickers in the guild

Guild Join Request Create

Sent when a user creates a guild join request. Requires the KICK_MEMBERS permission for users other than the current user.

Guild Join Request Create Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
requestguild join request objectThe created join request
statusstringThe status of the join request

Guild Join Request Update

Sent when a guild join request is updated. Requires the KICK_MEMBERS permission for users other than the current user.

Guild Join Request Update Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
requestguild join request objectThe updated join request
statusstringThe status of the join request

Guild Join Request Delete

Sent when a guild join request is deleted. Requires the KICK_MEMBERS permission for users other than the current user.

Guild Join Request Delete Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
idsnowflakeThe ID of the join request
user_idsnowflakeThe ID of the user who created the join request

Guild Member Add

Sent when a new user joins a guild. The inner payload is a guild member object with an extra guild_id key:

For user accounts, this event is only sent for themselves. Users are not automatically subscribed to friends and implicit relationships or users they have an open DM with upon them joining.

Guild Member Add Extra Fields
FieldTypeDescription
guild_idsnowflakeThe ID of the guild

Guild Member Remove

Sent when a user is removed from a guild (leave/kick/ban).

For user accounts, this event is only sent for themselves, members they are subscribed to, and in response to actions committed by the user. Users are automatically subscribed to friends and implicit relationships (depending on the NO_AFFINE_USER_IDS Gateway capability), as well as users they have an open DM with.

Guild Member Remove Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
useruser objectThe removed user

Guild Member Update

Sent when a guild member is updated. This will also fire when the user object of a guild member changes. Optional fields will only be included if changed.

For user accounts, this event is only sent for members they are subscribed to, and in response to actions committed by the user. Users are automatically subscribed to friends and implicit relationships (depending on the NO_AFFINE_USER_IDS Gateway capability), as well as users they have an open DM with.

Guild Member Update Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
userpartial user objectThe user this guild member represents
nick??stringThe guild-specific nickname of the member (1-32 characters)
avatar?stringThe member's guild avatar hash
avatar_decoration_data??avatar decoration data objectThe member's guild avatar decoration
rolesarray[snowflake]The role IDs assigned to this member
joined_atISO8601 timestampWhen the user joined the guild
premium_since?ISO8601 timestampWhen the member subscribed to (started boosting) the guild
deaf?booleanWhether the member is deafened in voice channels
mute?booleanWhether the member is muted in voice channels
pending? 1booleanWhether the member has not yet passed the guild's member verification requirements
communication_disabled_until 2?ISO8601 timestampwhen the user's timeout will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out
flagsintegerThe member's flags

1 Won't be included in contexts that are impossible for a pending member to exist in.

2 If the value is a time in the past, the member's timeout has expired and they can communicate again. An event will not be sent when this happens.

Guild Members Chunk

Sent in response to Request Guild Members. You can use the chunk_index and chunk_count to calculate how many chunks are left for your request.

Guild Members Chunk Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
membersarray[guild member object]Chunked guild members
chunk_indexintegerThe chunk index in the expected chunks for this response (0 <= chunk_index < chunk_count)
chunk_countintegerThe total number of expected chunks for this response
not_found?arrayThe passed IDs that were not found
presences?array[presence object]The presences of the returned members, if requested
nonce?stringThe nonce used in Request Guild Members or Search Recent Members, if any

Guild Role Create

Sent when a guild role is created.

Guild Role Create Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
rolerole objectThe role created

Guild Role Update

Sent when a guild role is updated.

Guild Role Update Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
rolerole objectThe role updated

Guild Role Delete

Sent when a guild role is deleted.

Guild Role Delete Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
role_idsnowflakeThe ID of the role

Guild Scheduled Events

Guild Scheduled Event Create

Sent when a guild scheduled event is created. The inner payload is a guild scheduled event object.

Guild Scheduled Event Update

Sent when a guild scheduled event is updated. The inner payload is a guild scheduled event object.

Guild Scheduled Event Delete

Sent when a guild scheduled event is deleted. The inner payload is a guild scheduled event object.

Guild Scheduled Event User Add

Sent when a user has subscribed to a guild scheduled event.

Guild Scheduled Event User Add Structure
FieldTypeDescription
guild_scheduled_event_idsnowflakeThe ID of the guild scheduled event
user_idsnowflakeThe ID of the subscribed user
guild_idsnowflakeThe ID of the guild

Guild Scheduled Event User Remove

Sent when a user has unsubscribed from a guild scheduled event.

Guild Scheduled Event User Remove Structure
FieldTypeDescription
guild_scheduled_event_idsnowflakeThe ID of the guild scheduled event
user_idsnowflakeThe ID of the subscribed user
guild_idsnowflakeThe ID of the guild

Guild Soundboard

Guild Soundboard Sound Create

Sent when a guild soundboard sound is created. The inner payload is a soundboard sound object.

Guild Soundboard Sound Update

Sent when a guild soundboard sound is updated. The inner payload is a soundboard sound object.

Guild Soundboard Sound Delete

Sent when a guild soundboard sound is deleted.

Guild Soundboard Sound Delete Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
sound_idsnowflakeThe ID of the soundboard sound

Soundboard Sounds

Sent in response to Request Soundboard Sounds.

Soundboard Sounds Event Fields
FieldTypeDescription
guild_idsnowflakeThe ID of the source guild
soundboard_soundsarray[soundboard sound object]Custom guild soundboard sounds

Integrations

Guild Integrations Update

Sent when a guild integration is updated. This is sent in addition to one of the below events.

Guild Integrations Update Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild whose integrations were updated

Integration Create

Sent when an integration is created. The inner payload is an integration object with an additional guild_id key:

Integration Create Structure Extra Fields
FieldTypeDescription
guild_idsnowflakeThe ID of the guild

Integration Update

Sent when an integration is updated. The inner payload is an integration object with an additional guild_id key:

Integration Update Structure Extra Fields
FieldTypeDescription
guild_idsnowflakeThe ID of the guild

Integration Delete

Sent when an integration is deleted.

Integration Delete Structure
FieldTypeDescription
idsnowflakeThe ID of the integration
guild_idsnowflakeThe ID of the guild
application_id?snowflakeThe ID of the integrated OAuth2 application, if any

Invites

Invite Create

Sent when a new invite to a guild channel is created. Requires the MANAGE_CHANNELS permission.

Invite Create Structure
FieldTypeDescription
codestringThe invite code (unique ID)
typeintegerThe type of invite
channel_idsnowflakeThe ID of the channel the invite is for
guild_idsnowflakeThe ID of the guild this invite is for
inviter?partial user objectThe user who created the invite
target_type?integerThe type of target for this guild invite
target_user?partial user objectThe user whose stream to display for this voice channel stream invite
target_application?partial application objectThe embedded application to open for this voice channel embedded application invite
expires_at?ISO8601 timestampThe expiry date of the invite, if it expires
created_atISO8601 timestampWhen this invite was created
usesintegerNumber of times this invite has been used
max_usesintegerMax number of times this invite can be used
max_ageintegerDuration (in seconds) after which the invite expires
temporarybooleanWhether this invite only grants temporary membership

Invite Delete

Sent when a guild invite is deleted. Requires the MANAGE_CHANNELS permission.

Invite Delete Structure
FieldTypeDescription
codestringThe invite code (unique ID)
channel_idsnowflakeThe ID of the channel the invite is for
guild_idsnowflakeThe ID of the guild this invite is for

Messages

Message Object Extra Fields
FieldTypeDescription
guild_id? 1snowflakeThe ID of the guild the message was sent in
member? 1 2partial guild member objectGuild member data for this message's author
mentions 1array[user object]Users specifically mentioned in the message, with an extra member key representing guild member data

1 Ephemeral messages will not include these fields.

2 Messages sent by webhooks will not include this field, as webhooks are not guild members.

Message Create

Sent when a message is created. The inner payload is a message object with the extra structure above.

Message Update

Sent when a message is updated. The inner payload is a message object with the extra structure above.

Message Delete

Sent when a message is deleted.

Message Delete Structure
FieldTypeDescription
idsnowflakeThe ID of the message
channel_idsnowflakeThe ID of the channel
guild_id?snowflakeThe ID of the guild

Message Delete Bulk

Sent when multiple messages are deleted at once.

Message Delete Bulk Structure
FieldTypeDescription
idsarray[snowflake]The IDs of the removed messages
channel_idsnowflakeThe ID of the channel
guild_id?snowflakeThe ID of the guild

Message Poll Vote Add

Sent when a user votes on a poll. If the poll allows multiple selection, one event will be sent per answer.

Message Poll Vote Add Fields
FieldTypeDescription
user_idsnowflakeID of the user
channel_idsnowflakeID of the channel
message_idsnowflakeID of the message
guild_id?snowflakeID of the guild
answer_idintegerID of the answer

Message Poll Vote Remove

Sent when a user removes their vote on a poll. If the poll allows for multiple selections, one event will be sent per answer.

Message Poll Vote Remove Fields
FieldTypeDescription
user_idsnowflakeID of the user
channel_idsnowflakeID of the channel
message_idsnowflakeID of the message
guild_id?snowflakeID of the guild
answer_idintegerID of the answer

Message Reaction Add

Sent when a user adds a reaction to a message.

Message Reaction Add Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user
channel_idsnowflakeThe ID of the channel
message_idsnowflakeThe ID of the message
message_author_idsnowflakeThe ID of the message author
guild_id?snowflakeThe ID of the guild
member?member objectThe member who reacted
emojipartial emoji objectThe emoji used to react
typeintegerThe type of reaction
burst_colors?array[string]The hex-encoded colors to render the burst reaction with

Message Reaction Add Many

Sent when multiple users add reactions to a message in a short period of time.

Message Reaction Add Many Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel
message_idsnowflakeThe ID of the message
guild_id?snowflakeThe ID of the guild
reactionsarray[debounced reaction object]The reactions added to the message

Debounced Reaction Structure

FieldTypeDescription
usersarray[snowflake]The IDs of the users who reacted with this emoji
emojipartial emoji objectThe emoji used to react

Message Reaction Remove

Sent when a user removes a reaction from a message.

Message Reaction Remove Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user
channel_idsnowflakeThe ID of the channel
message_idsnowflakeThe ID of the message
guild_id?snowflakeThe ID of the guild
emojia partial emoji objectThe emoji used to react
typeintegerThe type of reaction

Message Reaction Remove All

Sent when a user explicitly removes all reactions from a message.

Message Reaction Remove All Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel
message_idsnowflakeThe ID of the message
guild_id?snowflakeThe ID of the guild

Message Reaction Remove Emoji

Sent when a user removes all instances of a given emoji from the reactions of a message.

Message Reaction Remove Emoji Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel
message_idsnowflakeThe ID of the message
guild_id?snowflakeThe ID of the guild
emojipartial emoji objectThe emoji that was removed

Recent Mention Delete

Sent when a message that mentioned the current user in the last week is acknowledged and deleted.

Recent Mention Delete Structure
FieldTypeDescription
message_idsnowflakeThe ID of the message

Last Messages

Sent in response to Request Last Messages.

Last Messages Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
messagesarray[message object]Last messages of the requested channels

OAuth2

OAuth2 Token Revoke

Sent when an OAuth2 application is deauthorized.

OAuth2 Token Revoke Structure
FieldTypeDescription
access_tokenstringThe access token that was revoked
application_idsnowflakeThe OAuth2 application whose authorization was revoked

Presence

Presence Update

This event is sent when a user's presence or info, such as name or avatar, is updated. The inner payload is a presence object.

For user accounts, this event is only sent for presences they are subscribed to. Users are automatically subscribed to the overall user presence and every per-guild presence of friends and implicit relationships (depending on the NO_AFFINE_USER_IDS Gateway capability), as well as every per-guild presences of users they have an open DM with.

Relationships

Relationship Add

Sent when a relationship is created, relevant to the current user. Inner payload is a relationship object.

Relationship Add Structure Extra Fields
FieldTypeDescription
should_notify?booleanWhether the client should notify the user of this relationship's creation

Relationship Update

Sent when a relationship is updated, relevant to the current user (e.g. friend nickname changed).

Relationship Update Structure
FieldTypeDescription
idsnowflakeThe ID of the target user
typeintegerThe type of relationship
nicknamestringThe nickname of the user in this relationship (1-32 characters)
is_spam_request? 1booleanWhether the relationship is flagged as spam (default false)

1 Only applicable to relationships of type INCOMING_REQUEST.

Relationship Remove

Sent when a relationship is removed, relevant to the current user.

Relationship Remove Structure
FieldTypeDescription
idsnowflakeThe ID of the target user
typeintegerThe type of relationship
nicknamestringThe nickname of the user in this relationship (1-32 characters)
is_spam_request? 1booleanWhether the relationship is flagged as spam (default false)

1 Only applicable to relationships of type INCOMING_REQUEST.

Stage Instances

Stage Instance Create

Sent when a stage instance is created (i.e. the stage is now "live"). The inner payload is a stage instance object.

Stage Instance Update

Sent when a stage instance is updated. The inner payload is a stage instance object.

Stage Instance Delete

Sent when a stage instance is deleted (i.e. the stage has been closed). The inner payload is a stage instance object.

Typing

Typing Start

Sent when a user starts typing in a channel.

Typing Start Structure
FieldTypeDescription
channel_idsnowflakeid of the channel
guild_id?snowflakeid of the guild
user_idsnowflakeid of the user
timestampintegerunix time (in seconds) of when the user started typing
member?member objectthe member who started typing if this happened in a guild

Current User

User Update

Sent when properties about the current user change. Inner payload is a user object.

User Application Remove

Sent when the current user uninstalls an application.

User Application Remove Structure
FieldTypeDescription
application_idsnowflakeThe ID of the application

User Connections Update

Sent when the current user has their connections updated. Inner payload is either a connection object, or the following object:

User Connections Update Structure
FieldTypeDescription
user_idsnowflakeThe ID of the current user

User Note Update

Sent when a note the current user has on another user is modified.

User Note Update Structure
FieldTypeDescription
idsnowflakeThe ID of the user
notestringThe new note for the user

User Settings Update

Sent when the client settings are modified. Inner payload is a user settings object.

User Required Action Update

Sent when a user must complete a certain action (such as verifying their phone number) before continuing to use Discord.

User Required Action Update Structure
FieldTypeDescription
required_action?stringThe action a user is required to take before continuing to use Discord, null if an action is no longer required

Voice

Voice State Update

Sent when someone joins/leaves/moves voice channels or calls. Inner payload is a voice state object.

Voice Server Update

Sent when a guild or call's voice server is updated. This is sent when initially connecting to voice, and when the current voice instance fails over to a new server.

Voice Server Update Structure
FieldTypeDescription
tokenstringThe voice connection token
guild_id?snowflakeThe guild this voice server update is for
channel_id?snowflakeThe private channel this voice server update is for
endpoint?stringThe voice server host
Example Voice Server Update Payload
{
"token": "my_token",
"guild_id": "41771983423143937",
"endpoint": "smart.loyal.discord.media:443"
}

Voice Channel Effect Send

Sent when someone sends an effect, such as an emoji reaction or a soundboard sound, in a voice channel the current user is connected to.

Voice Channel Effect Send Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel the effect was sent in
guild_idsnowflakeThe ID of the guild the effect was sent in
user_idsnowflakeThe ID of the user who sent the effect
animation_type?integerThe type of emoji animation
animation_idintegerThe ID of the emoji animation (0-20)
emoji?partial emoji objectThe emoji sent, if applicable
sound_id?snowflakeThe ID of the soundboard sound
sound_volume?floatThe volume of the soundboard sound (represented as a float from 0 to 1)
Example Voice Channel Effect Send Payload
{
"guild_id": "839502008108580904",
"animation_id": 0,
"animation_type": 1,
"channel_id": "850360749460553769",
"emoji": {
"animated": false,
"id": null,
"name": "🦆"
},
"sound_id": 1,
"sound_volume": 1,
"user_id": "852892297661906993"
}

Webhooks

Webhooks Update

Sent when a guild channel's webhook is created, updated, or deleted.

Webhooks Update Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
channel_idsnowflakeThe ID of the channel

Interactions

Interaction Create

Sent when a user uses an Application Command or Message Component. Inner payload is an Interaction.

Session Start Limit Object

Session Start Limit Structure
FieldTypeDescription
totalintegerThe total number of session starts the current user is allowed
remainingintegerThe remaining number of session starts the current user is allowed
reset_afterintegerThe number of milliseconds after which the limit resets
max_concurrencyintegerThe number of identify requests allowed per 5 seconds

Endpoints

Get Gateway

GET/gateway

Returns an object with a single valid WebSocket URL, which the client can use for Connecting. Clients should cache this value and only call this endpoint to retrieve a new URL if they are unable to properly establish a connection using the cached version of the URL.

Response Body
FieldTypeDescription
urlstringThe WebSocket URL that can be used for connecting to the Gateway
Example Response
{
"url": "wss://gateway.discord.gg/"
}

Get Gateway Bot

GET/gateway/bot

Returns an object based on the information in Get Gateway, plus additional metadata that can help during the operation of large or sharded bots. Unlike Get Gateway, this route should not be cached for extended periods of time as the value is not guaranteed to be the same per-call, and changes as the user joins/leaves guilds.

JSON Response
FieldTypeDescription
urlstringThe WebSocket URL that can be used for connecting to the Gateway
shardsintegerThe recommended number of shards to use when connecting
session_start_limitsession start limit objectInformation on the current session start limit
Example Response
{
"url": "wss://gateway.discord.gg/",
"shards": 9,
"session_start_limit": {
"total": 1000,
"remaining": 999,
"reset_after": 14400000,
"max_concurrency": 1
}
}