Routes
constRoutes:object
Defined in: packages/rest/src/routes.ts:2
Discord REST API route definitions.
Type Declaration
Section titled “Type Declaration”applicationCommand
Section titled “applicationCommand”
readonlyapplicationCommand: (applicationId,commandId) =>string
Returns one application command.
Parameters
Section titled “Parameters”applicationId
Section titled “applicationId”string
Application identifier.
commandId
Section titled “commandId”string
Command identifier.
Returns
Section titled “Returns”string
Command route.
applicationCommands
Section titled “applicationCommands”
readonlyapplicationCommands: (applicationId) =>string
Returns application commands for an application.
Parameters
Section titled “Parameters”applicationId
Section titled “applicationId”string
Application identifier.
Returns
Section titled “Returns”string
Global command route.
applicationEmoji
Section titled “applicationEmoji”
readonlyapplicationEmoji: (applicationId,emojiId?) =>string
Returns application emojis, or a specific emoji.
Parameters
Section titled “Parameters”applicationId
Section titled “applicationId”string
Application identifier.
emojiId?
Section titled “emojiId?”string
Optional emoji identifier.
Returns
Section titled “Returns”string
applicationEntitlement
Section titled “applicationEntitlement”
readonlyapplicationEntitlement: (applicationId,entitlementId?) =>string
Returns an application’s entitlements, or one entitlement.
Parameters
Section titled “Parameters”applicationId
Section titled “applicationId”string
entitlementId?
Section titled “entitlementId?”string
Returns
Section titled “Returns”string
applicationSkus
Section titled “applicationSkus”
readonlyapplicationSkus: (applicationId) =>string
Returns an application’s SKUs.
Parameters
Section titled “Parameters”applicationId
Section titled “applicationId”string
Returns
Section titled “Returns”string
channel
Section titled “channel”
readonlychannel: (channelId) =>string
Returns a channel.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
Returns
Section titled “Returns”string
Channel route.
channelBulkDelete
Section titled “channelBulkDelete”
readonlychannelBulkDelete: (channelId) =>string
Bulk deletes messages.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
Returns
Section titled “Returns”string
Bulk-delete route.
channelInvites
Section titled “channelInvites”
readonlychannelInvites: (channelId) =>string
Returns channel invites.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
Returns
Section titled “Returns”string
Invite collection route.
channelJoinedPrivateArchivedThreads
Section titled “channelJoinedPrivateArchivedThreads”
readonlychannelJoinedPrivateArchivedThreads: (channelId) =>string
Returns the private archived threads the current user joined.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
Returns
Section titled “Returns”string
channelMessages
Section titled “channelMessages”
readonlychannelMessages: (channelId) =>string
Returns messages in a channel.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
Returns
Section titled “Returns”string
Message collection route.
channelMessagesPin
Section titled “channelMessagesPin”
readonlychannelMessagesPin: (channelId,messageId) =>string
Pins (PUT) or unpins (DELETE) a message.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
messageId
Section titled “messageId”string
Message identifier.
Returns
Section titled “Returns”string
Pin route.
channelMessagesPins
Section titled “channelMessagesPins”
readonlychannelMessagesPins: (channelId) =>string
Returns pinned messages, newest first, in pages of up to 50 (before, limit).
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
Returns
Section titled “Returns”string
Pins route.
channelPermission
Section titled “channelPermission”
readonlychannelPermission: (channelId,overwriteId) =>string
Returns a channel permission overwrite.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
overwriteId
Section titled “overwriteId”string
Role or user identifier.
Returns
Section titled “Returns”string
Permission overwrite route.
channelPrivateArchivedThreads
Section titled “channelPrivateArchivedThreads”
readonlychannelPrivateArchivedThreads: (channelId) =>string
Returns private archived threads for a channel.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
Returns
Section titled “Returns”string
Private-archive route.
channelPublicArchivedThreads
Section titled “channelPublicArchivedThreads”
readonlychannelPublicArchivedThreads: (channelId) =>string
Returns public archived threads for a channel.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
Returns
Section titled “Returns”string
Public-archive route.
channelThreads
Section titled “channelThreads”
readonlychannelThreads: (channelId) =>string
Creates a thread that is not tied to a message, or a forum or media post (POST).
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
Returns
Section titled “Returns”string
channelTyping
Section titled “channelTyping”
readonlychannelTyping: (channelId) =>string
Starts a typing indicator (POST).
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
Returns
Section titled “Returns”string
channelWebhooks
Section titled “channelWebhooks”
readonlychannelWebhooks: (channelId) =>string
Returns channel webhooks.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
Returns
Section titled “Returns”string
Webhook collection route.
consumeEntitlement
Section titled “consumeEntitlement”
readonlyconsumeEntitlement: (applicationId,entitlementId) =>string
Marks a one-time-purchase entitlement as consumed.
Parameters
Section titled “Parameters”applicationId
Section titled “applicationId”string
entitlementId
Section titled “entitlementId”string
Returns
Section titled “Returns”string
crosspostMessage
Section titled “crosspostMessage”
readonlycrosspostMessage: (channelId,messageId) =>string
Crossposts a message.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
messageId
Section titled “messageId”string
Message identifier.
Returns
Section titled “Returns”string
Crosspost route.
currentUserGuild
Section titled “currentUserGuild”
readonlycurrentUserGuild: (guildId) =>string
Leaves a guild as the current user (DELETE).
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
Current-user guild route.
gateway
Section titled “gateway”
readonlygateway: () =>string
Returns the generic Gateway endpoint.
Returns
Section titled “Returns”string
Gateway route.
gatewayBot
Section titled “gatewayBot”
readonlygatewayBot: () =>string
Returns the Gateway endpoint and recommended shard count for bots.
Returns
Section titled “Returns”string
Gateway bot route.
readonlyguild: (guildId) =>string
Returns a guild.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
Guild route.
guildActiveThreads
Section titled “guildActiveThreads”
readonlyguildActiveThreads: (guildId) =>string
Returns active threads for a guild.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
guildApplicationCommand
Section titled “guildApplicationCommand”
readonlyguildApplicationCommand: (applicationId,guildId,commandId) =>string
Returns a single guild application command.
Parameters
Section titled “Parameters”applicationId
Section titled “applicationId”string
Application identifier.
guildId
Section titled “guildId”string
Guild identifier.
commandId
Section titled “commandId”string
Command identifier.
Returns
Section titled “Returns”string
Guild command route.
guildApplicationCommands
Section titled “guildApplicationCommands”
readonlyguildApplicationCommands: (applicationId,guildId) =>string
Returns guild application commands.
Parameters
Section titled “Parameters”applicationId
Section titled “applicationId”string
Application identifier.
guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
Guild command route.
guildAuditLog
Section titled “guildAuditLog”
readonlyguildAuditLog: (guildId) =>string
Returns audit log entries for a guild.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
Audit log route.
guildAutoModerationRule
Section titled “guildAutoModerationRule”
readonlyguildAutoModerationRule: (guildId,ruleId) =>string
Returns one automod rule.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
ruleId
Section titled “ruleId”string
Rule identifier.
Returns
Section titled “Returns”string
Automod-rule route.
guildAutoModerationRules
Section titled “guildAutoModerationRules”
readonlyguildAutoModerationRules: (guildId) =>string
Returns guild automod rules.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
Automod-rule collection route.
guildBan
Section titled “guildBan”
readonlyguildBan: (guildId,userId) =>string
Returns an individual guild ban.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
userId
Section titled “userId”string
Returns
Section titled “Returns”string
guildBans
Section titled “guildBans”
readonlyguildBans: (guildId) =>string
Returns guild bans collection.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Returns
Section titled “Returns”string
guildBulkBan
Section titled “guildBulkBan”
readonlyguildBulkBan: (guildId) =>string
Bans up to 200 users at once (POST).
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
guildChannels
Section titled “guildChannels”
readonlyguildChannels: (guildId) =>string
Returns channels in a guild.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
Channel collection route.
guildEmoji
Section titled “guildEmoji”
readonlyguildEmoji: (guildId,emojiId?) =>string
Returns guild emojis, or a specific emoji.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
emojiId?
Section titled “emojiId?”string
Optional emoji identifier.
Returns
Section titled “Returns”string
guildIntegration
Section titled “guildIntegration”
readonlyguildIntegration: (guildId,integrationId) =>string
Removes an integration from a guild (DELETE).
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
integrationId
Section titled “integrationId”string
Integration identifier.
Returns
Section titled “Returns”string
guildInvites
Section titled “guildInvites”
readonlyguildInvites: (guildId) =>string
Returns invites for a guild.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
guildMember
Section titled “guildMember”
readonlyguildMember: (guildId,userId) =>string
Returns a guild member.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
userId
Section titled “userId”string
User identifier.
Returns
Section titled “Returns”string
Guild-member route.
guildMemberMe
Section titled “guildMemberMe”
readonlyguildMemberMe: (guildId) =>string
Edits the bot’s own member, e.g. its nickname (PATCH).
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
guildMemberRole
Section titled “guildMemberRole”
readonlyguildMemberRole: (guildId,userId,roleId) =>string
Returns a member role route.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
userId
Section titled “userId”string
roleId
Section titled “roleId”string
Returns
Section titled “Returns”string
guildMembers
Section titled “guildMembers”
readonlyguildMembers: (guildId) =>string
Returns members in a guild (paginated).
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
Members collection route.
guildMembersSearch
Section titled “guildMembersSearch”
readonlyguildMembersSearch: (guildId) =>string
Searches members by nickname or username.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
guildOnboarding
Section titled “guildOnboarding”
readonlyguildOnboarding: (guildId) =>string
Returns the onboarding configuration for a guild.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
guildPreview
Section titled “guildPreview”
readonlyguildPreview: (guildId) =>string
Returns a guild preview.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
guildPrune
Section titled “guildPrune”
readonlyguildPrune: (guildId) =>string
Returns or executes a prune operation for inactive members.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
Prune route.
guildRole
Section titled “guildRole”
readonlyguildRole: (guildId,roleId) =>string
Returns an individual guild role.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
roleId
Section titled “roleId”string
Returns
Section titled “Returns”string
guildRoles
Section titled “guildRoles”
readonlyguildRoles: (guildId) =>string
Returns all guild roles.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
Guild-role route.
guildScheduledEvent
Section titled “guildScheduledEvent”
readonlyguildScheduledEvent: (guildId,eventId) =>string
Returns one guild scheduled event.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
eventId
Section titled “eventId”string
Event identifier.
Returns
Section titled “Returns”string
Scheduled-event route.
guildScheduledEvents
Section titled “guildScheduledEvents”
readonlyguildScheduledEvents: (guildId) =>string
Returns guild scheduled events.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
Scheduled-event collection route.
guildScheduledEventUsers
Section titled “guildScheduledEventUsers”
readonlyguildScheduledEventUsers: (guildId,eventId) =>string
Returns users subscribed to a scheduled event.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
eventId
Section titled “eventId”string
Event identifier.
Returns
Section titled “Returns”string
Scheduled-event users route.
guildSoundboardSound
Section titled “guildSoundboardSound”
readonlyguildSoundboardSound: (guildId,soundId?) =>string
Returns guild soundboard sounds, or one sound.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
soundId?
Section titled “soundId?”string
Returns
Section titled “Returns”string
guildSticker
Section titled “guildSticker”
readonlyguildSticker: (guildId,stickerId?) =>string
Returns guild stickers, or one sticker.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
stickerId?
Section titled “stickerId?”string
Returns
Section titled “Returns”string
guildVanity
Section titled “guildVanity”
readonlyguildVanity: (guildId) =>string
Returns the guild vanity invite metadata.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
Vanity URL route.
guildVoiceState
Section titled “guildVoiceState”
readonlyguildVoiceState: (guildId,userId) =>string
Edits a voice state in a stage channel (PATCH); "@me" is the bot.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
userId
Section titled “userId”string
User identifier or "@me".
Returns
Section titled “Returns”string
guildWebhooks
Section titled “guildWebhooks”
readonlyguildWebhooks: (guildId) =>string
Returns webhooks for a guild.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
guildWelcomeScreen
Section titled “guildWelcomeScreen”
readonlyguildWelcomeScreen: (guildId) =>string
Returns the welcome screen for a guild.
Parameters
Section titled “Parameters”guildId
Section titled “guildId”string
Guild identifier.
Returns
Section titled “Returns”string
interactionCallback
Section titled “interactionCallback”
readonlyinteractionCallback: (interactionId,token) =>string
Returns an interaction callback endpoint.
Parameters
Section titled “Parameters”interactionId
Section titled “interactionId”string
Interaction identifier.
string
Interaction token.
Returns
Section titled “Returns”string
Interaction callback route.
interactionOriginalResponse
Section titled “interactionOriginalResponse”
readonlyinteractionOriginalResponse: (applicationId,token) =>string
Returns the original interaction response endpoint.
Parameters
Section titled “Parameters”applicationId
Section titled “applicationId”string
Application identifier.
string
Interaction token.
Returns
Section titled “Returns”string
Original-response route.
invite
Section titled “invite”
readonlyinvite: (code) =>string
Returns an invite by code.
Parameters
Section titled “Parameters”string
Invite code.
Returns
Section titled “Returns”string
Invite route.
message
Section titled “message”
readonlymessage: (channelId,messageId) =>string
Returns a message.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
messageId
Section titled “messageId”string
Message identifier.
Returns
Section titled “Returns”string
Message route.
messageReactionMe
Section titled “messageReactionMe”
readonlymessageReactionMe: (channelId,messageId,emoji) =>string
The bot’s own reaction: PUT adds it, DELETE removes it.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
messageId
Section titled “messageId”string
Message identifier.
string
Emoji name or ID.
Returns
Section titled “Returns”string
messageReactions
Section titled “messageReactions”
readonlymessageReactions: (channelId,messageId,emoji) =>string
Returns reactions for a message and emoji.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
messageId
Section titled “messageId”string
Message identifier.
string
Emoji name or ID.
Returns
Section titled “Returns”string
Reaction route.
messageReactionsAll
Section titled “messageReactionsAll”
readonlymessageReactionsAll: (channelId,messageId) =>string
Removes all reactions from a message.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
messageId
Section titled “messageId”string
Message identifier.
Returns
Section titled “Returns”string
Reaction collection route.
messageReactionUser
Section titled “messageReactionUser”
readonlymessageReactionUser: (channelId,messageId,emoji,userId) =>string
Removes one user’s reaction (DELETE).
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
messageId
Section titled “messageId”string
Message identifier.
string
Emoji name or ID.
userId
Section titled “userId”string
User identifier.
Returns
Section titled “Returns”string
Reaction-user route.
messageThread
Section titled “messageThread”
readonlymessageThread: (channelId,messageId) =>string
Creates a thread from a message.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
messageId
Section titled “messageId”string
Message identifier.
Returns
Section titled “Returns”string
Message-thread route.
pollAnswerVoters
Section titled “pollAnswerVoters”
readonlypollAnswerVoters: (channelId,messageId,answerId) =>string
Returns the users who voted for a poll answer.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
messageId
Section titled “messageId”string
answerId
Section titled “answerId”number
Answer identifier (an integer, not a snowflake).
Returns
Section titled “Returns”string
pollExpire
Section titled “pollExpire”
readonlypollExpire: (channelId,messageId) =>string
Ends a poll early.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Channel identifier.
messageId
Section titled “messageId”string
Poll message identifier.
Returns
Section titled “Returns”string
sendSoundboardSound
Section titled “sendSoundboardSound”
readonlysendSoundboardSound: (channelId) =>string
Plays a soundboard sound in a voice channel.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Returns
Section titled “Returns”string
skuSubscription
Section titled “skuSubscription”
readonlyskuSubscription: (skuId,subscriptionId?) =>string
Returns a SKU’s subscriptions, or one subscription.
Parameters
Section titled “Parameters”string
subscriptionId?
Section titled “subscriptionId?”string
Returns
Section titled “Returns”string
soundboardDefaultSounds
Section titled “soundboardDefaultSounds”
readonlysoundboardDefaultSounds: () =>string
Returns Discord’s default soundboard sounds.
Returns
Section titled “Returns”string
stageInstanceByChannel
Section titled “stageInstanceByChannel”
readonlystageInstanceByChannel: (channelId) =>string
Returns a stage instance by its channel.
Parameters
Section titled “Parameters”channelId
Section titled “channelId”string
Stage channel identifier.
Returns
Section titled “Returns”string
Stage instance route.
stageInstances
Section titled “stageInstances”
readonlystageInstances: () =>string
Returns the stage instances collection.
Returns
Section titled “Returns”string
Stage instance root route.
sticker
Section titled “sticker”
readonlysticker: (stickerId) =>string
Returns a sticker.
Parameters
Section titled “Parameters”stickerId
Section titled “stickerId”string
Sticker identifier.
Returns
Section titled “Returns”string
Sticker route.
stickerPacks
Section titled “stickerPacks”
readonlystickerPacks: (packId?) =>string
Returns the sticker packs Nitro users can use, or one pack.
Parameters
Section titled “Parameters”packId?
Section titled “packId?”string
Optional pack identifier.
Returns
Section titled “Returns”string
threadMember
Section titled “threadMember”
readonlythreadMember: (threadId,userId) =>string
Returns one member of a thread; "@me" is the current user (PUT joins, DELETE leaves).
Parameters
Section titled “Parameters”threadId
Section titled “threadId”string
Thread identifier.
userId
Section titled “userId”string
User identifier or "@me".
Returns
Section titled “Returns”string
threadMembers
Section titled “threadMembers”
readonlythreadMembers: (threadId) =>string
Returns a thread’s members.
Parameters
Section titled “Parameters”threadId
Section titled “threadId”string
Thread identifier.
Returns
Section titled “Returns”string
Thread-member route.
readonlyuser: () =>string
Returns the current bot user.
Returns
Section titled “Returns”string
User route.
userById
Section titled “userById”
readonlyuserById: (userId) =>string
Returns one user.
Parameters
Section titled “Parameters”userId
Section titled “userId”string
User identifier.
Returns
Section titled “Returns”string
User route.
userGuilds
Section titled “userGuilds”
readonlyuserGuilds: () =>string
Returns the guilds the bot is in (paged with before, after, limit).
Returns
Section titled “Returns”string
voiceRegions
Section titled “voiceRegions”
readonlyvoiceRegions: () =>string
Returns current voice regions.
Returns
Section titled “Returns”string
Voice-region route.
webhook
Section titled “webhook”
readonlywebhook: (webhookId,token?) =>string
Returns a webhook.
Parameters
Section titled “Parameters”webhookId
Section titled “webhookId”string
Webhook identifier.
token?
Section titled “token?”string
Optional webhook token.
Returns
Section titled “Returns”string
Webhook route.
webhookMessage
Section titled “webhookMessage”
readonlywebhookMessage: (webhookId,token,messageId) =>string
Returns a webhook message.
Parameters
Section titled “Parameters”webhookId
Section titled “webhookId”string
string
messageId
Section titled “messageId”string
Returns
Section titled “Returns”string