Discord API reference

Every Discord API limit, in one table

107documented limits
10groups
2026-08-20last verified

Last verified against Discord Developer Docs - Rate Limits

Discord enforces limits at four layers and a bot has to respect all of them at once. The REST layer has a global ceiling of 50 requests per second per bot plus per-route buckets whose size is only revealed in response headers. The gateway (the WebSocket that delivers events) caps how many payloads you may send per minute, how often you may identify, and how many guilds one connection can serve before sharding is mandatory. Payload limits govern what fits in a message: 2,000 characters of content, 10 embeds, 6,000 combined embed characters, 10 attachments, 10 MiB uploads by default. And resource caps bound what a server can hold: 250 roles, 500 channels, 15 webhooks per channel, 20 distinct reactions per message.

The three REST failure modes are worth separating because they demand different responses. A route bucket 429 (scope user or shared) means one endpoint's budget is spent: wait retry_after and only that bucket's traffic must pause. The global limit (50/s, scope global) means the whole bot must pause. And the invalid request limit is the one that takes you off the air entirely: 10,000 requests returning 401, 403 or 429 within 10 minutes gets the IP temporarily banned by Cloudflare in front of the API, after which every call returns Cloudflare's HTML "error 1015" page instead of JSON until the ban lapses. Bots hit that third tier by hammering the first two: an unhandled 429 retried in a tight loop, or a dead token retried overnight, manufactures invalid requests at machine speed.

Most of these numbers are documented in different places (rate limits topic, gateway topic, message resource, application commands, components reference, and the 30xxx error codes that fire when a cap is hit). This page collects them with the official source for each row. Where Discord does not publish a figure, the row says so rather than guessing; per-route bucket sizes in particular are intentionally unpublished and must be read from X-RateLimit-Limit at runtime. When a limit is exceeded the response is either HTTP 429 with retry_after or a specific error code such as 30005; the Discord error codes directory covers those.

Jump to: REST rate limits · Gateway connection limits · Messages and embeds · Files and uploads · Slash commands and context menu commands · Interaction timing · Message components · Webhooks · AutoMod rules · Server, channel, role and member limits

REST rate limits

Discord rate limits every REST request against a global per-bot budget and a per-route bucket. Bucket sizes are not published; you learn them from the X-RateLimit-* headers on each response. Buckets are keyed by route and major parameter (channel, guild or webhook ID), and X-RateLimit-Bucket lets you recognize when two routes share one. Exceeding any limit returns HTTP 429 with retry_after (seconds, float) and a global flag telling you whether only that bucket or the whole bot must pause. Invalid requests (401, 403, 429) are counted separately: 10,000 of them in 10 minutes triggers a temporary Cloudflare ban of the IP, so an unhandled 429 in a retry loop escalates itself into a full outage.

WhatLimitNotesSource
Global rate limit50 requests per second, per botApplies across all routes. Exceeding it returns 429 with global: true and X-RateLimit-Global: true; every request must pause. Interaction response endpoints are exempt.docs ↗
Per-route bucket sizeNot published; read X-RateLimit-LimitEach route (or shared group of routes) has its own limit and reset window. Bucket identity is in X-RateLimit-Bucket; scope is user, global or shared.docs ↗
Rate limit headersX-RateLimit-Limit, -Remaining, -Reset, -Reset-After, -Bucket, -Global, -ScopeReset is epoch seconds; Reset-After is seconds until reset. Global only appears on 429 for the global limit. Scope values: user, global, shared.docs ↗
429 response bodymessage, retry_after (float seconds), global (bool), code (optional)Retry-After header carries the same wait in whole seconds. code is set for resource-specific limits such as 20016 slowmode.docs ↗
Invalid request limit10,000 invalid requests per 10 minutesAn invalid request is one that returns 401, 403 or 429. Exceeding this results in a temporary Cloudflare ban of the IP.docs ↗
Emoji management routesLimited per guild; headers do not follow normal conventionsCreating, editing and deleting guild emoji is bucketed per guild with limits not exposed in the usual headers.docs ↗
Interaction callback endpointsNot bound to the global rate limitPOST /interactions/{id}/{token}/callback and the follow-up webhook routes are exempt from the 50/s global limit but still have their own buckets.docs ↗

