Guild Resource

Guilds in Discord represent an isolated collection of users and channels, and are often referred to as "servers" in the UI.

Guild Object

Guild Structure
FieldTypeDescription
idsnowflakeguild id
namestringguild name (2-100 characters, excluding trailing and leading whitespace)
icon?stringicon hash
icon_hash??stringicon hash, returned when in the template object
splash?stringsplash hash
discovery_splash?stringdiscovery splash hash; only present for guilds with the "DISCOVERABLE" feature
owner? **booleantrue if the user is the owner of the guild
owner_idsnowflakeid of owner
permissions? **stringtotal permissions for the user in the guild (excludes overwrites)
region? ***?stringvoice region id for the guild (deprecated)
afk_channel_id?snowflakeid of afk channel
afk_timeoutintegerafk timeout in seconds
widget_enabled?booleantrue if the server widget is enabled
widget_channel_id??snowflakethe channel id that the widget will generate an invite to, or null if set to no invite
verification_levelintegerverification level required for the guild
default_message_notificationsintegerdefault message notifications level
explicit_content_filterintegerexplicit content filter level
rolesarray of role objectsroles in the guild
emojisarray of emoji objectscustom guild emojis
featuresarray of guild feature stringsenabled guild features
mfa_levelintegerrequired MFA level for the guild
application_id?snowflakeapplication id of the guild creator if it is bot-created
system_channel_id?snowflakethe id of the channel where guild notices such as welcome messages and boost events are posted
system_channel_flagsintegersystem channel flags
rules_channel_id?snowflakethe id of the channel where Community guilds can display rules and/or guidelines
joined_at? *ISO8601 timestampwhen this guild was joined at
large? *booleantrue if this is considered a large guild
unavailable? *booleantrue if this guild is unavailable due to an outage
member_count? *integertotal number of members in this guild
voice_states? *array of partial voice state objectsstates of members currently in voice channels; lacks the guild_id key
members? *array of guild member objectsusers in the guild
channels? *array of channel objectschannels in the guild
threads? *array of channel objectsall active threads in the guild that current user has permission to view
presences? *array of partial presence update objectspresences of the members in the guild, will only include non-offline members if the size is greater than large threshold
max_presences??integerthe maximum number of presences for the guild (null is always returned, apart from the largest of guilds)
max_members?integerthe maximum number of members for the guild
vanity_url_code?stringthe vanity url code for the guild
description?stringthe description of a Community guild
banner?stringbanner hash
premium_tierintegerpremium tier (Server Boost level)
premium_subscription_count?integerthe number of boosts this guild currently has
preferred_localestringthe preferred locale of a Community guild; used in server discovery and notices from Discord; defaults to "en-US"
public_updates_channel_id?snowflakethe id of the channel where admins and moderators of Community guilds receive notices from Discord
max_video_channel_users?integerthe maximum amount of users in a video channel
approximate_member_count?integerapproximate number of members in this guild, returned from the GET /guilds/<id> endpoint when with_counts is true
approximate_presence_count?integerapproximate number of non-offline members in this guild, returned from the GET /guilds/<id> endpoint when with_counts is true
welcome_screen?welcome screen objectthe welcome screen of a Community guild, shown to new members, returned in an Invite's guild object
nsfw_levelintegerguild NSFW level
stage_instances? *array of stage instance objectsStage instances in the guild
stickers?array of sticker objectscustom guild stickers

* These fields are only sent within the GUILD_CREATE event

** These fields are only sent when using the GET Current User Guilds endpoint and are relative to the requested user

*** This field is deprecated and will be removed in v9 and is replaced by rtc_region

