Skip to main content
Users in Discord are generally considered the base entity. Users can spawn across the entire platform, be members of guilds, participate in text and voice chat, and much more. Users are separated by a distinction of “bot” vs “normal.” Although they are similar, bot users are automated users that are “owned” by another user. Unlike normal users, bot users do not have a limitation on the number of Guilds they can be a part of.

Usernames and Nicknames

Discord enforces the following restrictions for usernames and nicknames:
  1. Names can contain most valid unicode characters. We limit some zero-width and non-rendering characters.
  2. Usernames must be between 2 and 32 characters long.
  3. Nicknames must be between 1 and 32 characters long.
  4. Names are sanitized and trimmed of leading, trailing, and excessive internal whitespace.
The following restrictions are additionally enforced for usernames:
  1. Usernames cannot contain the following substrings: @, #, :, ```, discord
  2. Usernames cannot be: everyone, here
There are other rules and restrictions not shared here for the sake of spam and abuse mitigation, but the majority of users won’t encounter them. It’s important to properly handle all error messages returned by Discord when editing or updating names.

User Object

User Structure
FieldTypeDescriptionRequired OAuth2 Scope
idsnowflakethe user’s ididentify
usernamestringthe user’s username, not unique across the platformidentify
discriminatorstringthe user’s Discord-tagidentify
global_name?stringthe user’s display name, if it is set. For bots, this is the application nameidentify
avatar?stringthe user’s avatar hashidentify
bot?booleanwhether the user belongs to an OAuth2 applicationidentify
system?booleanwhether the user is an Official Discord System user (part of the urgent message system)identify
mfa_enabled?booleanwhether the user has two factor enabled on their accountidentify
banner??stringthe user’s banner hashidentify
accent_color??integerthe user’s banner color encoded as an integer representation of hexadecimal color codeidentify
locale?stringthe user’s chosen language optionidentify
verified?booleanwhether the email on this account has been verifiedemail
email??stringthe user’s emailemail
flags?integerthe flags on a user’s accountidentify
premium_type?integerthe type of Nitro subscription on a user’s accountidentify
public_flags?integerthe public flags on a user’s accountidentify
avatar_decoration_data??avatar decoration data objectdata for the user’s avatar decorationidentify
collectibles??collectibles objectdata for the user’s collectiblesidentify
primary_guild??user primary guild objectthe user’s primary guildidentify
Example User
{
  "id": "80351110224678912",
  "username": "Nelly",
  "global_name": null,
  "discriminator": "1337",
  "avatar": "8342729096ea3675442027381ff50dfe",
  "verified": true,
  "email": "nelly@discord.com",
  "flags": 64,
  "banner": "06c16474723fe537c283b8efa61a30c8",
  "accent_color": 16711680,
  "premium_type": 1,
  "public_flags": 64,
  "avatar_decoration_data": {
    "sku_id": "1144058844004233369",
    "asset": "a_fed43ab12698df65902ba06727e20c0e"
  },
  "collectibles": {
    "nameplate": {
      "sku_id": "2247558840304243311",
      "asset": "nameplates/nameplates/twilight/",
      "label": "",
      "palette": "cobalt"
    }
  },
  "primary_guild": {
    "identity_guild_id": "1234647491267808778",
    "identity_enabled": true,
    "tag": "DISC",
    "badge": "7d1734ae5a615e82bc7a4033b98fade8"
  }
}
User Flags
ValueNameDescription
1 << 0STAFFDiscord Employee
1 << 1PARTNERPartnered Server Owner
1 << 2HYPESQUADHypeSquad Events Member
1 << 3BUG_HUNTER_LEVEL_1Bug Hunter Level 1
1 << 6HYPESQUAD_ONLINE_HOUSE_1House Bravery Member
1 << 7HYPESQUAD_ONLINE_HOUSE_2House Brilliance Member
1 << 8HYPESQUAD_ONLINE_HOUSE_3House Balance Member
1 << 9PREMIUM_EARLY_SUPPORTEREarly Nitro Supporter
1 << 10TEAM_PSEUDO_USERUser is a team
1 << 14BUG_HUNTER_LEVEL_2Bug Hunter Level 2
1 << 16VERIFIED_BOTVerified Bot
1 << 17VERIFIED_DEVELOPEREarly Verified Bot Developer
1 << 18CERTIFIED_MODERATORModerator Programs Alumni
1 << 19BOT_HTTP_INTERACTIONSBot uses only HTTP interactions and is shown in the online member list
1 << 22ACTIVE_DEVELOPERUser is an Active Developer
Premium Types
Premium types denote the level of premium a user has. Visit the Nitro page to learn more about the premium plans we currently offer.
ValueName
0None
1Nitro Classic
2Nitro
3Nitro Basic
User Primary Guild
FieldTypeDescription
identity_guild_id?snowflakethe id of the user’s primary guild
identity_enabled?booleanwhether the user is displaying the primary guild’s server tag. This can be null if the system clears the identity, e.g. the server no longer supports tags. This will be false if the user manually removes their tag.
tag?stringthe text of the user’s server tag. Limited to 4 characters
badge?stringthe server tag badge hash

Avatar Decoration Data Object

The data for the user’s avatar decoration.
Avatar Decoration Data Structure
FieldTypeDescription
assetstringthe avatar decoration hash
sku_idsnowflakeid of the avatar decoration’s SKU

Collectibles

The collectibles the user has, excluding Avatar Decorations and Profile Effects.
Collectible Structure
FieldTypeDescription
nameplate?objectobject mapping of nameplate data

Nameplate

