Presences

A user's presence is their current status and activity. Presences are usually per-guild, but user accounts also receive overall user presences for friends and implicit relationships (depending on the NO_AFFINE_USER_IDS Gateway capability).

Presence Object

Presence Structure
FieldTypeDescription
userpartial user objectThe user whose presence is being updated
guild_id?snowflakeThe ID of the guild the presence was updated in, if this is a guild presence
statusstringThe status of the user
activitiesarray[activity object]The current activities the user is partaking in
hidden_activities? 1 2array[activity object]Activities that are hidden from the public
client_statusclient status objectThe platform-dependent status of the user
has_played_game? 3booleanWhether the user has authorized the same application the current user's session is associated with

1 Activities are hidden when a user is invisible or has their show_current_game privacy setting disabled. Some exceptions apply, such as the Spotify activity, which is always shown.

2 To subscribe to hidden activities for a user, see the Update Activity Subscriptions endpoint.

3 Only available in OAuth2 contexts.

Session Object

Represents a specific Gateway session's presence information for the current user.

Session Structure
FieldTypeDescription
session_id 1stringThe ID of the session
client_infoclient info objectInformation about the client that spawned the session
statusstringThe status of the session
activitiesarray[activity object]The current activities the session is partaking in
hidden_activities 2array[activity object]Activities that are hidden from the public
active?booleanUnknown

1 Headless sessions will have a session ID beginning with h:.

2 Activities are hidden when a user is invisible or has their show_current_game privacy setting disabled. Some exceptions apply, such as the Spotify activity, which is always shown.

Client Info Structure
FieldTypeDescription
clientstringThe type of client
osstringThe operating system of the client
versionintegerThe version of the client type (e.g. 5 for the PS5)
Client Type
ValueDescription
desktopDesktop client
webWeb-based client
mobileMobile client
vrVR headset client
unknownUnknown
Operating System Type
ValueDescription
windowsWindows
osxmacOS
linuxLinux
androidAndroid
iosiOS
playstationPlayStation
xboxXbox
unknownUnknown

Client Status Object

Active sessions are indicated with a status per platform. If a user is offline or invisible, the corresponding field is not present.

FieldTypeDescription
desktop?stringThe user's status on an active desktop (Windows, Linux, Mac) application session
mobile?stringThe user's status on an active mobile (iOS, Android) application session
web? 1stringThe user's status on an active web (browser) application session
embedded?stringThe user's status on an active embedded (Xbox, PlayStation) session
vr? 2stringThe user's status on an active VR (Meta Quest 3) session

1 Used as the default when the platform is not known.

2 Only available through headless sessions

Status Type
ValueDescription
onlineOnline
idleIdle
dndDo Not Disturb
invisible 1Shown as offline
offline 1Offline
unknown 2Unknown

1 invisible can only be sent and never received. offline can only be received and never sent.

2 This value can only be sent, and is used when the user's initial presence is unknown and should be assigned by the Gateway.

Activity Object

Activity Structure
FieldTypeDescription
id 5stringThe ID of the activity; only unique across a single user's activities
name 1stringThe name of the activity (1-128 characters)
typeintegerThe activity type
url? 2?stringThe stream URL (max 512 characters)
created_at 5integerUnix timestamp (in milliseconds) of when the activity was added to the user's session
session_id? 5?stringThe ID of the session associated with the activity
platform? 3stringThe platform the activity is being played on
supported_platforms?array[string]The platforms the activity is supported on (max 10)
timestamps?activity timestamps objectUnix timestamps (in milliseconds) for start and/or end of the game
application_id?snowflakeThe ID of the application representing the game the user is playing
parent_application_id?snowflakeThe ID of the parent application representing the game the user is playing
status_display_type??integerWhich field is displayed in the user's status text in the member list
details? 6?stringWhat the user is currently doing (max 128 characters)
details_url??stringURL that is opened when clicking on the details text (max 256 characters)
state? 7?stringThe user's current party status, or text used for a custom status (max 128 characters)
state_url??stringURL that is opened when clicking on the state text (max 256 characters)
sync_id?stringThe ID of the synced activity (e.g. Spotify song ID)
flags?integerThe activity's flags
buttons?array[string]Custom buttons shown in rich presence (max 2)
emoji??activity emoji objectThe emoji used for a custom or hang status
party?activity party objectInformation for the current party of the user
assets?activity assets objectImages for the presence and their hover texts
secrets? 4activity secrets objectSecrets for rich presence joining and spectating
metadata? 4activity metadata objectAdditional metadata for the activity