Default Message Notification Level
KeyValueDescription
ALL_MESSAGES0members will receive notifications for all messages by default
ONLY_MENTIONS1members will receive notifications only for messages that @mention them by default
Explicit Content Filter Level
LevelIntegerDescription
DISABLED0media content will not be scanned
MEMBERS_WITHOUT_ROLES1media content sent by members without roles will be scanned
ALL_MEMBERS2media content sent by all members will be scanned
MFA Level
LevelIntegerDescription
NONE0guild has no MFA/2FA requirement for moderation actions
ELEVATED1guild has a 2FA requirement for moderation actions
Verification Level
LevelIntegerDescription
NONE0unrestricted
LOW1must have verified email on account
MEDIUM2must be registered on Discord for longer than 5 minutes
HIGH3must be a member of the server for longer than 10 minutes
VERY_HIGH4must have a verified phone number
Guild NSFW Level
LevelValue
DEFAULT0
EXPLICIT1
SAFE2
AGE_RESTRICTED3
Premium Tier
LevelIntegerDescription
NONE0guild has not unlocked any Server Boost perks
TIER_11guild has unlocked Server Boost level 1 perks
TIER_22guild has unlocked Server Boost level 2 perks
TIER_33guild has unlocked Server Boost level 3 perks
System Channel Flags
FlagValueDescription
SUPPRESS_JOIN_NOTIFICATIONS1 << 0Suppress member join notifications
SUPPRESS_PREMIUM_SUBSCRIPTIONS1 << 1Suppress server boost notifications
SUPPRESS_GUILD_REMINDER_NOTIFICATIONS1 << 2Suppress server setup tips
Guild Features
FeatureDescription
ANIMATED_ICONguild has access to set an animated guild icon
BANNERguild has access to set a guild banner image
COMMERCEguild has access to use commerce features (i.e. create store channels)
COMMUNITYguild can enable welcome screen, Membership Screening, stage channels and discovery, and receives community updates
DISCOVERABLEguild is able to be discovered in the directory
FEATURABLEguild is able to be featured in the directory
INVITE_SPLASHguild has access to set an invite splash background
MEMBER_VERIFICATION_GATE_ENABLEDguild has enabled Membership Screening
NEWSguild has access to create news channels
PARTNEREDguild is partnered
PREVIEW_ENABLEDguild can be previewed before joining via Membership Screening or the directory
VANITY_URLguild has access to set a vanity URL
VERIFIEDguild is verified
VIP_REGIONSguild has access to set 384kbps bitrate in voice (previously VIP voice servers)
WELCOME_SCREEN_ENABLEDguild has enabled the welcome screen
TICKETED_EVENTS_ENABLEDguild has enabled ticketed events
MONETIZATION_ENABLEDguild has enabled monetization
MORE_STICKERSguild has increased custom sticker slots
THREE_DAY_THREAD_ARCHIVEguild has access to the three day archive time for threads
SEVEN_DAY_THREAD_ARCHIVEguild has access to the seven day archive time for threads
PRIVATE_THREADSguild has access to create private threads
Example Guild
json
{
"id": "197038439483310086",
"name": "Discord Testers",
"icon": "f64c482b807da4f539cff778d174971c",
"description": "The official place to report Discord Bugs!",
"splash": null,
"discovery_splash": null,
"features": [
"ANIMATED_ICON",
"VERIFIED",
"NEWS",
"VANITY_URL",
"DISCOVERABLE",
"MORE_EMOJI",
"INVITE_SPLASH",
"BANNER",
"COMMUNITY"
],
"emojis": [],
"banner": "9b6439a7de04f1d26af92f84ac9e1e4a",
"owner_id": "73193882359173120",
"application_id": null,
"region": null,
"afk_channel_id": null,
"afk_timeout": 300,
"system_channel_id": null,
"widget_enabled": true,
"widget_channel_id": null,
"verification_level": 3,
"roles": [],
"default_message_notifications": 1,
"mfa_level": 1,
"explicit_content_filter": 2,
"max_presences": 40000,
"max_members": 250000,
"vanity_url_code": "discord-testers",
"premium_tier": 3,
"premium_subscription_count": 33,
"system_channel_flags": 0,
"preferred_locale": "en-US",
"rules_channel_id": "441688182833020939",
"public_updates_channel_id": "281283303326089216"
}

Unavailable Guild Object

A partial guild object. Represents an Offline Guild, or a Guild whose information has not been provided through Guild Create events during the Gateway connect.

Example Unavailable Guild
json
{
"id": "41771983423143937",
"unavailable": true
}

Guild Preview Object