Gateway connection limits

The gateway is the WebSocket over which your bot receives events and sends a small set of commands (heartbeat, identify, presence update, voice state update, request guild members). It has its own rate limit, an identify concurrency limit, a daily session start budget, and a hard cap on guilds per connection. The consequences arrive as close codes rather than 429s: exceed the send limit and the socket closes with 4008, identify without enough shards and it closes with 4011, request a privileged intent you have not enabled and it closes with 4014. A reconnect loop that ignores those codes drains the daily identify budget and locks the bot out until the window resets.

WhatLimitNotesSource
Gateway send rate120 events per connection per 60 secondsAbout 2 per second, counting heartbeats. Exceeding it closes the connection with code 4008.docs ↗
Identify concurrencymax_concurrency identifies per 5 secondsReturned in session_start_limit from GET /gateway/bot; 1 for most bots, higher for very large bots.docs ↗
Session startssession_start_limit.total per reset_after windowGET /gateway/bot returns total, remaining and reset_after (ms). Each Identify consumes one; resumes do not. Exhausting it blocks new sessions until reset.docs ↗
Guilds per shard2,500 guilds maximum per shardApps in 2,500+ guilds must shard. Identifying unsharded beyond this closes with code 4011 Sharding required.docs ↗
Shard assignmentshard_id = (guild_id >> 22) % num_shardsSent as shard: [shard_id, num_shards] in Identify; shard_id must be 0..num_shards-1 or the connection closes with 4010.docs ↗
HeartbeatEvery heartbeat_interval ms from Hello (op 10)First heartbeat after heartbeat_interval * jitter (0-1). Missing heartbeats lead to session timeout (close code 4009).docs ↗
large_threshold50 to 250 membersIdentify field: guilds with more members than this do not include offline members in GUILD_CREATE.docs ↗
Request Guild Members user_idsUp to 100 user IDs per requestOr use query with limit; requires GUILD_MEMBERS intent for full member lists.docs ↗
Privileged intentsGUILD_MEMBERS, GUILD_PRESENCES, MESSAGE_CONTENTMust be toggled on under Bot > Privileged Gateway Intents in the Developer Portal before being sent in Identify, else close code 4014.docs ↗
Privileged intent review thresholdMore than 10,000 unique usersApps with fewer than 10,000 users enable privileged intents with the toggle; above that the app must be verified and approved per intent. Older guides cite 100 servers; the current docs phrase the threshold in users.docs ↗
Unverified app guild cap100 guildsError 30001 Maximum number of guilds reached (100) is returned when an unverified app is added beyond this; verification lifts it.docs ↗

Messages and embeds

These are the payload limits enforced on Create Message, Edit Message and Execute Webhook. Exceeding any of them returns HTTP 400 with error 50035 Invalid Form Body and an errors object pointing at the exact field, while sending a message with nothing in it at all fails with 50006. The 2,000-character content limit applies to bots regardless of the developer's Nitro status; Nitro's higher limit is a user-account feature. Webhook executions and interaction responses use the same limits, so one local validation layer covers all three send paths. Validate lengths before the request leaves your process: the API tells you what was wrong, but only after you have spent a request and logged an error.

WhatLimitNotesSource
Message content2,000 charactersBots always get 2,000; Nitro users' higher limit does not apply to bots.docs ↗
Embeds per message10Same for webhooks and interaction responses.docs ↗
Embed title256 charactersdocs ↗
Embed description4,096 charactersdocs ↗
Embed fields25 field objectsdocs ↗
Embed field name256 charactersdocs ↗
Embed field value1,024 charactersdocs ↗
Embed footer text2,048 charactersdocs ↗
Embed author name256 charactersdocs ↗
Combined embed text6,000 characters across all embedsSum of title, description, field names, field values, footer text and author name across every embed on the message.docs ↗
Attachments per message10files[0]..files[9] in multipart/form-data.docs ↗
Stickers per message3 sticker_idsdocs ↗
Unique reactions per message20 distinct emojiError 30010 when exceeded. Each emoji may have many reactors.docs ↗
Bulk delete2-100 messages, none older than 14 daysError 50034 if any message is too old; the whole request fails.docs ↗
Get Channel Messages1-100 per request (default 50)Paginate with before / after / around.docs ↗
Get Reactions1-100 users per request (default 25)docs ↗
Edits to messages older than 1 hourLimited; exact count not publishedError 30046 when exceeded. Frequent edits to long-lived status messages hit this.docs ↗

