Discord API · error code

Discord error 10013: Unknown user

Permanent - do not retryHTTP 404Unknown resource (10xxx)

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
Unknown user

What error 10013 means

No Discord account exists with that user ID. This is rarer than the other unknown-resource codes because user IDs do not normally disappear; accounts that are deleted are replaced by a "Deleted User" placeholder that still resolves. When you see 10013, the ID is almost always not a user ID at all, or it was corrupted.

The common pattern is a mix-up between ID types. Role mentions, channel mentions and user mentions all look similar in raw message content (<@&123>, <#123>, <@123>), and a regex that is too loose will extract a role ID and pass it to GET /users/{id}. Another source is parsing user-typed input: someone pastes a message link, and your code takes the wrong segment.

What it looks like

{
  "message": "Unknown User",
  "code": 10013
}

Why it happens

  • ID extracted from a mention is actually a role ID (<@&...>) or channel ID (<#...>)
  • User supplied free text that was not a valid snowflake, and your code passed it through anyway
  • Floating-point rounding of a user ID
  • Test fixture or seed data containing a made-up ID
  • Application ID or bot ID confused with a user ID in OAuth2 flows

How to fix Discord error 10013

  1. 1Validate the ID with a strict pattern (^\d{17,20}$) before calling the API
  2. 2Use your library's mention parser or match <@!?(\d+)> specifically for users
  3. 3Cross-check the ID against a known user in the same guild via GET /guilds/{guild.id}/members/{user.id}
  4. 4If the ID comes from a database, confirm the column type preserves full precision
  5. 5Return a friendly "user not found" message to the invoking user instead of surfacing the raw error

How to stop it recurring

Accept user references through slash command options of type USER (6) rather than parsing raw text. Discord resolves the user for you and includes it in the resolved object of the interaction, so you never handle an unvalidated ID.

When the ID came from free text, reject it before Discord does: an invalid snowflake costs you an API call and a 404 that counts as noise in your logs. DM-related failures for valid users surface as 50007 or 50033 instead, so 10013 reliably means the identifier itself is wrong.

Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.

Related codes

Error 10013 - quick answers

What does Discord error 10013 mean?

No Discord account exists with that user ID. This is rarer than the other unknown-resource codes because user IDs do not normally disappear; accounts that are deleted are replaced by a "Deleted User" placeholder that still resolves. When you see 10013, the ID is almost always not a user ID at all, or it was corrupted. The common pattern is a mix-up between ID types.

How do I fix Discord error 10013?

1. Validate the ID with a strict pattern (^\d{17,20}$) before calling the API 2. Use your library's mention parser or match specifically for users 3. Cross-check the ID against a known user in the same guild via GET /guilds/{guild.id}/members/{user.id} 4. If the ID comes from a database, confirm the column type preserves full precision 5. Return a friendly "user not found" message to the invoking user instead of surfacing the raw error

Should I retry after error 10013?

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.