Guild Preview Structure
FieldTypeDescription
idsnowflakeguild id
namestringguild name (2-100 characters)
icon?stringicon hash
splash?stringsplash hash
discovery_splash?stringdiscovery splash hash
emojisarray of emoji objectscustom guild emojis
featuresarray of guild feature stringsenabled guild features
approximate_member_countintegerapproximate number of members in this guild
approximate_presence_countintegerapproximate number of online members in this guild
description?stringthe description for the guild, if the guild is discoverable
Example Guild Preview
json
{
"id": "197038439483310086",
"name": "Discord Testers",
"icon": "f64c482b807da4f539cff778d174971c",
"splash": null,
"discovery_splash": null,
"emojis": [],
"features": [
"DISCOVERABLE",
"VANITY_URL",
"ANIMATED_ICON",
"INVITE_SPLASH",
"NEWS",
"COMMUNITY",
"BANNER",
"VERIFIED",
"MORE_EMOJI"
],
"approximate_member_count": 60814,
"approximate_presence_count": 20034,
"description": "The official place to report Discord Bugs!"
}

Guild Widget Object

Guild Widget Structure
FieldTypeDescription
enabledbooleanwhether the widget is enabled
channel_id?snowflakethe widget channel id
Example Guild Widget
json
{
"enabled": true,
"channel_id": "41771983444115456"
}

Guild Member Object

Guild Member Structure
FieldTypeDescription
user?user objectthe user this guild member represents
nick??stringthis users guild nickname
rolesarray of snowflakesarray of role object ids
joined_atISO8601 timestampwhen the user joined the guild
premium_since??ISO8601 timestampwhen the user started boosting the guild
deafbooleanwhether the user is deafened in voice channels
mutebooleanwhether the user is muted in voice channels
pending?booleanwhether the user has not yet passed the guild's Membership Screening requirements
permissions?stringtotal permissions of the member in the channel, including overwrites, returned when in the interaction object
Example Guild Member
json
{
"user": {},
"nick": "NOT API SUPPORT",
"roles": [],
"joined_at": "2015-04-26T06:26:56.936000+00:00",
"deaf": false,
"mute": false
}

Integration Object

Integration Structure
FieldTypeDescription
idsnowflakeintegration id
namestringintegration name
typestringintegration type (twitch, youtube, or discord)
enabledbooleanis this integration enabled
syncing? *booleanis this integration syncing
role_id? *snowflakeid that this integration uses for "subscribers"
enable_emoticons? *booleanwhether emoticons should be synced for this integration (twitch only currently)
expire_behavior? *integration expire behaviorthe behavior of expiring subscribers
expire_grace_period? *integerthe grace period (in days) before expiring subscribers
user? *user objectuser for this integration
accountaccount objectintegration account information
synced_at? *ISO8601 timestampwhen this integration was last synced
subscriber_count? *integerhow many subscribers this integration has
revoked? *booleanhas this integration been revoked
application?application objectThe bot/OAuth2 application for discord integrations

* These fields are not provided for discord bot integrations.

Integration Expire Behaviors
ValueName
0Remove role
1Kick

Integration Account Object

Integration Account Structure
FieldTypeDescription
idstringid of the account
namestringname of the account

Integration Application Object

Integration Application Structure
FieldTypeDescription
idsnowflakethe id of the app
namestringthe name of the app
icon?stringthe icon hash of the app
descriptionstringthe description of the app
summarystringthe summary of the app
bot?user objectthe bot associated with this application

Ban Object

Ban Structure
FieldTypeDescription
reason?stringthe reason for the ban
useruser objectthe banned user
Example Ban
json
{
"reason": "mentioning b1nzy",
"user": {
"username": "Mason",
"discriminator": "9999",
"id": "53908099506183680",
"avatar": "a_bab14f271d565501444b2ca3be944b25",
"public_flags": 131141
}
}

Welcome Screen Object