1 The name of a CUSTOM activity should always be "Custom Status". The name of a HANG activity should always be "Hang Status".

2 URLs must start with http:// or https://.

3 This field is not commonly used for traditional presences (i.e. presences sent by regular clients over the Gateway) and is instead used to differentiate between various headless and embedded activities.

4 These fields are send-only. For retrieving rich presence metadata, see Get Activity Metadata. For retrieving secrets, see Get Activity Secret.

5 These fields are received only and cannot be set.

6 When provided in a CUSTOM activity, it represents a Custom Status Label enumeration.

7 In the case of the HANG type, this field should be one of the hang status types. If set to custom, the details field should be used to specify the custom text, and the emoji field should be used to specify the custom emoji.

Activity Type
ValueNameFormatExample
0PLAYINGPlaying {name}"Playing Rocket League"
1STREAMINGStreaming {details}"Streaming Rocket League"
2LISTENINGListening to {name}"Listening to Spotify"
3WATCHINGWatching {name}"Watching YouTube Together"
4CUSTOM{emoji} {state}"😃 I am cool"
5COMPETINGCompeting in {name}"Competing in Arena World Champions"
6HANG 1{state} or {emoji} {details} 2"Chilling"

1 This type is only displayed if the user has an active voice state.

2 See activity hang status type for more information.

Activity Platform Type
ValueDescription
desktopDesktop (headless)
xboxXbox integration
samsungSamsung integration
iosiOS
androidAndroid
embeddedEmbedded session
ps4PlayStation 4 integration
ps5PlayStation 5 integration
meta_questMeta Quest
Activity Hang Status Type

When a HANG activity's state is set to any value other than custom, a built-in corresponding emoji will be used instead of the custom emoji field.

These values may be concatenated with a colon followed by an icon variant type. The valid variants are: illocons, twemoji, and twemojimild. For example, chilling:illocons is a valid state value. The default variant is twemoji.

ValueExample
chillingchilling
gaminggaming
focusingstudying
brbbrb
watchingwatching stuff
custom{details}
Activity Flags
ValueNameDescription
1 << 0INSTANCEActivity is an instanced game session (a match that will end)
1 << 1JOINActivity can be joined by other users
1 << 2SPECTATE (deprecated) 1Activity can be spectated by other users
1 << 3JOIN_REQUEST 2Activity requires a request to join
1 << 4SYNCActivity can be synced
1 << 5PLAYActivity can be played
1 << 6PARTY_PRIVACY_FRIENDSActivity's party can be joined by friends
1 << 7PARTY_PRIVACY_VOICE_CHANNELActivity's party can be joined by users in the same voice channel
1 << 8EMBEDDEDActivity is embedded within the Discord client
1 << 9CONTEXTLESSEmbedded activity is launched without a context

1 Spectating has been removed from official clients and is no longer supported.

2 Activities no longer need to be explicitly flagged as join requestable.

Activity Action Type
ValueNameDescription
1JOIN 1Allows others to join a game with the user
2SPECTATE (deprecated) 1 2Allows others to spectate a game the user is playing
3LISTENAllows others to listen to a song with the user
4WATCHAllows others to join a stream with the user
5JOIN_REQUEST 3Asks others to invite the user to a game

1 These rich presence invites can be used with the Get Activity Secret endpoint to join/spectate the activity.

2 Spectating has been removed from official clients and is no longer supported.

3 This action type is special in that instead of inviting others to a party, it asks existing party members to invite the user to join their party. Inviting users is done by sending a message back with a rich presence invite.