Files and uploads

Upload limits depend on the destination server's Boost tier, not on the bot. Discord documents a 10 MiB default and says it may be higher depending on Nitro status (users) or the server's Boost Tier. Oversize uploads fail with 40005 at the transport layer or 50045 after parsing, and a file Discord cannot decode fails with 50046 regardless of size. Image fields that take data URIs (emoji, avatars, icons) and sticker uploads have their own, much smaller caps listed below. Validate sizes and formats locally before uploading so user-supplied files fail in your code with a clear message instead of at Discord.

WhatLimitNotesSource
Attachment upload size10 MiB defaultHigher in boosted servers; check guild.premium_tier. Nitro limits apply to users, not bots.docs ↗
Boosted-server upload sizeSee docs / guild.premium_tierDiscord states the limit may be higher by Boost Tier; exact tier values are not listed in the API reference and change over time.docs ↗
Custom emoji image256 KiBData URI in the image field; JPEG, PNG, GIF, WebP and AVIF are accepted. Error 50045 or 50046 when violated.docs ↗
Files per message10docs ↗
Application-owned emoji2,000 per applicationEmoji uploaded to the app itself (usable only by that app); not counted against any guild's slots.docs ↗
Premium (subscription role) emoji25 per guildEmoji attached to subscription roles count toward a separate limit of 25.docs ↗
Sticker file512 KiB max, 320 x 320 pxPNG, APNG, GIF or Lottie JSON; animated stickers are constrained to 5 seconds. Uploaded via multipart Create Guild Sticker.docs ↗
Sticker name / description / tags2-30 / empty or 2-100 / up to 200 charactersTags are a comma-separated autocomplete string.docs ↗
Guild sticker slots5 free slots by defaultEach Boost level grants more slots; the per-tier counts are not listed in the API reference. Error 30039 when full.docs ↗

Slash commands and context menu commands

Application commands are registered per application (global) or per guild, with separate quotas for each command type. Names must be 1-32 characters, lowercase for CHAT_INPUT, matching the documented regex; descriptions 1-100. Registering more than the quota or breaking a name rule fails with 50035, creating too many in one day fails with 30034, and editing a command by a stale ID after a re-registration fails with 10063. Guild commands update instantly and are the right tool for development; global commands are what production bots should register, and the daily create budget is why registration belongs in a deploy script, not in startup code.

WhatLimitNotesSource
Global CHAT_INPUT commands100 per applicationSame limit applies per guild for guild commands.docs ↗
Global USER commands15 per applicationContext menu commands on users. Older docs said 5.docs ↗
Global MESSAGE commands15 per applicationContext menu commands on messages. Older docs said 5.docs ↗
PRIMARY_ENTRY_POINT commands1 per applicationUsed for Activities.docs ↗
Daily command creates200 per day, per guildError 30034 when exceeded. Bulk overwrite counts each created command.docs ↗
Command name1-32 charactersCHAT_INPUT names must be lowercase and match ^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$.docs ↗
Command description1-100 charactersRequired for CHAT_INPUT; must be empty for USER and MESSAGE.docs ↗
Options per command25Includes subcommands and subcommand groups at that level.docs ↗
Option name / description1-32 / 1-100 charactersdocs ↗
Choices per option25Choice name 1-100 characters; string value up to 100 characters. Cannot combine with autocomplete.docs ↗
Subcommand nestingOne level of groupsCommand > subcommand group > subcommand.docs ↗
Combined command text8,000 charactersSum of name, description and value properties across the command, options, subcommands and choices, including localizations.docs ↗
Guild command propagationInstantGlobal commands may take time to propagate; use a dev guild for iteration.docs ↗

