Connected Accounts

Connections are links between third party accounts to Discord accounts.

Connection Object

The connection object that the user has attached.

Connection Structure
FieldTypeDescription
idstringID of the connection account
typestringThe type of the connection
namestringThe username of the connection account
verifiedbooleanWhether the connection is verified
metadata?objectService-specific metadata about the connection
metadata_visibilityintegerVisibility of the connection's metadata
revokedbooleanwhether the connection is revoked
integrations 1 2array[connection integration object]The guild integrations attached to the connection
friend_syncbooleanWhether friend sync is enabled for this connection
show_activitybooleanWhether activities related to this connection will be shown in presence
two_way_linkbooleanWhether this connection has a corresponding third party OAuth2 token
visibilityintegerVisibility of the connection
access_token? 1stringThe access token for the connection account

1 Not included when fetching a user's connections via OAuth2.

2 These integrations can be used to join your own sub-enabled guild or the guild of a creator you are supporting.

Partial Connection Structure
FieldTypeDescription
idstringID of the connection account
typestringThe type of the connection
namestringThe username of the connection account
verifiedbooleanWhether the connection is verified
metadata?objectService-specific metadata about the connection
Example Connection
{
"type": "reddit",
"id": "run&hide",
"name": "alien",
"visibility": 1,
"friend_sync": false,
"show_activity": true,
"verified": true,
"two_way_link": false,
"metadata_visibility": 1,
"metadata": {
"gold": "0",
"mod": "1",
"total_karma": "20223",
"created_at": "2019-05-02T20:28:37"
},
"revoked": false,
"integrations": []
}
Example Partial Connection
{
"type": "reddit",
"id": "run&hide",
"name": "alien",
"verified": true,
"metadata": {
"gold": "0",
"mod": "1",
"total_karma": "20223",
"created_at": "2019-05-02T20:28:37"
}
}
Connection Integration Structure
FieldTypeDescription
id 1snowflakeThe ID of the integration
typestringThe type of integration
accountaccount objectThe integration's account information
guildintegration guild objectThe guild that the integration is attached to

1 This field may also be the literal string "twitch-partners" to represent the Twitch Partners integration.

Example Connection Integration
{
"id": "twitch-partners",
"type": "twitch",
"account": {
"id": "92473777",
"name": "discordapp"
},
"guild": {
"id": "107939014299901952",
"name": "Twitch Partners",
"icon": "62450d21b75478191962d9c4b81831ae"
}
}
Connection Type
ValueName
amazon-musicAmazon Music
battlenetBattle.net
blueskyBluesky
bungieBungie.net
contacts 2Contact Sync
crunchyrollCrunchyroll
domainDomain
ebayeBay
epicgamesEpic Games
facebookFacebook
githubGitHub
instagram 1Instagram
leagueoflegendsLeague of Legends
mastodonMastodon
paypalPayPal
playstationPlayStation Network
playstation-stgPlayStation Network (Staging)
redditReddit
robloxRoblox
riotgamesRiot Games
samsung 1Samsung Galaxy
soundcloudSoundCloud
spotifySpotify
skype 1Skype
steamSteam
tiktokTikTok
twitchTwitch
twitterTwitter
xboxXbox
youtubeYouTube

1 Service can no longer be added by users.

2 Service is not returned in Get User Profile or when fetching a user's connections via OAuth2.

Visibility Type
ValueNameDescription
0NONEInvisible to everyone except the user themselves
1EVERYONEVisible to everyone

Partial connections always have a visibility of 1.

Console Device Object

Console Device Structure
FieldTypeDescription
idsnowflakeThe ID of the device
namestringThe name of the device
platformstringThe console platform (only playstation and playstation-stg are allowed)
Example Console Device
{
"id": "1371598138300956672",
"name": "My Gifted PlayStation 5",
"platform": "playstation"
}

Endpoints

Authorize User Connection

GET/connections/{connection.type}/authorize

Returns an authorization link that can be used for authorizing a new connection.

Query String Params
FieldTypeDescription
two_way_link_type??stringThe type of two-way link to create
two_way_user_code??stringThe device code to use for the two-way link
continuation?booleanWhether this is a continuation of a previous authorization
ValueDescription
webThe connection is linked via web
mobileThe connection is linked via mobile
desktopThe connection is linked via desktop
Response Body
FieldTypeDescription
urlstringThe authorization link for the user

Create User Connection Callback

POST/connections/{connection.type}/callback

Creates a new connection for the current user. Returns a connection object on success. Fires a User Connections Update Gateway event.

JSON Params
FieldTypeDescription
codestringThe authorization code for the connection
statestringThe state used to authorize the connection
two_way_link_code?stringThe code to use for two-way linking
insecure?booleanWhether the connection is insecure (default false)
friend_sync?booleanWhether to sync friends over the connection
openid_params?objectAdditional parameters for OpenID Connect

Create Contact Sync Connection

PUT/users/@me/connections/contacts/{connection.id}

Creates a new contact sync connection for the current user. Returns a connection object on success. Fires a User Connections Update Gateway event.

JSON Params
FieldTypeDescription
namestringThe username of the connection account
friend_sync?booleanWhether to sync friends over the connection