Activity Timestamps Structure
FieldTypeDescription
start?stringUnix time (in milliseconds) of when the activity starts
end?stringUnix time (in milliseconds) of when the activity ends
Activity Emoji Structure
FieldTypeDescription
namestringThe name of the emoji
id?snowflakeThe ID of the emoji
animated?booleanWhether this emoji is animated
Activity Party Structure
FieldTypeDescription
id?stringThe ID of the party (max 128 characters)
size?array[integer, integer]The party's current and maximum size (current_size, max_size)
Activity Assets Structure
FieldTypeDescription
large_image?stringThe large activity asset image (max 313 characters)
large_text?stringText displayed when hovering over the large image of the activity (max 128 characters)
large_url?stringURL that is opened when clicking on the large image (max 256 characters)
small_image?stringThe small activity asset image (max 313 characters)
small_text?stringText displayed when hovering over the small image of the activity (max 128 characters)
small_url?stringURL that is opened when clicking on the small image (max 256 characters)
invite_cover_image?stringThe activity asset image to use for invites (max 313 characters)
Activity Asset Image

Activity asset images are arbitrary strings which usually contain snowflake IDs, URLs, or prefixed image IDs. Treat data within this field carefully, as it is user-specifiable and not sanitized.

TypeFormatImage URL
Application Asset{application_asset_id}See application asset image formatting
Media Proxymp:{image_id}https://media.discordapp.net/{image_id}
Twitchtwitch:{username}https://static-cdn.jtvnw.net/previews-ttv/live_user_{username}-{width}x{height}.jpg
YouTubeyoutube:{video_id}https://i.ytimg.com/vi/{video_id}/{thumbnail_type}.jpg
Spotifyspotify:{spotify_id}https://i.scdn.co/image/{spotify_id}
Activity Secrets Structure
FieldTypeDescription
join?stringThe secret for joining a party (max 128 characters)
spectate? (deprecated) 1stringThe secret for spectating a game (max 128 characters)
match?stringThe secret for a specific instanced match (max 128 characters)

1 Spectating has been removed from official clients and is no longer supported.

Operating System Type
ValueDescription
win32Windows
darwinmacOS
linuxLinux
Custom Status Label Type
ValueIconLabel
listenMusic noteOn repeat
watchTVWatching lateley
playControllerPlaying lately
questionCalendarQuestion of the day
thinkLightbulbShower thought
loveHeartCurrent obsession (was Loving lately)
excitedShooting starsCan't wait for
recommendGuideRecommendation needed
Status Display Type
ValueNameDescriptionExample
0NAMEDisplay the name field"Listening to Spotify"
1STATEDisplay the state field"Listening to Rick Astley"
2DETAILSDisplay the details field"Listening to Never Gonna Give You Up"
Example Activity
{
"id": "d11307d8c0abb136",
"created_at": "1695164784863",
"details": "24H RL Stream for Charity",
"state": "Rocket League",
"name": "Twitch",
"type": 1,
"url": "https://www.twitch.tv/discord",
"assets": {
"large_image": "twitch:discord"
}
}
Example Activity with Rich Presence
{
"id": "d11307d8c0abb135",
"name": "Rocket League",
"type": 0,
"created_at": "1695164784863",
"session_id": "30f32c5d54ae86130fc4a215c7474263",
"application_id": "379286085710381999",
"state": "In a Match",
"details": "Ranked Duos: 2-1",
"platform": "xbox",
"flags": 0,
"timestamps": {
"start": "1695164482423"
},
"party": {
"id": "9dd6594e-81b3-49f6-a6b5-a679e6a060d3",
"size": [2, 2]
},
"assets": {
"large_image": "351371005538729000",
"large_text": "DFH Stadium",
"small_image": "351371005538729111",
"small_text": "Silver III"
},
"secrets": {
"join": "025ed05c71f639de8bfaa0d679d7c94b2fdce12f"
}
}

Activity Metadata Object

Activity Metadata Structure
FieldTypeDescription
button_urls?array[string]The URLs corresponding to the custom buttons shown in rich presence (max 2)
artist_ids?array[string]The Spotify IDs of the artists of the song being played
album_id?stringThe Spotify ID of the album of the song being played
context_uri?stringThe Spotify URI of the current player context
type?stringThe type of Spotify track being played (track or episode)

Endpoints

Get Presences

GET/presences