Interaction timing

Every interaction (slash command, button, select, modal) must receive an initial response quickly; after that the interaction token allows follow-ups for a limited time. Missing the initial deadline produces 10062 Unknown interaction and the user sees "The application did not respond"; responding twice produces 40060. The deadline is measured from when Discord created the interaction, not when your handler started, so hosting latency and cold starts eat into it. Deferring first (callback type 5, or type 6 for component updates) is the standard pattern: it satisfies the 3-second rule and converts the budget into the token's full 15-minute lifetime.

WhatLimitNotesSource
Initial response deadline3 secondsSend a message, a deferral (type 5 or 6), a modal, or an update within 3 seconds of the interaction being created.docs ↗
Interaction token lifetime15 minutesEdit the original response and send follow-ups via /webhooks/{application.id}/{token} until the token expires.docs ↗
Initial responses per interaction1A second call to the callback endpoint returns 40060.docs ↗
Follow-ups for user-installed apps5 per interaction when not also installed in the serverApplies to user-installable apps in servers where the app is not guild-installed.docs ↗

Message components

Buttons, select menus and text inputs live inside action rows (or, with the IS_COMPONENTS_V2 flag, inside layout components). Exceeding a count or length produces 50035 naming the component path. All interactive components need a custom_id of 1-100 characters, unique within the message. Remember that every click or selection is itself an interaction with the same 3-second acknowledgement deadline as a slash command, so a component-heavy UI inherits the 10062 failure mode too. Action rows are the v1 container; Components v2 replaces them with layout components and raises the total component count but adds a combined text cap.

WhatLimitNotesSource
Action rows per message5Legacy (v1) layout.docs ↗
Buttons per action row5A row holds either up to 5 buttons or 1 select menu, not both.docs ↗
Select menus per action row1docs ↗
Button label80 charactersdocs ↗
custom_id1-100 charactersDeveloper-defined; must be unique per message.docs ↗
Select menu options25min_values / max_values range 0-25.docs ↗
Select placeholder150 charactersdocs ↗
Text input lengthmin_length 0-4000, max_length 1-4000Modal text inputs.docs ↗
Components v2 total components40 per messageWith flags 1 << 15 (IS_COMPONENTS_V2).docs ↗
Components v2 total text4,000 charactersAcross all text display components in a v2 message.docs ↗

Webhooks

Webhooks post without a bot token and follow the same payload limits as messages. Channel capacity is capped at 15, and the 16th create fails with 30007; a deleted or mistyped webhook URL returns 10015 forever, so senders need a disable-on-404 path. Per-webhook execution buckets exist but their size is not published; read the rate limit headers on Execute Webhook responses. Webhooks can post into existing threads in any channel via the thread_id query parameter, but can only create new threads in forum and media channels; passing thread_name anywhere else fails with 220003.

WhatLimitNotesSource
Webhooks per channel15Error 30007 Maximum number of webhooks reached (15).docs ↗
Webhook name1-80 charactersCannot contain clyde or discord (case-insensitive).docs ↗
Execute Webhook content2,000 charactersSame embed limits as messages: 10 embeds, 6,000 combined characters.docs ↗
Execute Webhook ratePer-webhook bucket; read X-RateLimit-LimitNot published in the API docs. Handle 429 with retry_after like any route.docs ↗
Webhook thread creationForum and media channels onlythread_name on Execute Webhook; error 220003 elsewhere. Use ?thread_id= to post into existing threads.docs ↗

AutoMod rules

AutoMod rules are configured per guild through the auto-moderation endpoints, and every field on a rule has a documented ceiling: how many rules of each trigger type a server may have, how many keywords and regex patterns one rule may carry, and how long each entry may be. Bots that manage AutoMod hit these caps with 50035 at write time; bots that merely post content collide with the rules themselves, and a matching rule blocks the message with 200000 or the thread title with 200001. Reading a server's rules (Manage Guild required) is the reliable way to explain a block to a user, so the shape of these limits matters even to bots that never write a rule.