Update External Friend List Entries

PUT/users/@me/connections/contacts/{connection.id}/external-friend-list-entries

Syncs the user's device contacts to the connection. May fire multiple Friend Suggestion Create Gateway events.

JSON Params
FieldTypeDescription
friend_list_entriesarray[friend list entry object]The phone numbers to sync (max 10000)
backgroundbooleanWhether the request is a background sync (will not return suggestions)
allowed_in_suggestionsintegerThe contact sync suggestions setting
include_mutual_friends_countbooleanWhether to show the mutual friend count of contacts
add_reverse_friend_suggestions?booleanWhether to add users that have contact synced the current user as friend suggestions
Friend List Entry Structure
FieldTypeDescription
friend_idstringE.164-formatted phone number of the contact
Contact Sync Suggestions Setting
ValueNameDescription
1MUTUAL_CONTACT_INFO_ONLYUsers who have contact synced that have the current user as a contact
2ANYONE_WITH_CONTACT_INFOUsers who have contact synced
Response Body
FieldTypeDescription
bulk_add_token?stringToken to be used for bulk adding relationships
friend_suggestionsarray[friend suggestion object]Suggested users

Contact Sync Settings

GET/users/@me/connections/contacts/{connection.id}/external-friend-list-entries/settings
Response Body
FieldTypeDescription
allowed_in_suggestionsintegerThe contact sync suggestions setting

Create Domain Connection

POST/users/@me/connections/domain/{connection.id}

Creates a new domain connection for the current user. Returns a connection object on success. Fires a User Connections Update Gateway event.

Get User Connections

GET/users/@me/connections

Returns a list of connection objects.

Get User Connection Access Token

GET/users/@me/connections/{connection.type}/{connection.id}/access-token

Returns a new access token for the given connection. Only available for Twitch, YouTube, and Spotify connections. Fires a User Connections Update Gateway event.

Response Body
FieldTypeDescription
access_tokenstringThe connection's access token

Get User Connection Subreddits

GET/users/@me/connections/reddit/{connection.id}/subreddits

Returns a list of subreddits the connected account moderates. Only available for Reddit connections.

Subreddit Structure
FieldTypeDescription
idstringThe subreddit's ID
subscribersintegerThe number of joined Reddit users
urlstringThe subreddit's relative URL
Example Response
[
{
"id": "t5_388p4",
"subscribers": 1044184,
"url": "/r/discordapp/"
}
]

Refresh User Connection

POST/users/@me/connections/{connection.type}/{connection.id}/refresh

Refreshes a connection. Returns a 204 empty response on success. Fires a User Connections Update Gateway event.

Modify User Connection

PATCH/users/@me/connections/{connection.type}/{connection.id}

Modifies a connection. Returns a connection object on success. Fires a User Connections Update Gateway event.

Not all connection types support all parameters.

JSON Params
FieldTypeDescription
namestringThe connection's username
show_activitybooleanWhether activities related to this connection will be shown in presence
friend_syncbooleanWhether friend sync is enabled for this connection
metadata_visibilityintegerVisibility of the connection's metadata
visibilityintegerVisibility of the connection

Delete User Connection

DELETE/users/@me/connections/{connection.type}/{connection.id}

Deletes a connection. Returns a 204 empty response on success. Fires a User Connections Update and optionally a Guild Delete Gateway event.

Get User Linked Connections

GET/users/@me/linked-connections

Returns a list of connection objects that have a two-way link with the application making the request.

Create Console Connection

POST/consoles/connect-request

Returns a nonce for connecting to voice on PlayStation consoles.

JSON Params
FieldTypeDescription
analytics_properties?connect request properties objectThe properties used for analytics
Connect Request Properties Structure
FieldTypeDescription
handoff_typestringThe console handoff type
Console Handoff Type
ValueDescription
CREATE_NEW_CALLCreate a new call on a console device
TRANSFER_EXISTING_CALLTransfer an existing call to a console device
Response Body
FieldTypeDescription
noncestringThe nonce
Example Response
{ "nonce": "fgnmC0tT" }

Cancel Console Connection Request

DELETE/consoles/connect-request/{nonce}

Cancels a console connection request. Returns a 204 empty response on success.

Get Console Devices

GET/consoles/{connection.type}/devices

Returns the consoles associated with the given connection type. Only supports playstation and playstation-stg connection types.

Response Body
FieldTypeDescription
devicesarray[console device object]The user console devices

Send Console Command

POST/consoles/{connection.type}/devices/{device.id}/commands

Sends a command to connect to a voice call on a console device.

JSON Params
FieldTypeDescription
commandstringThe command type
channel_idsnowflakeThe ID of the channel to connect to
guild_id?snowflakeThe ID of the guild the channel is in
nonce?stringThe nonce obtained from Create Console Connection endpoint
Console Command Type
ValueDescription
connect_voiceConnect to a voice call
Response Body
FieldTypeDescription
idsnowflakeThe ID of the sent command

Cancel Console Command

DELETE/consoles/{connection.type}/devices/{device.id}/commands/{command.id}

Cancels a console command. Returns a 204 empty response on success.