Welcome Screen Structure
FieldTypeDescription
description?stringthe server description shown in the welcome screen
welcome_channelsarray of welcome screen channel objectsthe channels shown in the welcome screen, up to 5
Welcome Screen Channel Structure
FieldTypeDescription
channel_idsnowflakethe channel's id
descriptionstringthe description shown for the channel
emoji_id?snowflakethe emoji id, if the emoji is custom
emoji_name?stringthe emoji name if custom, the unicode character if standard, or null if no emoji is set
Example Welcome Screen
json
{
"description": "Discord Developers is a place to learn about Discord's API, bots, and SDKs and integrations. This is NOT a general Discord support server.",
"welcome_channels": [
{
"channel_id": "697138785317814292",
"description": "Follow for official Discord API updates",
"emoji_id": null,
"emoji_name": "📡"
},
{
"channel_id": "697236247739105340",
"description": "Get help with Bot Verifications",
"emoji_id": null,
"emoji_name": "📸"
},
{
"channel_id": "697489244649816084",
"description": "Create amazing things with Discord's API",
"emoji_id": null,
"emoji_name": "🔬"
},
{
"channel_id": "613425918748131338",
"description": "Integrate Discord into your game",
"emoji_id": null,
"emoji_name": "🎮"
},
{
"channel_id": "646517734150242346",
"description": "Find more places to help you on your quest",
"emoji_id": null,
"emoji_name": "🔦"
}
]
}

Membership Screening Object

In guilds with Membership Screening enabled, when a member joins, Guild Member Add will be emitted but they will initially be restricted from doing any actions in the guild, and pending will be true in the member object. When the member completes the screening, Guild Member Update will be emitted and pending will be false.

Giving the member a role will bypass Membership Screening as well as the guild's verification level, giving the member immediate access to chat. Therefore, instead of giving a role when the member joins, it is recommended to not give the role until the user is no longer pending.

Endpoints

Create Guild

POST/guilds

Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event.

JSON Params
FieldTypeDescription
namestringname of the guild (2-100 characters)
region??stringvoice region id (deprecated)
icon?image database64 128x128 image for the guild icon
verification_level?integerverification level
default_message_notifications?integerdefault message notification level
explicit_content_filter?integerexplicit content filter level
roles?array of role objectsnew guild roles
channels?array of partial channel objectsnew guild's channels
afk_channel_id?snowflakeid for afk channel
afk_timeout?integerafk timeout in seconds
system_channel_id?snowflakethe id of the channel where guild notices such as welcome messages and boost events are posted
system_channel_flags?integersystem channel flags
Example Partial Channel Object
json
{
"name": "naming-things-is-hard",
"type": 0
}
Example Category Channel
json
{
"name": "my-category",
"type": 4,
"id": 1
}
{
"name": "naming-things-is-hard",
"type": 0,
"id": 2,
"parent_id": 1
}

Get Guild

GET/guilds/{guild.id}

Returns the guild object for the given id. If with_counts is set to true, this endpoint will also return approximate_member_count and approximate_presence_count for the guild.

Query String Params
FieldTypeDescriptionRequiredDefault
with_counts?booleanwhen true, will return approximate member and presence counts for the guildfalsefalse
Example Response
json
{
"id": "2909267986263572999",
"name": "Mason's Test Server",
"icon": "389030ec9db118cb5b85a732333b7c98",
"description": null,
"splash": "75610b05a0dd09ec2c3c7df9f6975ea0",
"discovery_splash": null,
"approximate_member_count": 2,
"approximate_presence_count": 2,
"features": ["INVITE_SPLASH", "VANITY_URL", "COMMERCE", "BANNER", "NEWS", "VERIFIED", "VIP_REGIONS"],
"emojis": [
{
"name": "ultrafastparrot",
"roles": [],
"id": "393564762228785161",
"require_colons": true,
"managed": false,
"animated": true,
"available": true
}
],
"banner": "5c3cb8d1bc159937fffe7e641ec96ca7",
"owner_id": "53908232506183680",
"application_id": null,
"region": null,
"afk_channel_id": null,
"afk_timeout": 300,
"system_channel_id": null,
"widget_enabled": true,
"widget_channel_id": "639513352485470208",
"verification_level": 0,
"roles": [
{
"id": "2909267986263572999",
"name": "@everyone",
"permissions": "49794752",
"position": 0,
"color": 0,
"hoist": false,
"managed": false,
"mentionable": false
}
],
"default_message_notifications": 1,
"mfa_level": 0,
"explicit_content_filter": 0,
"max_presences": null,
"max_members": 250000,
"max_video_channel_users": 25,
"vanity_url_code": "no",
"premium_tier": 0,
"premium_subscription_count": 0,
"system_channel_flags": 0,
"preferred_locale": "en-US",
"rules_channel_id": null,
"public_updates_channel_id": null
}

