Discord error 40062: Service resource is being rate limited
Last verified against Discord Developer Docs - Opcodes and status codes
Service resource is being rate limitedWhat error 40062 means
A backend resource your request depends on is rate limited on Discord's side, and the request was refused. Unlike the per-route limits your bot can track through X-RateLimit-* headers, this limit is attached to a shared Discord resource rather than to your bot's own request budget.
Discord's rate-limit documentation describes a shared scope, reported in the X-RateLimit-Scope header, for limits on a resource that many callers use. Responses with that scope do not count against your bot's invalid-request total. When 40062 arrives, read the headers and body: if a retry_after is present, honor it.
The practical difference from 429 on your own bucket is that you cannot avoid it by spreading your own requests more carefully. Back off, retry later, and do not count it as a bug in your bot.
What it looks like
{
"message": "Service resource is being rate limited",
"code": 40062
}Why it happens
- A shared resource on Discord's side is under heavy load
- Many callers acting on the same resource at once
- Retry storm from several workers hitting the same endpoint simultaneously
- Burst of requests from your own bot against the same resource
How to fix Discord error 40062
- 1Log the response headers, including X-RateLimit-Scope, alongside the error
- 2Honor retry_after when it is present; otherwise back off exponentially with jitter
- 3Make sure only one worker retries a given request
- 4Surface a "try again shortly" message to the user instead of failing hard
How to stop it recurring
Route all REST calls through one rate-limit-aware queue so retries are centralized and jittered. Treat shared-scope limits as transient. The rate-limit header reference and global limits are on the Discord limits page. Alert only when the errors persist for minutes, not on single occurrences.
Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.
Related codes
- 429: HTTP 429 Too Many Requests (rate limited)You are being rate limited.
- 130000: API resource overloadedAPI resource is currently overloaded. Try again a little later
- 20028: Channel write rate limitThe write action you are performing on the channel has hit the write rate limit
- 20029: Server write rate limitThe write action you are performing on the server has hit the write rate limit
Error 40062 - quick answers
What does Discord error 40062 mean?
A backend resource your request depends on is rate limited on Discord's side, and the request was refused. Unlike the per-route limits your bot can track through X-RateLimit-* headers, this limit is attached to a shared Discord resource rather than to your bot's own request budget.
How do I fix Discord error 40062?
1. Log the response headers, including X-RateLimit-Scope, alongside the error 2. Honor retry_after when it is present; otherwise back off exponentially with jitter 3. Make sure only one worker retries a given request 4. Surface a "try again shortly" message to the user instead of failing hard
Can I retry after error 40062?
Yes - this is a retryable condition. Back off (start around one second and double on each attempt, with jitter) and watch for a retry-after hint from the platform before resending.
Stop debugging Discord by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.