WhatLimitNotesSource
Rules per guild, per trigger typeKEYWORD 6, MEMBER_PROFILE 1, SPAM 1, KEYWORD_PRESET 1, MENTION_SPAM 1Each trigger type has its own per-guild maximum; creating one more fails validation.docs ↗
keyword_filter1,000 keywords, each up to 60 charactersKeyword and member-profile triggers; supports * wildcards at word start/end.docs ↗
regex_patterns10 patterns, each up to 260 charactersRust-flavored regex only.docs ↗
allow_list100 entries (KEYWORD, MEMBER_PROFILE) or 1,000 (KEYWORD_PRESET)Each entry up to 60 characters; exempts substrings from the rule.docs ↗
mention_total_limitUp to 50 unique role and user mentionsMENTION_SPAM trigger threshold.docs ↗
Block-message custom messageUp to 150 charactersShown to members when their message is blocked by the rule's BLOCK_MESSAGE action.docs ↗

Server, channel, role and member limits

Per-server caps, mostly enforced through 30xxx error codes when a create call would exceed them, plus the field-length rules on guild, channel and role objects and the pagination limits on list endpoints. Several of these are ones bots silently exhaust over months of automated creation: the 251st role fails with 30005, the 501st channel with 30013, the 251st pin with 30003, and by the time the error fires the cleanup job is archaeology. Monitor the counts your bot grows (roles, channels, pins, invites, webhooks) instead of discovering the ceiling from a support ticket, and give every automated create a matching delete path.

WhatLimitNotesSource
Roles per guild250Includes @everyone and integration-managed roles. Error 30005.docs ↗
Channels per guild500All types including categories; threads do not count. Error 30013.docs ↗
Pinned messages per channel250Error 30003. Formerly 50.docs ↗
Invites per guild1,000Error 30016.docs ↗
Discovery categories per guild5Error 30030 (not channel categories).docs ↗
Guild name2-100 charactersExcluding leading/trailing whitespace.docs ↗
Channel / thread name1-100 charactersdocs ↗
Channel topic0-1,024 characters (0-4,096 for forum and media channels)docs ↗
Slowmode (rate_limit_per_user)0-21,600 secondsBots with Manage Channel or Manage Messages are exempt; otherwise error 20016.docs ↗
Thread auto-archive60, 1440, 4320 or 10080 minutesdocs ↗
Forum available tags20 per channel; tag name 0-20 charactersNames must be unique (error 40061).docs ↗
Applied tags per forum post5docs ↗
Role name1-100 charactersdocs ↗
Username2-32 charactersCannot contain @, #, :, ```, discord; cannot be everyone or here.docs ↗
Nickname1-32 charactersdocs ↗
AFK timeout60, 300, 900, 1800 or 3600 secondsdocs ↗
Voice bitrate96 kbps (no boost), 128 / 256 / 384 kbps at tiers 1 / 2 / 3Stage channels up to 64 kbps.docs ↗
List / Search Guild Members1-1,000 per request (default 1)List requires GUILD_MEMBERS intent; paginate with after.docs ↗
Get Current User Guilds1-200 per request (default 200)Paginate with before / after.docs ↗
Get Guild Audit Log1-100 entries per request (default 50)Entries are retained for 45 days.docs ↗
Group DMs10 active group DMs per appCreate Group DM via OAuth2 gdm.join.docs ↗
Opening DMsSpam-limited; exact rate not publishedError 40003 You are opening direct messages too fast. Cache DM channel IDs and do not mass-DM.docs ↗
Audit log reason (X-Audit-Log-Reason header)1-512 URL-encoded UTF-8 charactersSets the reason shown in the guild's audit log for the request; longer values are rejected.docs ↗
Stage instance topic1-120 charactersCreate and Modify Stage Instance; requires Manage Channels, Mute Members and Move Members.docs ↗
Uncompleted scheduled events100 per guildError 30038 Maximum number of uncompleted guild scheduled events reached (100).docs ↗

Discord guides and tools

Other platforms

Frequently asked questions

What is the Discord API rate limit for bots?