Get Guild Preview

GET/guilds/{guild.id}/preview

Returns the guild preview object for the given id. If the user is not in the guild, then the guild must be lurkable (it must be Discoverable or have a live public stage).

Modify Guild

PATCH/guilds/{guild.id}

Modify a guild's settings. Requires the MANAGE_GUILD permission. Returns the updated guild object on success. Fires a Guild Update Gateway event.

JSON Params
FieldTypeDescription
namestringguild name
region?stringguild voice region id (deprecated)
verification_level?integerverification level
default_message_notifications?integerdefault message notification level
explicit_content_filter?integerexplicit content filter level
afk_channel_id?snowflakeid for afk channel
afk_timeoutintegerafk timeout in seconds
icon?image database64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the server has the ANIMATED_ICON feature)
owner_idsnowflakeuser id to transfer guild ownership to (must be owner)
splash?image database64 16:9 png/jpeg image for the guild splash (when the server has the INVITE_SPLASH feature)
discovery_splash?image database64 16:9 png/jpeg image for the guild discovery splash (when the server has the DISCOVERABLE feature)
banner?image database64 16:9 png/jpeg image for the guild banner (when the server has the BANNER feature)
system_channel_id?snowflakethe id of the channel where guild notices such as welcome messages and boost events are posted
system_channel_flagsintegersystem channel flags
rules_channel_id?snowflakethe id of the channel where Community guilds display rules and/or guidelines
public_updates_channel_id?snowflakethe id of the channel where admins and moderators of Community guilds receive notices from Discord
preferred_locale?stringthe preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US"
featuresarray of guild feature stringsenabled guild features
description?stringthe description for the guild, if the guild is discoverable

Delete Guild

DELETE/guilds/{guild.id}

Delete a guild permanently. User must be owner. Returns 204 No Content on success. Fires a Guild Delete Gateway event.

Get Guild Channels

GET/guilds/{guild.id}/channels

Returns a list of guild channel objects. Does not include threads.

Create Guild Channel

POST/guilds/{guild.id}/channels

Create a new channel object for the guild. Requires the MANAGE_CHANNELS permission. If setting permission overwrites, only permissions your bot has in the guild can be allowed/denied. Setting MANAGE_ROLES permission in channels is only possible for guild administrators. Returns the new channel object on success. Fires a Channel Create Gateway event.

JSON Params
FieldTypeDescription
namestringchannel name (1-100 characters)
typeintegerthe type of channel
topicstringchannel topic (0-1024 characters)
bitrateintegerthe bitrate (in bits) of the voice channel (voice only)
user_limitintegerthe user limit of the voice channel (voice only)
rate_limit_per_userintegeramount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages or manage_channel, are unaffected
positionintegersorting position of the channel
permission_overwritesarray of overwrite objectsthe channel's permission overwrites
parent_idsnowflakeid of the parent category for a channel
nsfwbooleanwhether the channel is nsfw

Modify Guild Channel Positions

PATCH/guilds/{guild.id}/channels

Modify the positions of a set of channel objects for the guild. Requires MANAGE_CHANNELS permission. Returns a 204 empty response on success. Fires multiple Channel Update Gateway events.

This endpoint takes a JSON array of parameters in the following format:

JSON Params
FieldTypeDescription
idsnowflakechannel id
position?integersorting position of the channel
lock_permissions?booleansyncs the permission overwrites with the new parent, if moving to a new category
parent_id?snowflakethe new parent ID for the channel that is moved

List Active Threads

GET/guilds/{guild.id}/threads/active

Returns all active threads in the guild, including public and private threads. Threads are ordered by their id, in descending order.

Response Body
FieldTypeDescription
threadsarray of channel objectsthe active threads
membersarray of thread members objectsa thread member object for each returned thread the current user has joined

Get Guild Member