Returns the overall user presence for the user's non-offline friends and implicit relationships. Only users that have an activity or are in one of the returned guilds will be included.

Response Body
FieldTypeDescription
guildsarray[voice guild object]The guilds that the user's non-offline friends and implicit relationships have active voice sessions in
presencesarray[presence object]The overall user presences of the user's non-offline friends and implicit relationships
applicationsarray[partial application object]The found game applications in the presences
Voice Guild Structure
FieldTypeDescription
guild_idsnowflakeThe ID of the guild
guild_namestringThe name of the guild
guild_icon?stringThe guild's icon hash
voice_channelsarray[voice channel object]The voice channels that have active sessions
Voice Channel Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the voice channel
channel_namestringThe name of the voice channel
usersarray[snowflake]The IDs of the users in the voice channel
streams? 1array[voice stream object]The streams of the users in the channel

1 Only included when fetched from the Get Presences for Xbox endpoint.

Voice Stream Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user that is streaming
Example Voice Guild
{
"guild_id": "839502008108580904",
"guild_icon": "4da69b53981d1adfa13590a3f2d856ee",
"guild_name": "Testing Server",
"voice_channels": [
{
"channel_id": "850360749460553769",
"channel_name": "Voice",
"users": ["150745989836308480"],
"streams": [
{
"user_id": "150745989836308480"
}
]
}
]
}

Get Presences for Xbox

GET/consoles/xbox/presences

Returns the overall user presence for the user's non-offline friends and implicit relationships, as well as their Xbox connection information. Only users that have an activity or are in one of the returned guilds will be included.

Response Body
FieldTypeDescription
guildsarray[voice guild object]The guilds that the user's non-offline friends and implicit relationships have active voice sessions in
presencesarray[presence object]The overall user presences of the user's non-offline friends and implicit relationships
applicationsarray[partial application object]The found game applications in the presences
connected_account_idsarray[connected account object]The connected Xbox accounts for each user
Connected Account Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user
provider_idsarray[string]The IDs of the connected Xbox accounts for the user

Update Presence

POST/presences

Updates the current user's mobile game activity. Returns a 204 empty response on success. Fires a Sessions Replace Gateway event.

JSON Params
FieldTypeDescription
package_namestringThe package name of the game (e.g. com.supercell.clashofclans)
update?stringThe type of update (default UPDATE)
Presence Update Type
ValueDescription
STARTStart a new game session
UPDATEUpdate the current game session
STOPStop the current game session

Returns a list of global activity statistics objects representing games the user's friends and affine users have recently played.

Query String Params
FieldTypeDescription
with_users?booleanWhether to include user information in the returned activity statistics (default false)
with_applications?booleanWhether to include application information in the returned activity statistics (default false)
Global Activity Statistics Structure
FieldTypeDescription
user_idstringThe ID of the user playing the game
user? 1partial user objectThe user playing the game
application_idstringThe ID of the application representing the game
application? 2partial application objectThe application representing the game
updated_atISO8601 timestampWhen the user last played the game
durationintegerHow long the user played the game for (in seconds)

1 Only included when with_users is set to true.

2 Only included when with_applications is set to true.

Example Global Activity Statistics
{
"user_id": "1001086404203389018",
"application_id": "1334568856227942480",
"updated_at": "2025-03-01T14:58:02.284000+00:00",
"duration": 1176
}

Get Application Activity Statistics

GET/activities/statistics/applications/{application.id}

Returns a list of application activity statistics objects representing the user's friends and affine users that have played the given game.

Application Activity Statistics Structure
FieldTypeDescription
user_idstringThe ID of the user playing the game
last_played_atISO8601 timestampWhen the user last played the game
total_durationintegerHow long the user has ever played the game for (in seconds)
Example Application Activity Statistics
{
"user_id": "343383572805058560",
"last_played_at": "2025-02-20T00:21:07.457000+00:00",
"total_duration": 1180625
}

Get User Application Activity Statistics

GET/users/@me/activities/statistics/applications

Returns a list of user application activity statistics objects representing games the user has played.

