Discord RPC

Discord contains multiple methods of RPC communication to send messages to locally running Discord clients, allowing the remote execution of specific commands to interface with the client. This powers functions you may be familiar with, like clicking an invite link in the browser prompting the locally running Discord client to open with the invite modal.

This page documents the entire RPC protocol. It can be used to help interface with the official Discord client, or as a reference document to implement your own client that supports the RPC protocol.

RPC Protocol Version

The current and only supported version of the RPC protocol is 1.

RPC Transports

RPC supports four different transports:

TypeNameDescription
wsWebSocketPrimarily meant for communicating with the client from the web, limited to trusted partners
httpHTTPMeant for one-off commands that do not require a long-lived connection
ipcIPCMeant for communicating with the client from local applications, like games or other software running on a user's machine
post_messagePostMessageUsed by embedded activities to communicate with the client from within an iFrame

RPC Scopes

Architecturally, RPC uses the same scopes as OAuth2. The following pseudoscopes below are inherent to the protocol itself, and do not exist as real scopes in the API.

ValueDescription
rpc.authenticatedGranted after successfully completing the authentication handshake with the RPC server
rpc.localGranted to any connection to an RPC transport outside of a browser context (i.e. no Origin header)
rpc.privateGranted to WebSocket or HTTP transports from a Discord-controlled Origin (i.e. https://discord.com, https://discordapp.com, or one of their subdomains)
rpc.private.limitedGranted alongside rpc.private, as well as to HTTP transports utilizing a GET method
rpc.embedded_appGranted to any connection to a PostMessage transport

RPC Close Codes

Close codes will either be received as a WebSocket close frame or a protocol-level CLOSE opcode. They will be accompanied by a human-friendly message describing the reason for the close.

CodeName
1000CLOSE_NORMAL
1003CLOSE_UNSUPPORTED
1006CLOSE_ABNORMAL
4000INVALID_CLIENTID
4001INVALID_ORIGIN
4002RATELIMITED
4003TOKEN_REVOKED
4004INVALID_VERSION
4005INVALID_ENCODING

RPC Errors

Errors will be dispatched as a ERROR event in response to an outgoing command. They will be accompanied by a human-friendly message describing the error.

CodeName
1000UNKNOWN_ERROR
1001SERVICE_UNAVAILABLE
1002TRANSACTION_ABORTED
4000INVALID_PAYLOAD
4002INVALID_COMMAND
4003INVALID_GUILD
4004INVALID_EVENT
4005INVALID_CHANNEL
4006INVALID_PERMISSIONS
4007INVALID_CLIENTID
4008INVALID_ORIGIN
4009INVALID_TOKEN
4010INVALID_USER
4011INVALID_INVITE
4012INVALID_ACTIVITY_JOIN_REQUEST
4013INVALID_LOBBY
4014INVALID_LOBBY_SECRET
4015INVALID_ENTITLEMENT
4016INVALID_GIFT_CODE
4017INVALID_GUILD_TEMPLATE
4018INVALID_SOUND
4019INVALID_PROVIDER
4020INVALID_CONNECTION_CALLBACK_STATE
4021BAD_REQUEST_FOR_PROVIDER
5000OAUTH2_ERROR
5001SELECT_CHANNEL_TIMED_OUT
5002GET_GUILD_TIMED_OUT
5003SELECT_VOICE_FORCE_REQUIRED
5004CAPTURE_SHORTCUT_ALREADY_LISTENING
5005INVALID_ACTIVITY_SECRET
5006NO_ELIGIBLE_ACTIVITY
5007LOBBY_FULL
5008PURCHASE_CANCELED
5009PURCHASE_ERROR
5010UNAUTHORIZED_FOR_ACHIEVEMENT
5011RATE_LIMITED
5012UNAUTHORIZED_FOR_APPLICATION
5013NO_CONNECTION_FOUND
Example RPC Error
{
"code": 4000,
"message": "Invalid Client ID"
}

Rate Limits

The Discord RPC server has a per-client rate limit of 2 connections per minute. This rate limit is raised to 60 connections per minute on Canary clients, as well as clients connecting over the PostMessage transport. Connections exceeding this limit will have a delay before processing.

WebSocket Transport

All Discord clients have an RPC server running that allows control over local Discord clients. The local RPC server runs on localhost (127.0.0.1) and is set up to process WebSocket connections and proxy API requests.

Connecting

For WebSocket connections, the connection is always in the form of ws://127.0.0.1:PORT/. discordapp.io may also be used as it always resolves to localhost.

The port range for Discord's local RPC server is [6463, 6472]. Since the RPC server runs locally, there's a chance it might not be able to obtain its preferred port when it tries to bind to one. For this reason, the local RPC server will pick one port out of a range of these 10 ports, trying sequentially until it can bind to one. For multiple clients (e.g. Stable and Canary), you might want to add a feature to manually select the port so you can more easily debug.

The below query string parameters should be appended to the connection URL.

Query String Params
FieldTypeDescription
vintegerThe version of the RPC protocol to use
client_id? 1stringThe ID of the application connecting to the socket
encoding? 2stringThe encoding for packets sent to the client (either json or etf, default json)

1 Can only be omitted when connecting from a Discord-controlled Origin.

2 ETF encoding may not be supported by all clients. If ETF encoding is requested, outgoing packets must also be sent in the ETF format.

Sending and Receiving Packets

Packets are sent as JSON objects containing the command you want to send to the Discord client. Incoming packets will need to be correctly parsed to obtain the JSON response.

Authentication

Upon connection, the RPC server will validate your provided client_id. If the connection is from a non-Discord-controlled Origin and the client_id is missing, the server will immediately disconnect. Otherwise, the server will attempt to fetch the client application using the Get RPC Application endpoint. If the application is not found, or the Origin header of the connection does not match one of the application's rpc_origins values, the server will disconnect. Only if the application is found and the Origin header matches an rpc_origins value will the connection will be accepted.

Upon a successful connection, the server will send a READY event containing some basic user information and configuration data. At this point, you can send an AUTHORIZE command to obtain an OAuth2 code, which can then be exchanged for an access token.

Usage

When connecting from a browser, the WebSocket transport can only be used by Discord itself and a select few trusted partners, as the WebSocket transport allows controlling the client without having software installed on the user's machine.

For example, upon certain events, like clicking an invite link from a browser, Discord will open a WebSocket connection to the local RPC server, sending the INVITE_BROWSER command:

Example Invite Browser Payload
{
"cmd": "INVITE_BROWSER",
"args": {
"code": "fortnite"
},
"nonce": "5c283c7d-524a-4090-b04b-ea0fb023e44c"
}
Example Invite Browser Response

The local client will receive and use the information from this response to display the invite modal, and respond with:

{
"cmd": "INVITE_BROWSER",
"data": {
"invite": {
"type": 0,
"code": "fortnite",
"expires_at": null
// ...
},
"code": "fortnite"
},
"evt": null,
"nonce": "5c283c7d-524a-4090-b04b-ea0fb023e44c"
}

HTTP Transport

The HTTP transport is a subset of the WebSocket transport meant for one-off commands that do not require a long-lived connection.

Connecting

The HTTP transport is available on the same port range as the WebSocket transport. The connection URL is in the form of http://127.0.0.1:PORT/rpc.

The below query string parameters still apply.

Query String Params
FieldTypeDescription
vintegerThe version of the RPC protocol to use
client_id? 1stringThe ID of the application connecting to the socket

1 Can only be omitted when connecting from a Discord-controlled Origin.

Sending and Receiving Packets

Clients should send a POST request to the connection URL with a JSON body containing the command you want to send. The server will respond with a JSON object containing the response of the command.

An even more limited transport is available via a GET request, where authentication is entirely bypassed, and client_id can be omitted. However, this only grants the rpc.private.limited scope, which only allows a select few commands that don't require authenticated scopes. For this transport, a JSON-encoded payload query string parameter should be sent alongside the request, containing the same JSON object as the body of a POST request. A callback query string parameter may also be sent, to specify where the response should redirect to. If the callback is not provided, or does not match the server's origin, the server will use the default marketing URL instead. This is intended for internal use by Discord's web client, and should not be used by third parties.

Authentication

The authentication process for the HTTP transport is the same as the WebSocket transport, with one crucial difference: if no Origin header is present, the rpc_origins check will be bypassed and the connection will be accepted as long as the client_id is valid. This allows this transport to be used by anyone outside of a browser context.

However, as the HTTP transport can only be used for one-off commands, you will be unable to complete the typical RPC handshake. This limits the use of this transport to only commands that don't require authenticated scopes.

IPC Transport

Similarly, all Discord clients also have an IPC server running that allows control over local Discord clients. By sending packets through the Discord RPC IPC pipe, you can programmatically control your local Discord client, like joining voice channels, retrieving guild or user information, and more.

Connecting

Discord can be on any pipe ranging from discord-ipc-0 to discord-ipc-9. It is a good idea to try and connect to each one and keeping the first one you successfully connect to. For multiple clients (e.g. Stable and Canary), you might want to add a feature to manually select the pipe so you can more easily debug.

On Windows, the Discord IPC pipe format is \\\\?\\pipe\\discord-ipc-0. On macOS & Linux, it'll be kept in the folder indicated by the XDG_RUNTIME_DIR, TMPDIR, TMP or TEMP envvars. If none of those exist, use /tmp/.

Sending and Receiving Packets

The IPC protocol has an additional of abstraction over the typical JSON payloads used in the WebSocket transport.

Packets are sent as binary data in a simple format composed of an 8-byte header and payload. The header consists of two 32-bit unsigned integers (little endian) representing the opcode and payload length.

IPC Opcodes
ValueNameDescription
0HANDSHAKEHandshake to be sent immediately after connecting
1FRAMETypical payload for communication with the client
2CLOSESent when the Discord client is asking you to leave, or you want to gracefully disconnect
3PINGIf the Discord client sends this to you, you should reply with a PONG of the same data
4PONGReply to a PING
Packet Structure
FieldTypeDescriptionSize
OpcodeUnsigned integer (little endian)Unsigned integer opcode value4 bytes
LengthUnsigned integer (little endian)Length of the payload4 bytes
PayloadBinary dataFormat defined by opcodeVariable bytes
Example Packet
00000000 28000000 7B2276223A312C22 (trimmed)
^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^
OPCODE 0 Length Payload
HANDSHAKE 40 bytes { "v" : 1, "

Authentication

After connecting to the IPC socket, you should immediately send a handshake packet to the server. The server will respond with a FRAME packet containing the READY event with some basic user information and configuration data. Upon successful reception of this event, you can send an AUTHORIZE command to obtain an OAuth2 code, which can then be exchanged for an access token. Once authenticated, you can call RPC commands on behalf of the user!

Handshake Structure
FieldTypeDescription
vintegerThe version of the RPC protocol to use
client_idstringThe ID of the application connecting to the socket
Close Structure
FieldTypeDescription
codeintegerThe close code
messagestringA human-readable message explaining the closure reason

PostMessage Transport

The PostMessage transport is meant for embedded activities to communicate with the client from within an iFrame.

Connecting

The PostMessage transport does not require an actual connection, as messages will be sent to the parent window using window.postMessage.

Sending and Receiving Packets

The PostMessage transport uses a similar abstraction layer to the IPC transport.

Packets are sent as an array of two elements, the first being the integer opcode, and the second being the payload object. Opcodes follow the same values as the IPC transport.

Authentication

Similarly to IPC, you should immediately send a handshake message to the parent window after the iFrame loads. Then, the client will validate that the message is coming from a valid embedded activities origin, typically https://<client_id>.discordsays.com.

The parent window will respond with a READY event containing some basic user information and configuration data. Upon successful reception of this event, you can send an AUTHORIZE command to obtain an OAuth2 code, which can then be exchanged for an access token. Once authenticated, you can call RPC commands on behalf of the user!

Handshake Structure
FieldTypeDescription
vintegerThe version of the RPC protocol to use
client_idstringThe ID of the application connecting to the socket
frame_idstringThe ID of the current iFrame, provided in the query string of the iFrame's URL
sdk_version?stringThe version of the embedded activities SDK being used

Packet Payloads

Packet payloads are JSON objects containing the command you want to send to the Discord client. Incoming packets will need to be correctly parsed to obtain the JSON response.

Outgoing Payload Structure
FieldTypeDescription
cmdstringThe command indicating the action of the request
argsobjectThe arguments coinciding with the command of the request
noncestringA unique identifier given to a command that will be echoed back to you upon a successful send
evt? 1stringThe event the app is subscribing to

1 Only required when cmd is SUBSCRIBE or UNSUBSCRIBE.

Incoming Payload Structure
FieldTypeDescription
cmdstringThe echoed command indicating the action of the response
data?objectThe response data of the command
nonce?stringThe unique identifier of the requested command
evt 1?stringThe event coinciding with the incoming command

1 Only present in DISPATCH, SUBSCRIBE, and UNSUBSCRIBE events.

RPC User Object

See the user resource for more information.

RPC User Structure
FieldTypeDescription
idsnowflakeThe ID of the user
usernamestringThe user's username, may be unique across the platform
discriminatorstringThe user's stringified 4-digit Discord tag
global_name?stringThe user's display name
avatar?stringThe user's avatar hash
avatar_decoration_data?avatar decoration data objectThe user's avatar decoration
botbooleanWhether the user is a bot account
flagsintegerThe public flags on a user's account
premium_typeintegerThe type of premium (Nitro) subscription on a user's account

RPC Guild Object

See the guild resource for more information.

RPC Guild Structure
FieldTypeDescription
idsnowflakeThe ID of the guild
namestringThe name of the guild
icon_url?stringThe guild's icon URL
vanity_url_code 1?stringThe guild's vanity invite code

1 Only available in Get Guild response.

RPC Guild Member Object

See the guild resource for more information.

RPC Guild Member Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user this guild member represents
nick?stringThe guild-specific nickname of the member
guild_idsnowflakeThe ID of the guild the user is in
avatar?stringThe member's guild avatar hash
avatar_decoration_data?avatar decoration data objectThe member's guild avatar decoration
banner??stringThe member's guild banner hash
bio??stringThe member's guild-specific bio
pronouns??stringThe member's guild-specific pronouns
color_string??stringThe hex-encoded color of the member's name
Partial RPC Guild Member Structure
FieldTypeDescription
userRPC user objectThe user this guild member represents
nick?stringThe guild-specific nickname of the member
statusstringThe status of the user
activity?activity objectThe current activity the user is partaking in

RPC Channel Object

See the channel resource for more information.

RPC Channel Structure
FieldTypeDescription
idsnowflakeThe ID of the channel
namestringThe name of the channel
typeintegerThe type of channel
topicstringThe channel topic
bitrateintegerThe bitrate (in bits) of the voice channel
user_limitintegerThe user limit of the voice channel (0 refers to no limit)
guild_id?snowflakeThe ID of the guild the channel is in
positionintegerSorting position of the channel
messages 1array[RPC message object]The last 50 messages within the channel in ascending order
voice_statesarray[RPC voice state object]States of members currently in the voice channel

1 Only included if the channel or guild's application_id matches the client_id of the connection, or the authorization has the messages.read scope.

Partial RPC Channel Structure
FieldTypeDescription
idsnowflakeThe ID of the channel
namestringThe name of the channel
typeintegerThe type of channel

RPC Message Object

See the message resource for more information.

RPC Message Structure
FieldTypeDescription
idsnowflakeThe ID of the message
blocked?booleanWhether the author of the message is blocked by the current user
bot?booleanWhether the author of the message is a bot account
contentstringContents of the message
content_parsed?array[object]Parsed contents of the message
nick?stringThe displayed nick of the author
author_color?stringThe hex-encoded color of the message author's name
edited_timestamp?ISO8601 timestampWhen this message was last edited
timestampISO8601 timestampWhen this message was sent
ttsbooleanWhether this message will be read out by TTS
mentionsarray[RPC user object]Users specifically mentioned in this message
mention_everyonebooleanWhether this message mentions everyone
mention_rolesarray[snowflake]Roles specifically mentioned in this message
embedsarray[embed object]Content embedded in the message
attachmentsarray[attachment object]The attached files
author??RPC user objectThe author of the message
pinnedbooleanWhether this message is pinned
typeintegerThe type of message

RPC Voice State Object

RPC Voice State Structure
FieldTypeDescription
nickstringThe displayed nick of the user
mutebooleanWhether the user is muted locally
volumefloatThe local volume of the user
panpan objectThe pan of the user
voice_stateRPC remote voice state objectThe internal voice state
userRPC userThe user this voice state is for
RPC Remote Voice State Structure
FieldTypeDescription
mutebooleanWhether this user is muted by the guild, if any
deafbooleanWhether this user is deafened by the guild, if any
self_mutebooleanWhether this user is locally muted
self_deafbooleanWhether this user is locally deafened
suppressbooleanWhether this user's permission to speak is denied
Pan Structure
FieldTypeDescription
leftfloatLeft pan of user (0-1)
rightfloatRight pan of user (0-1)

RPC Relationship Object

RPC Relationship Structure
FieldTypeDescription
typeintegerThe type of relationship
userRPC user objectThe target user
presenceRPC relationship presence objectThe presence of the target user
RPC Relationship Presence Structure
FieldTypeDescription
statusstringThe status of the user
activity?activity objectThe user's activity associated with the current application

RPC Voice Settings Object

RPC Voice Settings Structure
FieldTypeDescription
inputRPC voice IO settings objectThe input settings
outputRPC voice IO settings objectThe output settings
modeRPC voice settings mode objectThe voice mode settings
automatic_gain_controlbooleanWhether automatic gain control is enabled
echo_cancellationbooleanWhether echo cancellation is enabled
noise_suppressionbooleanWhether background noise is being suppressed
qosbooleanWhether voice Quality of Service is enabled
silence_warningbooleanWhether the input warning notice is disabled
deafbooleanWhether the user is locally deafened
mutebooleanWhether the user is locally muted
RPC Voice IO Settings Structure
FieldTypeDescription
available_devices 1array[available device object]The available devices
device_idstringThe ID of the primary device
volumefloatThe input voice level (max 200)
Available Device Structure
FieldTypeDescription
idstringThe ID of the device
namestringThe name of the device
RPC Voice Settings Mode Structure
FieldTypeDescription
typestringThe type of voice settings mode
auto_thresholdbooleanWhether the voice activity threshold is automatically set
thresholdintegerThe threshold (in dB) for voice activity (-100-0)
shortcutarray[shortcut key combo object]The shortcut key combos for PTT
delayintegerThe PTT release delay in milliseconds (max 2000)
RPC Voice Settings Mode Type
ValueDescription
PUSH_TO_TALKPush To Talk
VOICE_ACTIVITYVoice activity
Shortcut Key Combo Structure
FieldTypeDescription
typeintegerThe type of shortcut key combo
codeintegerThe code of the shortcut key combo
name? 1stringThe name of the shortcut key combo

1 This field is always present when received.

Shortcut Key Combo Type
ValueNameDescription
0KEYBOARD_KEYKeyboard key
1MOUSE_BUTTONMouse button
2KEYBOARD_MODIFIER_KEYKeyboard modifier key
3GAMEPAD_BUTTONGamepad button

RPC Guild Template Object

RPC Guild Template Structure
FieldTypeDescription
codestringThe code of the template (unique ID)
statestringThe state of the guild template
namestringThe name of the template (1-100 characters)
descriptionstringThe description for the template (max 120 characters)
creatorIdsnowflakeThe ID of the user who created the template
creatorpartial user objectThe user who created the template
createdAtISO8601 timestampWhen this template was created
updatedAtISO8601 timestampWhen this template was last synced to the source guild
sourceGuildIdsnowflakeThe ID of the guild this template is based on
serializedSourceGuild 1partial guild objectThe guild snapshot this template contains
usageCountintegerNumber of times this template has been used
isDirty?booleanWhether the template has unsynced changes

1 This partial guild object is special in that it and the objects within always contain applicable optional fields (even if they're not applicable). This leads to unexpected behavior, such as available_tags being serialized for voice channels. Additionally, the main guild object is missing the id field, and all other id fields are not real snowflakes.

RPC Guild Template State
ValueDescription
RESOLVINGThe guild template is being resolved
RESOLVEDThe guild template is resolved
EXPIREDThe guild template is expired
ACCEPTEDThe guild template is accepted
ACCEPTINGThe guild template is being accepted

Certified Device Object

Certified Device Structure
FieldTypeDescription
typestringThe type of certified device
idstringThe ID of the certified device
vendorcertified device vendor objectThe vendor of the certified device
modelcertified device model objectThe model of the certified device
related?array[string]The IDs of other devices related to this device (min 1)
echo_cancellation? 1booleanWhether the device's native echo cancellation is enabled
noise_suppression? 1booleanWhether the device's native noise suppression is enabled
automatic_gain_control? 1booleanWhether the device's automatic gain control is enabled
hardware_mute? 1booleanWhether the device is muted hardware-wise

1 Only applicable if the type is audioinput.

Certified Device Type
ValueDescription
audioinputMicrophone
audiooutputSpeaker
videoinputCamera
Certified Device Vendor Structure
FieldTypeDescription
idstringThe ID of the device vendor
namestringThe name of the device vendor
Certified Device Model Structure
FieldTypeDescription
idstringThe ID of the device model
namestringThe name of the device model

RPC Activity Participant Object

RPC Activity Participant Object

This structure is a superset of the RPC user object with the following additional fields:

FieldTypeDescription
nickname?stringThe guild-specific nickname of the member (1-32 characters)
Orientation State
ValueNameDescription
1UNLOCKEDThe orientation is unlocked
2PORTRAITThe orientation is in portrait
3LANDSCAPEThe orientation is in landscape

RPC Commands

Commands are the means in which an application can interface with the client.

NameDescriptionScopes
DISPATCHEvent dispatch
AUTHORIZEUsed to authorize a new client with your application
AUTHENTICATEUsed to authenticate an existing client with your application
SUBSCRIBEUsed to subscribe to an RPC event
UNSUBSCRIBEUsed to unsubscribe from an RPC event
GET_GUILDUsed to retrieve guild information from the clientrpc
GET_GUILDSUsed to retrieve a list of guilds from the clientrpc
GET_CHANNEL 1Used to retrieve channel information from the clientrpc, guilds, or guilds.channels.read
GET_CHANNELSUsed to retrieve a list of channels for a guild from the clientrpc
GET_CHANNEL_PERMISSIONSUsed to retrieve the permission settings for the currently connected voice channelguilds.members.read or guilds.channels.read
CREATE_CHANNEL_INVITEUsed to create an invite link for a given channelrpc
GET_RELATIONSHIPSUsed to retrieve the list of relationships with their presencesrelationships.read
GET_USERUsed to retrieve information about a specific userrpc.local or rpc.embedded_app
SET_USER_VOICE_SETTINGSUsed to change voice settings of users in voice channelsrpc or rpc.voice.write
SET_USER_VOICE_SETTINGS_2Used to change basic voice settings of users in voice channelsrpc.local
PUSH_TO_TALKUsed to enable or disable push-to-talk functionalityrpc and rpc.voice.write
SELECT_VOICE_CHANNELUsed to join or leave a voice channel or private callrpc
GET_SELECTED_VOICE_CHANNELUsed to get the current voice channel the client is inrpc or rpc.voice.read
SELECT_TEXT_CHANNELUsed to select a messageable channelrpc
GET_VOICE_SETTINGSUsed to retrieve the client's voice settingsrpc or rpc.voice.read
SET_VOICE_SETTINGSUsed to set the client's voice settingsrpc or rpc.voice.write
SET_VOICE_SETTINGS_2Used to set the client's basic voice settingsrpc.local
SET_ACTIVITY 2Used to update a user's rich presencerpc, rpc.activities.write, or rpc.local
SEND_ACTIVITY_JOIN_INVITEUsed to send an invite to another user to an activityrpc or rpc.local
CLOSE_ACTIVITY_JOIN_REQUESTUsed to reject a rich presence Ask to Join requestrpc or rpc.local
ACTIVITY_INVITE_USERUsed to send an invite to another user for an activityrpc or rpc.local
ACCEPT_ACTIVITY_INVITEUsed to accept an activity inviterpc or rpc.local
OPEN_INVITE_DIALOGUsed to open the invite modalrpc, rpc.local, or rpc.authenticated
OPEN_SHARE_MOMENT_DIALOGUsed to share an image from an embedded activity in recent DMs or channelsrpc.authenticated
SHARE_INTERASHARE_LINKCTIONUsed to present a modal to user asking where a pre-defined slash command should be ranrpc.authenticated or rpc.local
INITIATE_IMAGE_UPLOADUsed to open a file dialog and retrieve a user-provided imagerpc, rpc.local, or rpc.authenticated
SHARE_LINKUsed to open the share message modal, where a user can pick a channel to send a developer-defined message torpc.authenticated
DEEP_LINKUsed to navigates to a route in the Discord clientrpc.local or rpc.private
CONNECTIONS_CALLBACKCallback for connections authorization, part of connections flow v2rpc.private
BILLING_POPUP_BRIDGE_CALLBACKCallback for payment methods like PaySafeCard, Klarna, Przelewy24, etcrpc.private
GIFT_CODE_BROWSERUsed to open a given gift code link in the clientrpc.private
GUILD_TEMPLATE_BROWSERUsed to open a given template link in the clientrpc.private
OPEN_MESSAGEUsed to open a specific message or DM in the clientrpc.local
OVERLAYUsed by the game overlay to communicate back to the clientrpc.private
BROWSER_HANDOFFUsed to signal the end of browser handoffrpc.private.limited
SET_CERTIFIED_DEVICESUsed to send info about certified hardware devicesrpc or rpc.local
GET_IMAGEUsed to retrieve a user's profile picturerpc.local
SET_OVERLAY_LOCKEDUsed to set whether the process overlay input is lockedrpc.local
OPEN_OVERLAY_ACTIVITY_INVITEUsed to open the activity invite modal in the process overlayrpc.local
OPEN_OVERLAY_GUILD_INVITEUsed to open an invite modal in the process overlayrpc.local
OPEN_OVERLAY_VOICE_SETTINGSUsed to open a voice settings modal in the process overlayrpc.local
VALIDATE_APPLICATIONUsed to validate the application entitlementrpc.local
GET_ENTITLEMENT_TICKETUsed to retrieve an entitlement ticketrpc.local
GET_APPLICATION_TICKETUsed to retrieve an application ticketrpc.local
START_PURCHASEUsed to retrieve the purchase flow for a specific SKUrpc.authenticated or rpc.local
START_PREMIUM_PURCHASEUsed to initiate a premium subscription purchaserpc.authenticated or rpc.local
GET_SKUSUsed to retrieve a list of purchasable SKUsrpc.authenticated or rpc.local
GET_ENTITLEMENTSUsed to retrieve a list of entitlements for the current userrpc.authenticated or rpc.local
GET_SKUS_EMBEDDEDUsed to retrieve a list of purchasable SKUs in an embedded contextrpc.authenticated or rpc.local
GET_ENTITLEMENTS_EMBEDDEDUsed to retrieve a list of entitlements for the current user in an embedded contextrpc.authenticated or rpc.local
GET_NETWORKING_CONFIG (deprecated)Used by the GameSDK to retrieve a proxy address and networking tokenrpc.local
NETWORKING_SYSTEM_METRICS (deprecated)Used by the GameSDK to send networking system metricsrpc.local
NETWORKING_PEER_METRICS (deprecated)Used by the GameSDK to send networking peer metricsrpc.local
NETWORKING_CREATE_TOKEN (deprecated)Used by the GameSDK to retrieve a networking tokenrpc.local
USER_SETTINGS_GET_LOCALEUsed to retrieve the client’s localeidentify
SEND_ANALYTICS_EVENTUsed to send an embedded activity analytics event to Discord
OPEN_EXTERNAL_LINKUsed to prompt to open a given URL in the default web browserrpc.authenticated or rpc.embedded_app
CAPTURE_LOGUsed to capture logs into the Discord client devtools
ENCOURAGE_HW_ACCELERATIONUsed to open a modal dialog encouraging hardware acceleration
SET_ORIENTATION_LOCK_STATEUsed to set options for orientation and picture-in-picture (PiP) modes
GET_PLATFORM_BEHAVIORSUsed to retrieve platform-specific behaviors
GET_SOUNDBOARD_SOUNDSUsed to retrieve available soundboard soundsrpc or rpc.local
PLAY_SOUNDBOARD_SOUNDUsed to play a soundboard soundrpc and rpc.voice.write
TOGGLE_VIDEOUsed to toggle video in a callrpc and rpc.video.write
TOGGLE_SCREENSHAREUsed to toggle screensharingrpc and rpc.screenshare.write
GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTSUsed to retrieve users connected to a specific activity sessionrpc.authenticated
GET_PROVIDER_ACCESS_TOKENUsed by the Amazon Music activity to authorize the connection and retrieve the access tokenrpc.authenticated
MAYBE_GET_PROVIDER_ACCESS_TOKENUsed by the Amazon Music activity to attempt to get the access token from existing connectionrpc.authenticated
NAVIGATE_TO_CONNECTIONSUsed to open the connections page in settingsrpc.authenticated
INVITE_USER_EMBEDDEDUsed to invite a user to the current embedded activityrelationships.read
INVITE_BROWSERUsed to open an invite modal in the clientrpc.private
REQUEST_PROXY_TICKET_REFRESHUsed to refresh proxy ticketsrpc.authenticated
GET_QUEST_ENROLLMENT_STATUSUsed to retrieve the enrollment status for a questidentify
QUEST_START_TIMERUsed to start the timer for a questidentify

1 If retrieving a private channel, also requires the rpc or dm_channels.read scope.

2 Not available from http transport.

Authorize

Used to authorize the current client with your application.

Authorize Arguments Structure
FieldTypeDescription
client_idsnowflakeThe ID of the application
response_type? 1stringThe type of response to return (must be code)
redirect_uri? 2 3stringThe URL to redirect to after authorization; must match one of the registered redirect URIs for the application
scopes?array[string]A list of scopes to request; may be omitted if the application has a populated integration_types_config
code_challenge?stringA code challenge for the PKCE extension to the authorization code grant; must be used with code_challenge_method
code_challenge_method?stringThe method used to generate the code challenge (must be S256); only applicable for the PKCE extension to the authorization code grant
state?stringA unique string to bind the user's request to their authenticated state
nonce?stringA unique string to bind the user's request to their authenticated state; only applicable for authorization code grants with the openid scope
permissions? 1stringThe permissions you're requesting; only applicable when scope contains bot
guild_id?snowflakeThe ID of a guild to pre-fill the dropdown picker with; only applicable when scope contains bot, applications.commands, or webhook.incoming and integration_type is GUILD_INSTALL
channel_id?snowflakeThe ID of a channel to pre-fill the dropdown picker with; only applicable when scope contains webhook.incoming
prompt?stringThe prompt behavior to use for the authorization flow (default consent)
disable_guild_select?booleanDisallows the user from changing the guild dropdown; only applicable when scope contains bot or applications.commands, or webhook.incoming and integration_type is GUILD_INSTALL (default false)
integration_type?integerThe installation context for the authorization; only applicable when scope contains applications.commands (default GUILD_INSTALL)
pid?integerThe ID of the process to overlay the OAuth2 flow in

1 Required unless the basic bot authorization flow is used.

2 If a response_type is specified and no redirect_uri is specified, the user will be redirected to the first registered redirect URI for the application.

3 Only applicable if using the ws transport.

Authorize Response Structure
FieldTypeDescription
codestringThe authorization code to exchange for a token

Authenticate

Used to authenticate an existing client with your app.

Authenticate Arguments Structure
FieldTypeDescription
access_tokenstringThe access token
Authenticate Response Structure

This structure is a superset of the Get Current Authorization Information response with the following additional fields:

FieldTypeDescription
access_tokenstringThe access token

Subscribe

Used to subscribe to an RPC event. Accepts event subscription arguments. The outer evt field is used as the event name to subscribe to.

Subscribe Response Structure
FieldTypeDescription
evtstringThe event name

Unsubscribe

Used to unsubscribe from an RPC event. Accepts event subscription arguments. The outer evt field is used as the event name to unsubscribe from.

Unsubscribe Response Structure
FieldTypeDescription
evtstringThe event name

Get Guild

Used to retrieve guild information from the client. Responds with an RPC guild object.

Get Guild Arguments Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
timeoutintegerRequest timeout in seconds (max 60)

Get Guilds

Used to retrieve a list of guilds from the client. Responds with a list of RPC guild objects.

Get Channel

Used to retrieve channel information from the client. Responds with an RPC channel object.

Get Channel Arguments Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel

Get Channels

Used to retrieve a list of channels for a guild from the client.

Get Channels Arguments Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
Get Channels Response Structure
FieldTypeDescription
channelsarray[partial RPC channel object]Channels in the guild

Get Channel Permissions

Used to retrieve the permission settings for the currently connected voice channel.

Get Channel Permissions Response Structure
FieldTypeDescription
permissionsstringComputed permissions for the current user in the connected channel, including overwrites

Create Channel Invite

Used to create an invite link for a given channel. Responds with a invite object (with invite metadata).

Create Channel Invite Arguments Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel to create invite for

Get Relationships

Used to retrieve the friend list and relationship statuses.

Get Relationships Response Structure
FieldTypeDescription
relationshipsarray[RPC relationship object]The relationships

Get User

Used to retrieve information about a specific user. Responds with an RPC user object or null.

Set User Voice Settings

Used to change voice settings of users in a voice channel. Responds with the resolved settings.

Set User Voice Settings Arguments Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user
pan?pan objectThe pan of the user
volume?integerThe volume percentage (0-200)
mute?booleanWhether the user is muted

Set User Voice Settings 2

Used to change voice settings of users in a voice channel. Responds with null.

Set User Voice Settings Arguments Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user
volume?integerThe volume percentage (0-200)
mute?booleanWhether the user is muted

Push To Talk

Used to enable or disable push-to-talk functionality. Responds with null.

Push To Talk Arguments Structure
FieldTypeDescription
activebooleanWhether Push To Talk functionality should be active

Select Voice Channel

Used to join or leave a voice channel, group DM, or DM. Responds with an RPC channel object or null.

Select Voice Channel Arguments Structure
FieldTypeDescription
channel_id?snowflakeThe ID of the voice channel to connect to (null to disconnect)
timeout?integerRequest timeout in seconds (max 60)
force?booleanWhether to forcefully connect to voice channel (default false)
navigate?booleanWhether to navigate to the voice channel (deafult false)

Get Selected Voice Channel

Used to get the current voice channel the client is in. Responds with an RPC channel object or null.

Select Text Channel

Used to join or leave a text channel, group DM, or DM. Responds with an RPC channel object or null.

Select Text Channel Arguments Structure
FieldTypeDescription
channel_id?snowflakeThe ID of the text channel to navigate to (null to navigate to the "Friends" page)
timeout?integerRequest timeout in seconds (max 60)

Get Voice Settings

Used to retrieve the client's voice settings. Responds with an RPC voice settings object.

Set Voice Settings

Used to set the client's voice settings. Responds with an RPC voice settings object.

Set Voice Settings Arguments Structure
FieldTypeDescription
input?RPC voice IO settings objectThe input settings
output?RPC voice IO settings objectThe output settings
mode?RPC voice settings mode objectThe voice mode settings
automatic_gain_control?booleanWhether automatic gain control is enabled
echo_cancellation?booleanWhether echo cancellation is enabled
noise_suppression?booleanWhether the background noise suppression is enabled
qos?booleanWhether voice Quality of Service is enabled
silence_warning?booleanWhether the silence warning notice is displayed
deaf?booleanWhether the user is locally deafened
mute?booleanWhether the user is locally muted
Partial RPC Voice Settings Mode Structure
FieldTypeDescription
type?stringThe type of voice settings mode
auto_threshold?booleanWhether the voice activity threshold is automatically set
threshold?integerThe threshold (in dB) for voice activity (-100-0)
shortcut?array[partial shortcut key combo object]The shortcut key combos for PTT
delay?integerThe PTT release delay in milliseconds (max 2000)

Set Voice Settings 2

Used to set the client's voice settings. Responds with null.

Set Voice Settings 2 Arguments Structure
FieldTypeDescription
input_mode?RPC voice input mode objectThe input mode
self_mute?booleanWhether the user is locally muted
self_deaf?booleanWhether the user is locally deafened
RPC Voice Input Mode Structure
FieldTypeDescription
typestringThe type of voice settings mode
shortcutstringThe shortcut key combos for PTT

Set Activity

Used to update a user's rich presence. Responds with an activity object.

Set Activity Arguments Structure
FieldTypeDescription
pid? 1integerThe ID of the OS process that is sending the presence update request
activity?RPC activity objectThe activity to set

1 Only required for the ipc transport.

RPC Activity Structure
FieldTypeDescription
namestringThe name of the activity (1-128 characters)
state??stringThe user's current party status (2-128 characters)
state_url??stringURL that is opened when clicking on the state text (max 256 characters)
details??stringWhat the user is currently doing (2-128 characters)
details_url??stringURL that is opened when clicking on the details text (max 256 characters)
timestamps?activity timestamps objectUnix timestamps (in milliseconds) for start and/or end of the game
assets?activity assets objectImages for the presence and their hover texts
party?RPC activity party objectInformation for the current party of the user
secrets?activity secrets objectSecrets for rich presence joining and spectating
buttons?array[RPC activity button object]Custom buttons shown in rich presence (1-2)
instance?booleanWhether the activity is an instanced game session (a match that will end)
supported_platforms?array[string]The platforms the activity is supported on (max 10)
typeintegerThe activity type (except STREAMING, CUSTOM, and HANG)
status_display_type??integerWhich field is displayed in the user's status text in the member list
RPC Activity Party Structure
FieldTypeDescription
id?stringThe ID of the party (min 2, max 128 characters)
size?array[integer, integer]The party's current and maximum size (current_size, max_size)
privacy?integerThe privacy of activity party (default PRIVATE)
Activity Party Privacy
ValueNameDescription
0PRIVATEThe party is private
1PUBLICThe party is public
RPC Activity Button Structure
FieldTypeDescription
labelstringThe label of the custom button (1-32 characters)
urlstringURL that is opened when clicking on the button label (1-512 characters)

Send Activity Join Invite

Used to send an invite to another user for an activity. Responds with null.

Send Activity Join Invite Arguments Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user to send the activity invite to
pidintegerThe ID of the OS process that is sending the activity invite

Close Activity Join Request

Used to reject a rich presence Ask to Join request. Responds with null.

Close Activity Join Request Arguments Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user to reject the request from

Activity Invite User

Used to send an invite to another user for an activity. Responds with null.

Send Activity Join Invite Arguments Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user to send the activity invite to
typeintegerThe type of activity request (only JOIN is allowed)
content?stringThe message contents (max 1024 characters)
pidintegerThe ID of the OS process that is sending the activity invite

Accept Activity Invite

Used to accept an activity invite. Responds with null.

Accept Activity Invite Arguments Structure
FieldTypeDescription
typeintegerThe type of activity request (only JOIN is allowed)
user_idsnowflakeThe ID of the user to accept the activity invite from
session_idstringThe ID of the Gateway session of the activity invite
channel_idsnowflakeThe ID of the channel the activity invite message was sent in
message_idsnowflakeThe ID of the message
application_id?snowflakeThe ID of the application

Open Invite Dialog

Used to present a modal to invite other users to the current embedded activity. Responds with null.

Open Share Moment Dialog

Used to share an image from an embedded activity in recent DMs or channels. Responds with null.

The application must have the EMBEDDED flag.

Open Share Moment Dialog Arguments Structure
FieldTypeDescription
mediaUrlstringThe Discord CDN URL of the image to share (max 1024)

Share Interaction

Used by embedded activities to present a modal to user asking where a pre-defined slash command should be ran.

The content, preview_image, and components fields are used within the modal as a command response preview.

Share Interaction Arguments Structure
FieldTypeDescription
commandstringThe name of the application command
options?array[interaction option object]The pre-defined options for the slash command
content?stringThe modal preview's content (max 2000)
require_launch_channel?booleanWhether to require that the current user should be participating in the embedded activity
preview_image?interaction response preview image objectThe modal preview's image
components? 1array[action row object]The modal preview's components
pid?integerThe ID of the OS process to overlay the modal in

1 Only action rows are permitted. Only buttons are permitted inside action rows. The buttons can have only type, style, label, and custom_id. PREMIUM buttons are not permitted. The components can't have id field set.

Interaction Option Structure
FieldTypeDescription
namestringThe name of the option
valuestringThe value of the option
Interaction Response Preview Image Structure
FieldTypeDescription
heightintegerThe height of the image
urlstringThe URL of the image
widthintegerThe width of the image
Share Interaction Response Structure
FieldTypeDescription
successbooleanWhether the slash command was successfully ran somewhere

Initiate Image Upload

Used by embedded activities to open a file dialog and retrieve a user-provided image.

Initiate Image Upload Response Structure
FieldTypeDescription
image_urlstringThe Discord CDN URL of the user-provided image

Used to open the share message modal, where a user can pick a channel to send a developer-defined message to.

The application must have the EMBEDDED flag.

FieldTypeDescription
custom_id?stringDeveloper-defined identifier for the link (max 64 characters)
messagestringThe message's content (max 1000 characters)
link_id?stringThe ID of the link (max 64 characters)
FieldTypeDescription
successbooleanWhether the link was successfully shared
didCopyLinkbooleanWhether the user copied the link
didSendMessagebooleanWhether the user sent a message

Used to navigate to a route in the Discord client.

FieldTypeDescription
typestringThe type of deep link
paramsdeep link params objectThe deep link parameters
ValueDescription
USER_SETTINGSUser settings
CHANGELOGChangelog entry
LIBRARYGame library
STORE_HOMEPremium subscription home
STORE_LISTINGStore listing
CHANNELChannel
GAME_SHOPGame shop
PICK_GUILD_SETTINGSGuild settings
QUEST_HOMEQuest home
DISCOVERY_GAME_RESULTSGame discovery results
OAUTH2OAuth2
FEATURESAny path
SHOPShop
ACTIVITIESEmbedded activities
QUEST_PREVIEW_TOOLQuest preview tool
ONE_TIME_LOGINOne time login
FieldTypeDescriptionApplicable for
section?stringThe sectionUSER_SETTINGS, PICK_GUILD_SETTINGS
subsection?stringThe subsectionUSER_SETTINGS, PICK_GUILD_SETTINGS
search?stringThe search queryUSER_SETTINGS, PICK_GUILD_SETTINGS, CHANNEL, OAUTH2, SHOP
fingerprint??stringThe fingerprintUSER_SETTINGS, CHANGELOG, LIBRARY, STORE_HOME, STORE_LISTING, CHANNEL, GAME_SHOP, PICK_GUILD_SETTINGS, QUEST_HOME, DISCOVERY_GAME_RESULTS, ACTIVITIES, QUEST_PREVIEW_TOOL, ONE_TIME_LOGIN
date?stringThe changelog entry dateCHANGELOG
query?stringThe queryCHANGELOG
skuId?snowflakeThe ID of the SKUSTORE_LISTING, GAME_SHOP
slug?stringThe slug of the SKUSTORE_LISTING, GAME_SHOP
guildId? 1snowflakeThe ID of the channel guildCHANNEL, GAME_SHOP
channelId?snowflakeThe ID of the channel the message was sent inCHANNEL
messageId?snowflakeThe ID of the message to navigate toCHANNEL
pageIndex?integerThe page indexGAME_SHOP
sort?stringThe field to sort quests byQUEST_HOME
filter?stringThe types to filter quests byQUEST_HOME
tab?stringThe quest home tab (default all)QUEST_HOME
questId?snowflakeThe ID of the questQUEST_HOME, QUEST_PREVIEW_TOOL
gameId?snowflakeThe ID of the game applicationDISCOVERY_GAME_RESULTS
token?stringThe authentication tokenONE_TIME_LOGIN
path?stringThe path to navigate toFEATURES
attemptId?stringThe ID of the attemptACTIVITIES
applicationId?snowflakeThe ID of the embedded activity applicationACTIVITIES
url?stringThe embedded activity URLACTIVITIES

1 A special value of @me is used to indicate private channels.

Quest Home Sort Type
suggestedSort by interest
most_recentSort by quest creation date
expiring_soonSort by quest expiration date
recently_enrolledSort by quest enrollment date
Quest Home Filter Type
ValueDescription
reward_virtual_currencyQuest must have reward of type VIRTUAL_CURRENCY
reward_collectibleQuest must have reward of type COLLECTIBLE
reward_in_gameQuest must have reward of type REWARD_CODE, or IN_GAME
task_playQuest must have PLAY_ON_DESKTOP, PLAY_ON_DESKTOP_V2, PLAY_ON_XBOX, PLAY_ON_PLAYSTATION, or PLAY_ACTIVITY tasks
task_videoQuest must have WATCH_VIDEO, or WATCH_VIDEO_ON_MOBILE tasks
Quest Home Tab
ValueDescription
allAll quests
claimedClaimed quests

Connections Callback

Used to send the next part of connection flow to the client. Responds with null.

Connections Callback Arguments Structure
FieldTypeDescription
providerTypestringThe type of connection
codestringThe authorization code for the connection
openid_params?objectAdditional parameters for OpenID Connect
iss?stringThe issuer
statestringThe state used to authorize the connection

Billing Popup Bridge Callback

Used as callback for payment methods like PaySafeCard, Klarna, Przelewy24, and other payment providers.

Billing Popup Bridge Callback Arguments Structure
FieldTypeDescription
statestringThe unique identifier for the request flow
pathstringThe redirect API path
query?map[string, string]Redirect query parameters
payment_source_typeintegerThe type of payment source
Billing Popup Bridge Callback Response Structure
FieldTypeDescription
okbooleanWhether the HTTP response is successful
headersmap[string, string]The headers of the HTTP response
body?anyThe body of the HTTP response, parsed as JSON
textstringThe body of the HTTP response, in text format
statusintegerThe status of the HTTP response

Gift Code Browser

Used to open a given gift code link in the client.

Gift Code Browser Arguments Structure
FieldTypeDescription
codestringThe gift code to open
Gift Code Browser Response Structure
FieldTypeDescription
giftCodegift code objectThe gift code

Guild Template Browser

Used to open a given template link in the client.

Guild Template Browser Arguments Structure
FieldTypeDescription
codestringThe code of the template
Guild Template Browser Response Structure
FieldTypeDescription
guildTemplateRPC guild template objectThe guild template
codestringThe code of the template

Open Message

Used to open a specific message or DM in the client. Responds with null.

Open Message Arguments Structure
FieldTypeDescription
guild_id??snowflakeThe ID of the guild
channel_idsnowflakeThe ID of the channel
message_idsnowflakeThe ID of the message
pidintegerThe ID of the OS process opening the message (used to open message within overlay)

Browser Handoff

Used to end browser handoff. Responds with null.

Browser Handoff Arguments Structure
FieldTypeDescription
handoffTokenstringThe handoff token received from the Create Handoff Token endpoint
fingerprintstringThe current fingerprint

Set Certified Devices

Used to send info about certified hardware devices. Responds with null.

Set Certified Devices Arguments Structure
FieldTypeDescription
devicesarray[certified device object]The certified devices

Get Image

Used to fetch a user's profile picture.

Get Image Arguments Structure
FieldTypeDescription
typestringThe type of image
idsnowflakeThe ID of the user
formatstringThe format to retrieve image in (only png, webp and jpg are allowed)
sizeintegerThe size of the image to return (if omitted, a default size is used); the size can be any power of two between 16 and 1024
Image Type
ValueDescription
userThe image is user's avatar
Get Image Response Structure
FieldTypeDescription
data_urlstringThe image data URI

Set Overlay Locked

Used to set whether the overlay input is locked. Responds with null.

Set Overlay Locked Arguments Structure
FieldTypeDescription
lockedbooleanWhether the overlay input should be locked
pidintegerThe ID of the OS process where the Discord overlay is running

Open Overlay Activity Invite

Used to open the activity invite modal in the process' overlay. The activity set via SET_ACTIVITY command must have party and join secret. Responds with null.

Open Overlay Activity Invite Arguments Structure
FieldTypeDescription
typeintegerThe type of activity request (only JOIN is allowed)
pidintegerThe ID of the OS process where the Discord overlay is running

Open Overlay Guild Invite

Used to open the invite modal in the process' overlay.

Open Overlay Guild Invite Arguments Structure
FieldTypeDescription
codestringThe invite code
pidintegerThe ID of the OS process to open the voice settings overlay in

Open Overlay Voice Settings

Used to open a voice settings modal in the process' overlay.

Open Overlay Voice Settings Arguments Structure
FieldTypeDescription
pidintegerThe ID of the OS process to open the voice settings overlay in

Validate Application

Used to validate the application. Responds with null if the user has entitlement for primary application's SKU.

Get Entitlement Ticket

Used to retrieve the entitlement ticket for the current application.

Get Entitlement Ticket Response Structure
FieldTypeDescription
ticketstringThe ticket

Get Application Ticket

Used to retrieve the application ticket for the current application.

The ticket usually can be validated client-side with following pseudocode:

import base64
import json
from nacl.signing import VerifyKey
from nacl.exceptions import BadSignatureError
# Your public key can be found on your application in the Developer Portal
PUBLIC_KEY = 'APPLICATION_PUBLIC_KEY'
SKU_ID = '12345678912345678912'
def validate_application_ticket(ticket: str, *, public_key: str) -> Optional[dict]:
verify_key = VerifyKey(public_key)
parts = ticket.split('.')
if len(parts) < 3:
# Not enough parts
return None
if parts[0] != '2':
# Invalid ticket version
return None
try:
signature = bytes.fromhex(parts[1])
except ValueError:
# Invalid ticket signature
return None
encoded_data = parts[2]
try:
verify_key.verify(encoded_data, signature)
except BadSignatureError:
# The ticket is tampered with
return None
data = json.loads(base64.decode(encoded_data))
return data
ticket = ''
validated = validate_application_ticket(ticket)
if validated is None:
print('The ticket is invalid')
else:
entitlements = validated['entitlements']
has_entitlement = any(entitlement['sku_id'] == SKU_ID for entitlement in entitlements)
if has_entitlements:
print('The ticket is valid and the player has entitlement')
else:
print('The ticket is valid, but the player does not have entitlement')
Get Application Ticket Response Structure
FieldTypeDescription
ticketstringThe ticket

Start Purchase

Used to launch the purchase flow for a specific SKU. Responds with a list of purchased entitlement objects.

Start Purchase Arguments Structure
FieldTypeDescription
sku_idsnowflakeThe ID of the SKU to purchase
pid?integerThe ID of the OS process to overlay the purchase modal in

Start Premium Purchase

Used to initiate a premium subscription purchase.

Start Premium Purchase Arguments Structure
FieldTypeDescription
pid?integerThe ID of the OS process to overlay the purchase modal in

Get SKUs

Used to retrieve a list of your application's SKUs. Responds with a list of SKU objects.

Get Entitlements

Used to retrieve a list of entitlements for the current user. Responds with a list of entitlement objects.

Get SKUs Embedded

Used to retrieve a list of your application's SKUs in an embedded context.

Get SKUs Embedded Response Structure
FieldTypeDescription
skusarray[SKU object]The SKUs of the application

Get Entitlements Embedded

Used to retrieve a list of entitlements for the current user in an embedded context.

Get Entitlements Embedded Response Structure
FieldTypeDescription
entitlementsarray[entitlement object]The entitlements for the current user

Get Networking Config

Used by the GameSDK to retrieve a proxy address and networking token.

Get Networking Config Response Structure
FieldTypeDescription
addressstringThe proxy address
tokenstringThe networking token

Networking System Metrics

Used by the GameSDK to send networking system metrics. Accepts an object.

Networking Peer Metrics

Used by the GameSDK to send networking peer metrics. Accepts an object.

Networking Create Token

Used by the GameSDK to retrieve a networking token.

Networking Create Token Response Structure
FieldTypeDescription
addressstringThe proxy address
tokenstringThe networking token

User Settings Get Locale

Used to retrieves the client’s locale.

User Settings Get Locale Response Structure
FieldTypeDescription
localestringThe language option chosen by the user

Send Analytics Event

Used to send an analytics event to Discord via embedded activity. Responds with null.

The application must have the EMBEDDED_FIRST_PARTY flag.

Send Analytics Event Arguments Structure
FieldTypeDescription
event_namestringThe name of the analytics event
event_propertiesobjectThe properties of the analytics event

Used to prompt to open a given URL in the default web browser. Responds with null.

FieldTypeDescription
urlstringThe URL to prompt to open

Capture Log

Used to capture a log entry in the client's console. Responds with null.

Capture Log Arguments Structure
FieldTypeDescription
levelstringThe level of log entry
messagestringThe message to log
Log Level
ValueDescription
logNormal
warnWarning
debugVerbose
infoInfo
errorError

Encourage HW Acceleration

Used to encourage users to turn on hardware acceleration. Accepts an empty object. Responds with null.

Set Orientation Lock State

Used to set options for orientation and picture-in-picture (PiP) modes. Responds with null.

Set Orientation Lock State Arguments Structure
FieldTypeDescription
lock_stateintegerThe lock state
picture_in_picture_lock_state??integerThe PiP lock state
grid_lock_state??integerThe grid lock state

Get Platform Behaviors

Used to retrieve platform-specific behaviors. Response is unstable and subject to change.

Get Platform Behaviors Response Structure
FieldTypeDescription
iosKeyboardResizesView?booleanWhether the keyboard on iOS resizes the view

Get Soundboard Sounds

Used to retrieve available soundboard sounds. Responds with a list of soundboard sound objects. Note that default sounds may have their guild_id set to 0.

Play Soundboard Sound

Used to play a soundboard sound. Responds with null.

Play Soundboard Sound Arguments Structure
FieldTypeDescription
guild_id?snowflakeThe ID of the sound's source guild, if applicable (not required)
sound_id?snowflakeThe ID of the soundboard sound to play

Toggle Video

Used to toggle video in a call. Responds with null.

Toggle Screenshare

Used to toggle screenshare in a call. Responds with null. If process ID is not provided, this will present a screenshare modal.

Toggle Screenshare Arguments Structure
FieldTypeDescription
pid?integerThe ID of the OS process to start screensharing for

Get Activity Instance Connected Participants

Used to retrieve users connected to a specific activity session.

Get Activity Instance Connected Participants Response Structure
FieldTypeDescription
participantsarray[RPC activity participant object]The users currently participating in the activity instance

Get Provider Access Token

Used for the Amazon Music activity to authorize the connection and retrieve the access token. If the user does not have connection for the provider, the Discord client will open a window to link the account to Discord.

Get Provider Access Token Arguments Structure
FieldTypeDescription
providerstringThe type of connection to authorize
connection_redirect?stringThe URL to redirect to
Get Provider Access Token Response Structure
FieldTypeDescription
access_tokenstringThe connection's access token

Maybe Get Provider Access Token

Used for the Amazon Music activity to attempt to get the access token from existing connection.

Maybe Get Provider Access Token Arguments Structure
FieldTypeDescription
providerstringThe type of connection to authorize
Maybe Get Provider Access Token Response Structure
FieldTypeDescription
access_tokenstringThe connection's access token

Used for Amazon Music, opens the connections page in settings. Accepts an empty object. Responds with null.

Invite User Embedded

Used to invite a user to the current embedded activity.

Invite User Embedded Arguments Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user to send invite to
content?stringThe message's content along with activity invite

Invite Browser

Used to open an invite modal for a guild invite in the client.

Invite Browser Arguments Structure
FieldTypeDescription
codestringThe code of the invite to open
Invite Browser Response Structure
FieldTypeDescription
inviteinvite objectThe invite
codestringThe invite code

Request Proxy Ticket Refresh

Used to refresh proxy tickets for the current embedded activity.

The application must have the EMBEDDED flag.

Request Proxy Ticket Response Structure
FieldTypeDescription
ticketstringThe ticket

Get Quest Enrollment Status

Used to retrieve enrollment status for a quest.

Get Quest Enrollment Status Arguments Structure
FieldTypeDescription
quest_idsnowflakeThe ID of the quest
Get Quest Enrollment Status Response Structure
FieldTypeDescription
quest_idsnowflakeThe ID of the quest
is_enrolledbooleanWhether the user is accepted the quest
enrolled_at?ISO8601 timestampWhen the user accepted the quest

Quest Start Timer

Used to start timer for a quest.

Quest Start Timer Arguments Structure
FieldTypeDescription
quest_idsnowflakeThe ID of the quest
Quest Start Timer Response Structure
FieldTypeDescription
successbooleanWhether the timer was successfully started

RPC Events

Events are payloads sent over the socket to a client that correspond to events in Discord. Many of these mirror actual Gateway events, so check there for more details!

NameDescriptionScopes
READYNon-subscription event sent immediately after connecting, contains server information
ERRORNon-subscription event sent when there is an error, including command responses
CURRENT_USER_UPDATESent when current user updatesrpc.local, identify
CURRENT_GUILD_MEMBER_UPDATESent when current user bound to a guild updatesidentify and guilds.members.read
GUILD_STATUSSent when a subscribed guild's state changesrpc
GUILD_CREATESent when a guild is created/joined on the clientrpc
CHANNEL_CREATESent when a channel is created/joined on the clientrpc
RELATIONSHIP_UPDATESent when a user's relationship updatesrelationships.read
VOICE_CHANNEL_SELECTSent when the client moves voice channelsrpc
VOICE_STATE_CREATESent when a user joins a subscribed voice channelrpc or rpc.voice.read
VOICE_STATE_DELETESent when a user parts a subscribed voice channelrpc or rpc.voice.read
VOICE_STATE_UPDATESent when a user's voice state changes in a subscribed voice channel (mute, volume, etc.)rpc or rpc.voice.read
VOICE_SETTINGS_UPDATESent when the client's voice settings updaterpc or rpc.voice.read
VOICE_SETTINGS_UPDATE_2Same when the client's basic voice settings updaterpc.local
VOICE_CONNECTION_STATUSSent when the client's voice connection status changesrpc or rpc.voice.read
SPEAKING_STARTSent when a user in a subscribed voice channel speaksrpc, rpc.voice.read, or rpc.local
SPEAKING_STOPSent when a user in a subscribed voice channel stops speakingrpc, rpc.voice.read, or rpc.local
ACTIVITY_JOINSent when the user clicks a rich presence join invite in chat to join an activityrpc, rpc.authenticated, or rpc.local
ACTIVITY_JOIN_REQUESTSent when the user receives a rich presence Ask to Join requestrpc or rpc.local
ACTIVITY_SPECTATESent when the user clicks a rich presence spectate invite in chat to spectate a gamerpc, rpc.authenticated, or rpc.local
ACTIVITY_INVITESent when the user receives a rich presence Join requestrpc or rpc.local
ACTIVITY_PIP_MODE_UPDATESent when PiP (Picture-in-Picture) mode changes
ACTIVITY_LAYOUT_MODE_UPDATESent when a user changes the layout mode in the Discord client
THERMAL_STATE_UPDATESent when thermal state of the mobile device is updatedrpc.authenticated
ORIENTATION_UPDATEFor mobile devices, indicates a change in orientation of the screenrpc.authenticated
ACTIVITY_INSTANCE_PARTICIPANTS_UPDATESent when the number of instance participants changesrpc.authenticated
NOTIFICATION_CREATESent when the client receives a notification (mention or new message in eligible channels)rpc and rpc.notifications.read
MESSAGE_CREATE 1Sent when a message is created in a subscribed text channelrpc
MESSAGE_UPDATE 1Sent when a message is updated in a subscribed text channelrpc
MESSAGE_DELETE 1Sent when a message is deleted in a subscribed text channelrpc
OVERLAYSent to communicate with the game overlayrpc.private
OVERLAY_UPDATESent when the game overlay settings are changed for your applicationrpc.local
ENTITLEMENT_CREATESent when an entitlement is created for one of your application's SKUsrpc.authenticated, rpc.local
ENTITLEMENT_DELETESent when an entitlement is deleted for one of your application's SKUsrpc.authenticated, rpc.local
SCREENSHARE_STATE_UPDATESent when a user's screenshare state changesrpc.screenshare.read or rpc.local
VIDEO_STATE_UPDATESent when a user's video state changesrpc.voice.read or rpc.local
AUTHORIZE_REQUESTSent when an activity wants to authorize within the Discord client
QUEST_ENROLLMENT_STATUS_UPDATESent when a user's quest enrollment status changesidentify

1 Requires that the channel or guild's application_id matches the client_id of the connection, or the authorization has the messages.read scope.

Ready

Sent when the client has completed the initial handshake with the RPC server.

Ready Structure
FieldTypeDescription
vintegerThe RPC protocol version
configclient environment config objectThe client environment configuration
user? 1RPC user objectThe connected user

1 Only present in the IPC transport.

Client Environment Config Structure
FieldTypeDescription
cdn_host?stringThe CDN domain
api_endpointstringThe base API URL without scheme
environmentstringThe type of environment (always production)

Error

Sent in response to outgoing command or event.

Error Structure
FieldTypeDescription
codeintegerThe error code
messagestringA human-readable message describing the error

Current User Update

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

Current Guild Member Update

Sent when properties about the guild member change. Inner payload is an RPC guild member object.

Current Guild Member Update Subscription Arguments Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild

Guild Status

Sent when a subscribed guild's state changes.

Guild Status Subscription Arguments Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
Guild Status Structure
FieldTypeDescription
guildRPC guild objectThe guild

Guild Create

Sent when a guild is created/joined on the client. The inner payload is an RPC guild object.

Channel Create

Sent when a channel is created/joined on the client. The inner payload is a partial RPC channel object.

Relationship Update

Sent when a user's relationship updates. The inner payload is an RPC relationship object.

Voice Channel Select

Sent when the client moves voice channels.

Voice Channel Select Structure
FieldTypeDescription
channel_id?snowflakeThe ID of the channel
guild_id??snowflakeThe ID of the guild the channel is in

Voice State Create

Sent when a user joins a subscribed voice channel. The inner payload is an RPC voice state object.

Voice State Create Subscription Arguments Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel to subscribe to/unsubscribe from

Voice State Delete

Sent when a user parts a subscribed voice channel. The inner payload is an RPC voice state object.

Voice State Delete Subscription Arguments Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel to subscribe to/unsubscribe from

Voice State Update

Sent when a user's voice state changes in a subscribed voice channel (mute, volume, etc.). The inner payload is an RPC voice state object.

Voice State Update Subscription Arguments Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel to subscribe to/unsubscribe from

Voice Settings Update

Sent when the client's voice settings update. The inner payload is an RPC voice settings object.

Voice Settings Update 2

Sent when the client's user voice settings update.

Voice Settings Update 2 Structure
FieldTypeDescription
input_modeRPC voice input mode objectThe input mode
local_mutesarray[snowflake]The IDs of the users that are locally muted
local_volumesmap[snowflake, float]A mapping of user IDs to their volume
self_mutebooleanWhether the user is self-muted
self_deafbooleanWhether the user is self-deafened
RPC Voice Input Mode Structure
FieldTypeDescription
typestringThe type of voice settings mode
shortcutstringThe shortcut key combos for PTT

Voice Connection Status

Sent when the client's voice connection status changes.

Voice Connection Status Structure
FieldTypeDescription
statestringThe state of voice connection
hostnamestringThe host name of the voice server
pingsarray[voice connection ping object]The latest pings (max 200)
average_ping?integerThe average latency in milliseconds
last_ping?integerThe current latency in milliseconds
Voice Connection Ping Structure
FieldTypeDescription
timeintegerUnix timestamp in milliseconds when the ping was made
valueintegerThe latency
Voice Connection State
ValueDescription
DISCONNECTEDVoice server is disconnected
AWAITING_ENDPOINTClient is waiting for a voice endpoint
AUTHENTICATINGDiscord has connected to your real-time communication server and will secure the connection
CONNECTINGRTC server has been allocated and Discord is attempting to connect to it
VOICE_DISCONNECTEDConnection has been interrupted (Discord will attempt to re-establish the connection in a moment)
VOICE_CONNECTINGSecure connection to server is established and attempting to send data
VOICE_CONNECTEDConnection is successfully established
NO_ROUTEConnection cannot be established (Discord will try again in a moment)
ICE_CHECKINGSecure connection to server is established and attempting to send data
DTLS_CONNECTINGSecure connection to server is established and attempting to send data

Speaking Start

Sent when a user in a subscribed voice channel speaks.

Speaking Start Subscription Arguments Structure
FieldTypeDescription
channel_id?snowflakeThe ID of the channel
Speaking Start Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel
user_idsnowflakeThe ID of the user that started speaking

Speaking Stop

Sent when a user in a subscribed voice channel stops speaking.

Speaking Stop Subscription Arguments Structure
FieldTypeDescription
channel_id?snowflakeThe ID of the channel
Speaking Stop Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel
user_idsnowflakeThe ID of the user that stopped speaking

Activity Join

Sent when the user clicks a rich presence join invite in chat to join an activity.

Activity Join Structure
FieldTypeDescription
secretstringThe join secret
intent?integerThe activity join intent
Join Intent
ValueNameDescription
0PLAYJoin
1SPECTATESpectate

Activity Join Request

Sent when the user receives a rich presence Ask to Join request.

Activity Join Request Structure
FieldTypeDescription
userRPC user objectThe user
activityactivity objectThe activity
typeintegerThe type of activity request (always JOIN_REQUEST)
channel_idsnowflakeThe ID of the channel
message_idsnowflakeThe ID of the message

Activity Spectate

Sent when the user clicks a rich presence spectate invite in chat to spectate a game.

Activity Spectate Structure
FieldTypeDescription
secretstringThe spectating secret

Activity Invite

Sent when the user receives a rich presence Join request.

Activity Invite Structure
FieldTypeDescription
userRPC user objectThe user
activityactivity objectThe activity
typeintegerThe type of activity request (always JOIN)
channel_idsnowflakeThe ID of the channel
message_idsnowflakeThe ID of the message

Activity PiP Mode Update

Sent when PiP (Picture-in-Picture) mode changes. This is essentially equivalent to Activity Layout Mode Update and checking if layout mode is not FOCUSED.

Activity PiP Mode Update
FieldTypeDescription
is_pip_modebooleanWhether the embedded activity is in PiP mode

Activity Layout Mode Update

Sent when a user changes the layout mode in the Discord client.

Activity Layout Mode Update Structure
FieldTypeDescription
layout_modeintegerThe current layout mode
Layout Mode
ValueNameDescription
0FOCUSEDEmbedded activity is in focus
1PIPEmbedded activity is in PiP mode
2GRIDEmbedded activity is in a grid

Thermal State Update

Sent when thermal state of mobile device is updated.

Thermal State Update Structure
FieldTypeDescription
thermal_stateintegerThe thermal state
Thermal State
ValueNameDescription
0NOMINALNominal
1FAIRFair
2SERIOUSSerious
3CRITICALCritical

Orientation Update

Sent when orientation of the screen changes.

Orientation Update Structure
FieldTypeDescription
screen_orientationintegerThe current screen orientation

Activity Instance Participants Update

Sent when someone joins/leaves embedded activity instance.

Activity Instance Participants Update Structure
FieldTypeDescription
participantsarray[RPC activity participant object]The users currently participating in the activity instance

Notification Create

Sent when the client receives a notification (mention or new message in eligible channels).

Notification Create Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel the message was sent in
messageRPC message objectThe message that triggered the notification
icon_url?stringThe URL of the icon to display
titlestringThe title of the notification
bodystringThe body text of the notification

Message Create

Sent when a message is created in a subscribed text channel.

Message Create Subscription Arguments Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel to subscribe to/unsubscribe from
Message Create Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel to subscribe to/unsubscribe from
messageRPC message objectThe message

Message Update

Sent when a message is updated in a subscribed text channel.

Message Update Subscription Arguments Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel to subscribe to/unsubscribe from
Message Update Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel to subscribe to/unsubscribe from
messageRPC message objectThe message

Message Delete

Sent when a message is deleted in a subscribed text channel.

Message Delete Subscription Arguments Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel to subscribe to/unsubscribe from
Message Delete Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel to subscribe to/unsubscribe from
messagepartial RPC message objectThe deleted message
Partial RPC Message Structure
FieldTypeDescription
idsnowflakeThe ID of the deleted message

Overlay Update

Sent when the game overlay settings are changed for your application.

Overlay Update Subscription Arguments Structure
FieldTypeDescription
pidintegerThe ID of the process to subscribe to/unsubscribe from
Overlay Update Structure
FieldTypeDescription
enabledbooleanWhether the overlay is enabled for the application
lockedbooleanWhether the overlay is locked in the subscribed process

Entitlement Create

Sent when an entitlement is created when a user purchases or is otherwise granted one of your application's SKUs. The inner payload is an entitlement object.

Entitlement Delete

Sent when an entitlement is deleted. The inner payload is an entitlement object.

Screenshare State Update

Sent when a user's screenshare state changes.

Screenshare State Update Structure
FieldTypeDescription
activebooleanWhether the user is screensharing
pid?integerThe ID of the OS process whose window is being screenshared
application?screenshare application objectThe application being screenshared
Screenshare Application Structure
FieldTypeDescription
namestringThe name of the application

Video State Update

Sent when a user's video state changes.

Video State Update Structure
FieldTypeDescription
activebooleanWhether the current user's camera is enabled

Authorize Request

Sent when an activity wants to authorize within the Discord client. Inner payload is null.

Quest Enrollment Status Update

Sent when a user's quest enrollment status changes.

Quest Enrollment Status Update Structure
FieldTypeDescription
quest_idsnowflakeThe ID of the quest
is_enrolledbooleanWhether the user is accepted the quest
enrolled_at?ISO8601 timestampWhen the user accepted the quest