GET/guilds/{guild.id}/members/{user.id}

Returns a guild member object for the specified user.

List Guild Members

GET/guilds/{guild.id}/members

Returns a list of guild member objects that are members of the guild.

Query String Params
FieldTypeDescriptionDefault
limitintegermax number of members to return (1-1000)1
aftersnowflakethe highest user id in the previous page0

Search Guild Members

GET/guilds/{guild.id}/members/search

Returns a list of guild member objects whose username or nickname starts with a provided string.

Query String Params
FieldTypeDescriptionDefault
querystringQuery string to match username(s) and nickname(s) against.
limitintegermax number of members to return (1-1000)1

Add Guild Member

PUT/guilds/{guild.id}/members/{user.id}

Adds a user to the guild, provided you have a valid oauth2 access token for the user with the guilds.join scope. Returns a 201 Created with the guild member as the body, or 204 No Content if the user is already a member of the guild. Fires a Guild Member Add Gateway event.

For guilds with Membership Screening enabled, this endpoint will default to adding new members as pending in the guild member object. Members that are pending will have to complete membership screening before they become full members that can talk.

JSON Params
FieldTypeDescriptionPermission
access_tokenstringan oauth2 access token granted with the guilds.join to the bot's application for the user you want to add to the guild
nickstringvalue to set users nickname toMANAGE_NICKNAMES
rolesarray of snowflakesarray of role ids the member is assignedMANAGE_ROLES
mutebooleanwhether the user is muted in voice channelsMUTE_MEMBERS
deafbooleanwhether the user is deafened in voice channelsDEAFEN_MEMBERS

Modify Guild Member

PATCH/guilds/{guild.id}/members/{user.id}

Modify attributes of a guild member. Returns a 200 OK with the guild member as the body. Fires a Guild Member Update Gateway event. If the channel_id is set to null, this will force the target user to be disconnected from voice.

JSON Params
FieldTypeDescriptionPermission
nickstringvalue to set users nickname toMANAGE_NICKNAMES
rolesarray of snowflakesarray of role ids the member is assignedMANAGE_ROLES
mutebooleanwhether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channelMUTE_MEMBERS
deafbooleanwhether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channelDEAFEN_MEMBERS
channel_idsnowflakeid of channel to move user to (if they are connected to voice)MOVE_MEMBERS

Modify Current User Nick

PATCH/guilds/{guild.id}/members/@me/nick

Modifies the nickname of the current user in a guild. Returns a 200 with the nickname on success. Fires a Guild Member Update Gateway event.

JSON Params
FieldTypeDescriptionPermission
?nick?stringvalue to set users nickname toCHANGE_NICKNAME

Add Guild Member Role

PUT/guilds/{guild.id}/members/{user.id}/roles/{role.id}

Adds a role to a guild member. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Guild Member Update Gateway event.

Remove Guild Member Role

DELETE/guilds/{guild.id}/members/{user.id}/roles/{role.id}

Removes a role from a guild member. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Guild Member Update Gateway event.

Remove Guild Member

DELETE/guilds/{guild.id}/members/{user.id}

Remove a member from a guild. Requires KICK_MEMBERS permission. Returns a 204 empty response on success. Fires a Guild Member Remove Gateway event.

Get Guild Bans

GET/guilds/{guild.id}/bans

Returns a list of ban objects for the users banned from this guild. Requires the BAN_MEMBERS permission.

Get Guild Ban

GET/guilds/{guild.id}/bans/{user.id}

Returns a ban object for the given user or a 404 not found if the ban cannot be found. Requires the BAN_MEMBERS permission.

Create Guild Ban

PUT/guilds/{guild.id}/bans/{user.id}

Create a guild ban, and optionally delete previous messages sent by the banned user. Requires the BAN_MEMBERS permission. Returns a 204 empty response on success. Fires a Guild Ban Add Gateway event.

JSON Params
FieldTypeDescription
delete_message_days?integernumber of days to delete messages for (0-7)
reason?stringreason for the ban (deprecated)

Remove Guild Ban

DELETE/guilds/{guild.id}/bans/{user.id}

Remove the ban for a user. Requires the BAN_MEMBERS permissions. Returns a 204 empty response on success. Fires a Guild Ban Remove Gateway event.

