Discord API · error code

Discord error 10007: Unknown member

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

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
Unknown member

What error 10007 means

The user exists on Discord, but is not a member of the guild you named. This is the code you get when you try to kick, timeout, assign a role to, or fetch a member who has already left, was banned, or was never in the server.

It is distinct from 10013 Unknown user, which means the user ID does not exist anywhere on Discord. 10007 is scoped to a guild: the same user ID will succeed in one server and fail with 10007 in another.

Member-related operations are also affected by the Server Members privileged intent. Without it, your library's member cache is mostly empty and a cache lookup returns nothing; that is a library miss, not a 10007 from the API. But if your code then calls the API with a guessed or stale ID, you get 10007 for real.

What it looks like

{
  "message": "Unknown Member",
  "code": 10007
}

Why it happens

  • User left the server between the event that triggered your code and the API call
  • User was banned (banned users are not members; use the bans endpoints instead)
  • User ID belongs to someone who was never in that guild, for example an ID copied from another server
  • Moderation queue processed an action hours later, after the member left
  • Wrong guild ID paired with the right user ID

How to fix Discord error 10007

  1. 1Fetch the member first (GET /guilds/{guild.id}/members/{user.id}) and branch on 404 instead of assuming presence
  2. 2For moderation bots, re-check membership at execution time, not at enqueue time
  3. 3If you want to act on someone who left, use ban (PUT /guilds/{guild.id}/bans/{user.id}) which does not require membership
  4. 4Listen to GUILD_MEMBER_REMOVE and drop pending actions for that user
  5. 5Verify the guild ID in the request matches the server you intend

How to stop it recurring

Model membership as transient. Any action that targets a member should tolerate 10007 as a normal outcome (log, notify the moderator, move on) rather than as an exception that crashes a handler. Where you need a reliable member list, enable the Server Members intent and rely on GUILD_MEMBERS_CHUNK rather than ad-hoc fetches.

Moderation flows that survive member churn are mostly about ordering: verify membership, act, then confirm. The member-list pagination caps that shape bulk checks are on the Discord limits page, and the ban-instead-of-kick fallback above pairs with 40007 when the target is already banned.

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

Related codes

Error 10007 - quick answers

What does Discord error 10007 mean?

The user exists on Discord, but is not a member of the guild you named. This is the code you get when you try to kick, timeout, assign a role to, or fetch a member who has already left, was banned, or was never in the server. It is distinct from 10013 Unknown user , which means the user ID does not exist anywhere on Discord.

How do I fix Discord error 10007?

1. Fetch the member first (GET /guilds/{guild.id}/members/{user.id}) and branch on 404 instead of assuming presence 2. For moderation bots, re-check membership at execution time, not at enqueue time 3. If you want to act on someone who left, use ban (PUT /guilds/{guild.id}/bans/{user.id}) which does not require membership 4. Listen to GUILD_MEMBER_REMOVE and drop pending actions for that user 5. Verify the guild ID in the request matches the server you intend

Should I retry after error 10007?

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.