Two layers. Globally, a bot may make 50 requests per second across all endpoints. Separately, each route has its own bucket whose size Discord does not publish; you read it from the X-RateLimit-Limit and X-RateLimit-Remaining headers on every response, and X-RateLimit-Bucket tells you which routes share a bucket. Exceeding either returns HTTP 429 with retry_after in seconds. Interaction callback endpoints are exempt from the global limit.

How long can a Discord bot message be?

2,000 characters of content. Nitro's longer limit applies to user accounts, not bots. Embeds extend what you can show: up to 10 embeds per message, each with a 4,096-character description, 25 fields of 1,024 characters, and a combined cap of 6,000 characters across all embed text. Exceeding any of these returns error 50035 Invalid Form Body naming the field.

What is the Discord gateway rate limit?

120 events per connection every 60 seconds, roughly 2 per second, including heartbeats. Exceeding it closes the WebSocket with code 4008 and you must reconnect. Identify has its own limit: max_concurrency identifies per 5 seconds (1 for most bots), and each app has a daily session start budget returned by GET /gateway/bot. Presence updates and Request Guild Members are the usual sources of 4008.

When does a Discord bot need sharding?

At 2,500 guilds. Each gateway shard can serve at most 2,500 guilds, and apps in 2,500 or more must identify with a shard array; otherwise the gateway closes with 4011 Sharding required. GET /gateway/bot returns the recommended shard count and max_concurrency. Most libraries enable sharding with one option, so turn it on before you approach the threshold.

How many slash commands can a Discord bot have?

100 global CHAT_INPUT (slash) commands per application, plus 15 USER and 15 MESSAGE context menu commands and 1 PRIMARY_ENTRY_POINT command. The same per-type quotas apply per guild for guild-scoped commands. Each command allows 25 options, each option 25 choices, names up to 32 characters and descriptions up to 100. You may create at most 200 commands per day per guild (error 30034).

What is the Discord bot file upload limit?

10 MiB per upload by default, with up to 10 attachments per message. Servers with Boost tiers allow larger uploads; read guild.premium_tier to know which applies. Nitro upload limits belong to user accounts and do not help a bot. Oversize uploads fail with 40005 Request entity too large or 50045 File uploaded exceeds the maximum size. Custom emoji images are capped at 256 KB.

How fast must a Discord bot respond to an interaction?

Within 3 seconds of the interaction being created, with an initial response: a message, a deferral (type 5 or 6), a modal or an update. After that, the interaction token stays valid for 15 minutes for editing the original reply and sending follow-ups through the webhook routes. Missing the 3-second window gives 10062 Unknown interaction; responding twice gives 40060 Interaction has already been acknowledged.

Which Discord privileged intents need approval, and at what size?

Server Members (GUILD_MEMBERS), Presence (GUILD_PRESENCES) and Message Content (MESSAGE_CONTENT). Any app can enable them with the toggles under Bot > Privileged Gateway Intents in the Developer Portal while it has fewer than 10,000 users. Above 10,000 unique users the app must be verified and approved for each intent it uses. Requesting a privileged intent that is not enabled or approved closes the gateway with code 4014.

What is Discord's invalid request limit, and what is a Cloudflare ban?

Requests that return 401, 403 or 429 count as invalid. An IP that produces 10,000 of them within 10 minutes is temporarily restricted from the whole API; the restriction is enforced by Cloudflare in front of Discord, so responses become HTML error pages instead of JSON until it expires. The usual cause is a retry loop around a bad token, a missing permission, or an unhandled 429, so fix the underlying error rather than retrying it.

How many AutoMod rules can a Discord server have?

Per trigger type: 6 KEYWORD rules, and 1 each of SPAM, KEYWORD_PRESET, MENTION_SPAM and MEMBER_PROFILE. A keyword rule holds up to 1,000 keywords of 60 characters each plus 10 regex patterns of up to 260 characters, with an allow list of 100 entries (1,000 for preset rules). When a rule matches content a bot sends, the message is blocked with error 200000 and thread titles with 200001.

Build on Discord without tracking every limit yourself

Conferbot paces sends, queues retries and surfaces limit errors as readable status.