Get Guild Roles

GET/guilds/{guild.id}/roles

Returns a list of role objects for the guild.

Create Guild Role

POST/guilds/{guild.id}/roles

Create a new role for the guild. Requires the MANAGE_ROLES permission. Returns the new role object on success. Fires a Guild Role Create Gateway event. All JSON params are optional.

JSON Params
FieldTypeDescriptionDefault
namestringname of the role"new role"
permissionsstringbitwise value of the enabled/disabled permissions@everyone permissions in guild
colorintegerRGB color value0
hoistbooleanwhether the role should be displayed separately in the sidebarfalse
mentionablebooleanwhether the role should be mentionablefalse

Modify Guild Role Positions

PATCH/guilds/{guild.id}/roles

Modify the positions of a set of role objects for the guild. Requires the MANAGE_ROLES permission. Returns a list of all of the guild's role objects on success. Fires multiple Guild Role Update Gateway events.

This endpoint takes a JSON array of parameters in the following format:

JSON Params
FieldTypeDescription
idsnowflakerole
?position?integersorting position of the role

Modify Guild Role

PATCH/guilds/{guild.id}/roles/{role.id}

Modify a guild role. Requires the MANAGE_ROLES permission. Returns the updated role on success. Fires a Guild Role Update Gateway event.

JSON Params
FieldTypeDescription
namestringname of the role
permissionsstringbitwise value of the enabled/disabled permissions
colorintegerRGB color value
hoistbooleanwhether the role should be displayed separately in the sidebar
mentionablebooleanwhether the role should be mentionable

Delete Guild Role

DELETE/guilds/{guild.id}/roles/{role.id}

Delete a guild role. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Guild Role Delete Gateway event.

Get Guild Prune Count

GET/guilds/{guild.id}/prune

Returns an object with one 'pruned' key indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS permission.

By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles parameter. Any inactive user that has a subset of the provided role(s) will be counted in the prune and users with additional roles will not.

Query String Params
FieldTypeDescriptionDefault
daysintegernumber of days to count prune for (1-30)7
include_rolesstring; comma-delimited array of snowflakesrole(s) to includenone

Begin Guild Prune

POST/guilds/{guild.id}/prune

Begin a prune operation. Requires the KICK_MEMBERS permission. Returns an object with one 'pruned' key indicating the number of members that were removed in the prune operation. For large guilds it's recommended to set the compute_prune_count option to false, forcing 'pruned' to null. Fires multiple Guild Member Remove Gateway events.

By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles parameter. Any inactive user that has a subset of the provided role(s) will be included in the prune and users with additional roles will not.

JSON Params
FieldTypeDescriptionDefault
daysintegernumber of days to prune (1-30)7
compute_prune_countbooleanwhether 'pruned' is returned, discouraged for large guildstrue
include_rolesarray of snowflakesrole(s) to includenone
reason?stringreason for the prune (deprecated)

Get Guild Voice Regions

GET/guilds/{guild.id}/regions

Returns a list of voice region objects for the guild. Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.

Get Guild Invites

GET/guilds/{guild.id}/invites

Returns a list of invite objects (with invite metadata) for the guild. Requires the MANAGE_GUILD permission.

Get Guild Integrations

GET/guilds/{guild.id}/integrations

Returns a list of integration objects for the guild. Requires the MANAGE_GUILD permission.

Delete Guild Integration

DELETE/guilds/{guild.id}/integrations/{integration.id}

Delete the attached integration object for the guild. Deletes any associated webhooks and kicks the associated bot if there is one. Requires the MANAGE_GUILD permission. Returns a 204 empty response on success. Fires a Guild Integrations Update Gateway event.

Get Guild Widget Settings

GET/guilds/{guild.id}/widget

Returns a guild widget object. Requires the MANAGE_GUILD permission.

Modify Guild Widget

PATCH/guilds/{guild.id}/widget

Modify a guild widget object for the guild. All attributes may be passed in with JSON and modified. Requires the MANAGE_GUILD permission. Returns the updated guild widget object.

Get Guild Widget

GET/guilds/{guild.id}/widget.json