The nameplate the user has.
Nameplate Structure
FieldTypeDescription
sku_idsnowflakeid of the nameplate SKU
assetstringpath to the nameplate asset
labelstringthe label of this nameplate. Currently unused
palettestringbackground color of the nameplate, one of: crimson, berry, sky, teal, forest, bubble_gum, violet, cobalt, clover, lemon, white

Connection Object

The connection object that the user has attached.
Connection Structure
FieldTypeDescription
idstringid of the connection account
namestringthe username of the connection account
typestringthe service of this connection
revoked?booleanwhether the connection is revoked
integrations?arrayan array of partial server integrations
verifiedbooleanwhether the connection is verified
friend_syncbooleanwhether friend sync is enabled for this connection
show_activitybooleanwhether activities related to this connection will be shown in presence updates
two_way_linkbooleanwhether this connection has a corresponding third party OAuth2 token
visibilityintegervisibility of this connection
Services
ValueName
amazon-musicAmazon Music
battlenetBattle.net
bungieBungie.net
blueskyBluesky
crunchyrollCrunchyroll
domainDomain
ebayeBay
epicgamesEpic Games
facebookFacebook
githubGitHub
instagram *Instagram
leagueoflegendsLeague of Legends
mastodonMastodon
paypalPayPal
playstationPlayStation Network
redditReddit
riotgamesRiot Games
robloxRoblox
spotifySpotify
skype *Skype
steamSteam
tiktokTikTok
twitchTwitch
twitterX (Twitter)
xboxXbox
youtubeYouTube
* Service can no longer be added by users
Visibility Types
ValueNameDescription
0Noneinvisible to everyone except the user themselves
1Everyonevisible to everyone

Application Role Connection Object

The role connection object that an application has attached to a user.
Application Role Connection Structure
FieldTypeDescription
platform_name?stringthe vanity name of the platform a bot has connected (max 50 characters)
metadataobjectobject mapping application role connection metadata keys to their string-ified value (max 100 characters) for the user on the platform a bot has connected

Get Current User

GET/users/@me
Returns the user object of the requester’s account. For OAuth2, this requires the identify scope, which will return the object without an email, and optionally the email scope, which returns the object with an email if the user has one.

Get User

GET/users/{user.id}
Returns a user object for a given user ID.

Modify Current User

PATCH/users/@me
Modify the requester’s user account settings. Returns a user object on success. Fires a User Update Gateway event.
All parameters to this endpoint are optional.
JSON Params
FieldTypeDescription
usernamestringuser’s username, if changed may cause the user’s discriminator to be randomized.
avatar?image dataif passed, modifies the user’s avatar
banner?image dataif passed, modifies the user’s banner

Get Current User Guilds

GET/users/@me/guilds
Returns a list of partial guild objects the current user is a member of. For OAuth2, requires the guilds scope.
Example Partial Guild
{
  "id": "80351110224678912",
  "name": "1337 Krew",
  "icon": "8342729096ea3675442027381ff50dfe",
  "banner": "bb42bdc37653b7cf58c4c8cc622e76cb",
  "owner": true,
  "permissions": "36953089",
  "features": ["COMMUNITY", "NEWS", "ANIMATED_ICON", "INVITE_SPLASH", "BANNER", "ROLE_ICONS"],
  "approximate_member_count": 3268,
  "approximate_presence_count": 784
}
This endpoint returns 200 guilds by default, which is the maximum number of guilds a non-bot user can join. Therefore, pagination is not needed for integrations that need to get a list of the users’ guilds.
Query String Params
FieldTypeDescriptionRequiredDefault
beforesnowflakeget guilds before this guild IDfalseabsent
aftersnowflakeget guilds after this guild IDfalseabsent
limitintegermax number of guilds to return (1-200)false200
with_countsbooleaninclude approximate member and presence counts in responsefalsefalse

Get Current User Guild Member

GET/users/@me/guilds/{guild.id}/member
Returns a guild member object for the current user. Requires the guilds.members.read OAuth2 scope.

Leave Guild

DELETE/users/@me/guilds/{guild.id}
Leave a guild. Returns a 204 empty response on success. Fires a Guild Delete Gateway event and a Guild Member Remove Gateway event.

Create DM

POST/users/@me/channels
Create a new DM channel with a user. Returns a DM channel object (if one already exists, it will be returned instead).
You should not use this endpoint to DM everyone in a server about something. DMs should generally be initiated by a user action. If you open a significant amount of DMs too quickly, your bot may be rate limited or blocked from opening new ones.
JSON Params
FieldTypeDescription
recipient_idsnowflakethe recipient to open a DM channel with

Create Group DM

POST/users/@me/channels
Create a new group DM channel with multiple users. Returns a DM channel object. This endpoint was intended to be used with the now-deprecated GameBridge SDK. Fires a Channel Create Gateway event.
This endpoint is limited to 10 active group DMs.
JSON Params
FieldTypeDescription
access_tokensarray of stringsaccess tokens of users that have granted your app the gdm.join scope
nicksdicta dictionary of user ids to their respective nicknames

Get Current User Connections

GET/users/@me/connections
Returns a list of connection objects. Requires the connections OAuth2 scope.

Get Current User Application Role Connection

GET/users/@me/applications/{application.id}/role-connection
Returns the application role connection for the user. Requires an OAuth2 access token with role_connections.write scope for the application specified in the path.

Update Current User Application Role Connection

PUT/users/@me/applications/{application.id}/role-connection
Updates and returns the application role connection for the user. Requires an OAuth2 access token with role_connections.write scope for the application specified in the path.
JSON Params
FieldTypeDescription
platform_name?stringthe vanity name of the platform a bot has connected (max 50 characters)
platform_username?stringthe username on the platform a bot has connected (max 100 characters)
metadata?objectobject mapping application role connection metadata keys to their string-ified value (max 100 characters) for the user on the platform a bot has connected