Discord error 10011: Unknown role
Last verified against Discord Developer Docs - Opcodes and status codes
Unknown roleWhat error 10011 means
The role ID in your request does not exist in the guild you named. Roles are scoped to one server, so a valid role ID from server A returns 10011 when used against server B. The same happens after an admin deletes a role your bot had saved in its configuration.
Typical routes are PUT and DELETE /guilds/{guild.id}/members/{user.id}/roles/{role.id} (add or remove a role from a member) and PATCH or DELETE /guilds/{guild.id}/roles/{role.id}. Reaction-role and auto-role bots hit it most because they store role IDs once during setup and assume they stay valid forever.
10011 is not a hierarchy or permission problem. If the role exists but sits above the bot's highest role, Discord answers with 50013 instead. Getting 10011 tells you the ID itself is wrong or stale.
What it looks like
{
"message": "Unknown role",
"code": 10011
}Why it happens
- Role was deleted by an admin after your bot stored its ID
- Role ID copied from a different server than the one in the request
- Guild ID and role ID swapped in the URL, or the @everyone role ID (equal to the guild ID) used against another guild
- ID stored as a JavaScript number and lost precision, turning it into a different snowflake
How to fix Discord error 10011
- 1Call GET /guilds/{guild.id}/roles and confirm the role ID appears in the response
- 2Check that the guild ID in the URL is the same server the role was created in
- 3Store and send snowflakes as strings; a 64-bit ID in a JS number silently changes
- 4When 10011 occurs, remove the role from your bot's config and tell the server admin to re-run setup
- 5Listen to GUILD_ROLE_DELETE and clean up stored references immediately
How to stop it recurring
Key stored role IDs by guild ID so they can never cross servers, keep them as strings, and subscribe to GUILD_ROLE_DELETE to drop dead references before a user triggers them. A setup command that validates every configured role on startup catches stale IDs early. Role-count limits are on the Discord limits page.
Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.
Related codes
Error 10011 - quick answers
What does Discord error 10011 mean?
The role ID in your request does not exist in the guild you named. Roles are scoped to one server, so a valid role ID from server A returns 10011 when used against server B. The same happens after an admin deletes a role your bot had saved in its configuration.
How do I fix Discord error 10011?
1. Call GET /guilds/{guild.id}/roles and confirm the role ID appears in the response 2. Check that the guild ID in the URL is the same server the role was created in 3. Store and send snowflakes as strings; a 64-bit ID in a JS number silently changes 4. When 10011 occurs, remove the role from your bot's config and tell the server admin to re-run setup 5. Listen to GUILD_ROLE_DELETE and clean up stored references immediately
Should I retry after error 10011?
No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.
Stop debugging Discord by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.