Returns the widget for the guild.

Example Get Guild Widget
json
{
"id": "290926798626999250",
"name": "Test Server",
"instant_invite": "https://discord.com/invite/abcdefg",
"channels": [
{
"id": "705216630279993882",
"name": "elephant",
"position": 2
},
{
"id": "669583461748992190",
"name": "groovy-music",
"position": 1
}
],
"members": [
{
"id": "0",
"username": "1234",
"discriminator": "0000",
"avatar": null,
"status": "online",
"avatar_url": "https://cdn.discordapp.com/widget-avatars/FfvURgcr3Za92K3JtoCppqnYMppMDc5B-Rll74YrGCU/C-1DyBZPQ6t5q2RuATFuMFgq0_uEMZVzd_6LbGN_uJKvZflobA9diAlTjhf6CAESLLeTuu4dLuHFWOb_PNLteooNfhC4C6k5QgAGuxEOP12tVVVCvX6t64k14PMXZrGTDq8pWZhukP40Wg"
}
],
"presence_count": 1
}

Get Guild Vanity URL

GET/guilds/{guild.id}/vanity-url

Returns a partial invite object for guilds with that feature enabled. Requires the MANAGE_GUILD permission. code will be null if a vanity url for the guild is not set.

Example Partial Invite Object
json
{
"code": "abc",
"uses": 12
}

Get Guild Widget Image

GET/guilds/{guild.id}/widget.png

Returns a PNG image widget for the guild. Requires no permissions or authentication.

Query String Params
FieldTypeDescriptionDefault
stylestringstyle of the widget image returned (see below)shield
Widget Style Options
ValueDescriptionExample
shieldshield style widget with Discord icon and guild members online countExample
banner1large image with guild icon, name and online count. "POWERED BY DISCORD" as the footer of the widgetExample
banner2smaller widget style with guild icon, name and online count. Split on the right with Discord logoExample
banner3large image with guild icon, name and online count. In the footer, Discord logo on the left and "Chat Now" on the rightExample
banner4large Discord logo at the top of the widget. Guild icon, name and online count in the middle portion of the widget and a "JOIN MY SERVER" button at the bottomExample

Get Guild Welcome Screen

GET/guilds/{guild.id}/welcome-screen

Returns the Welcome Screen object for the guild.

Modify Guild Welcome Screen

PATCH/guilds/{guild.id}/welcome-screen

Modify the guild's Welcome Screen. Requires the MANAGE_GUILD permission. Returns the updated Welcome Screen object.

JSON Params
FieldTypeDescription
enabledbooleanwhether the welcome screen is enabled
welcome_channelsarray of welcome screen channel objectschannels linked in the welcome screen and their display options
descriptionstringthe server description to show in the welcome screen

Modify Current User Voice State

PATCH/guilds/{guild.id}/voice-states/@me

Updates the current user's voice state.

JSON Params
FieldTypeDescription
channel_idsnowflakethe id of the channel the user is currently in
suppress?booleantoggles the user's suppress state
request_to_speak_timestamp??ISO8601 timestampsets the user's request to speak
Caveats

There are currently several caveats for this endpoint:

  • channel_id must currently point to a stage channel.
  • current user must already have joined channel_id.
  • You must have the MUTE_MEMBERS permission to unsuppress yourself. You can always suppress yourself.
  • You must have the REQUEST_TO_SPEAK permission to request to speak. You can always clear your own request to speak.
  • You are able to set request_to_speak_timestamp to any present or future time.

Modify User Voice State

PATCH/guilds/{guild.id}/voice-states/{user.id}

Updates another user's voice state.

JSON Params
FieldTypeDescription
channel_idsnowflakethe id of the channel the user is currently in
suppress?booleantoggles the user's suppress state
Caveats

There are currently several caveats for this endpoint:

  • channel_id must currently point to a stage channel.
  • User must already have joined channel_id.
  • You must have the MUTE_MEMBERS permission. (Since suppression is the only thing that is available currently.)
  • When unsuppressed, non-bot users will have their request_to_speak_timestamp set to the current time. Bot users will not.
  • When suppressed, the user will have their request_to_speak_timestamp removed.