User Application Activity Statistics Structure
FieldTypeDescription
application_idstringThe ID of the application representing the game
last_played_atISO8601 timestampWhen the user last played the game
first_played_at?ISO8601 timestampWhen the user first played the game (may not be tracked)
total_durationintegerHow long the user has ever played the game for (in seconds)
total_discord_sku_durationintegerHow long the user has ever played the game through Discord (in seconds)
Example User Application Activity Statistics
{
"application_id": "356875221078245376",
"last_played_at": "2025-02-20T06:24:34.792000+00:00",
"first_played_at": "2024-04-29T22:23:30.307000+00:00",
"total_duration": 246531,
"total_discord_sku_duration": 0
}

Update Activity Session

POST/activities

Updates a currently running activity game session for the current user.

JSON Params
FieldTypeDescription
token?stringThe token of the existing session to update
application_idsnowflakeThe ID of the application representing the game
duration?integerHow long the game has been played for (in seconds) sine the last update (max 1800)
share_activity?booleanWhether to share the activity in activity statistics (default true)
distributor?stringThe distributor of the game
exe_path?stringThe path to the game's executable file (max 128 characters)
voice_channel_id?snowflakeThe ID of the voice channel the user is in while playing the game
session_id?stringThe ID of the session associated with the activity
media_session_id?stringThe ID of the voice connection media session associated with the activity
closed?booleanWhether the game has been closed and the session is over (default false)
Response Body
FieldTypeDescription
tokenstringThe updated token of the session
Example Response
{
"token": ".eJxNzEEKwyAUBNCrBLdtyqjx6_cc3YvELKShCYmuSu_eWArNcoY38xJ1n7aQk_CdcEY5VootkWQQsxbXTsR1nfMYS16ePyclazkQEzslodXA3GBdUyxTCrE0pKBMD92D7rAezht7I2tAdAE80Bapbt_fw-OIZSlxDqdS2uFf531cthT2Rz0TvD_X3TcU.Z8lKCQ.QvSLefzqmY6lhaBaQNG308fl3e8"
}

Create Headless Session

POST/users/@me/headless-sessions

Creates a new headless session for the current user. Fires a Sessions Replace Gateway event.

JSON Params
FieldTypeDescription
activities 1array[activity object]An array containing exactly one activity to set for the headless session
token?stringThe token of the headless session to update

1 In addition to type and name, this activity object must also have a valid application_id and platform set.

Response Body
FieldTypeDescription
activitiesarray[activity object]The current activities the headless session is partaking in
tokenstringThe token of the headless session

Delete Headless Session

POST/users/@me/headless-sessions/delete

Deletes a headless session for the current user. Returns a 204 empty response on success. Fires a Sessions Replace Gateway event.

JSON Params
FieldTypeDescription
tokenstringThe token of the headless session

Get Activity Metadata

GET/users/{user.id}/sessions/{session_id}/activities/{application.id}/metadata

Returns the activity metadata for a given activity, or a 204 empty response if no metadata is found.

Get Activity Secret

GET/users/{user.id}/sessions/{session_id}/activities/{application.id}/{activity_action_type}

Returns an activity secret that can be used to join or spectate the game. Only supports the JOIN and SPECTATE action types.

Query String Params
FieldTypeDescription
channel_id?snowflakeThe ID of the channel the rich presence invite has been sent in
message_id?snowflakeThe ID of the rich presence invite message
Response Body
FieldTypeDescription
secretstringThe activity secret
Example Response
{ "secret": "025ed05c71f639de8bfaa0d679d7c94b2fdce12f" }

Update Activity Subscriptions

POST/users/@me/activities/subscribe

Updates the current user's subscribed hidden activities. Returns a 204 empty response on success. Fires multiple Presence Update Gateway events.

JSON Params
FieldTypeDescription
subscriptionsarray[activity subscription object]The hidden activities the user is subscribed to (1-100)
Activity Subscription Structure
FieldTypeDescription
user_idsnowflakeThe ID of the user to subscribe to
application_idsnowflakeThe ID of the application representing the game
party_idsnowflakeThe ID of the party the user is in
message_idsnowflakeThe ID of the message containing the rich presence invite
channel_idsnowflakeThe ID of the channel the rich presence invite was sent in