Discord API · error code

Discord error 10026: Unknown ban

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

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
Unknown ban

What error 10026 means

You asked about or tried to remove a ban that does not exist. The user ID is fine and may well be a real Discord user, but there is no ban record for that user in that guild. This comes from GET /guilds/{guild.id}/bans/{user.id} (check if someone is banned) and DELETE /guilds/{guild.id}/bans/{user.id} (unban).

Many moderation bots use the GET as a yes/no check, in which case 10026 is the expected "not banned" answer rather than an error. On DELETE it usually means another moderator already unbanned the user, a temporary-ban job ran twice, or the ID belongs to a different server's ban list.

If the user is banned and your bot simply lacks Ban Members, you receive 50013. The reverse case, acting on a member who is banned, is 40007.

What it looks like

{
  "message": "Unknown ban",
  "code": 10026
}

Why it happens

  • User was already unbanned manually in the Discord client
  • Scheduled unban (temp-ban) fired twice, or after a moderator lifted the ban early
  • Wrong guild ID paired with the user ID
  • Using GET on the ban endpoint as an existence check and logging the 404 as a failure

How to fix Discord error 10026

  1. 1Treat 10026 on GET as "not banned" and branch on it instead of raising
  2. 2Treat 10026 on DELETE as already done and mark the temp-ban job complete
  3. 3Verify the guild ID matches the server where the ban was issued
  4. 4For bulk checks, page through GET /guilds/{guild.id}/bans rather than probing users one by one

How to stop it recurring

Make unban jobs idempotent: store a ban record with a status, and have the scheduler mark it complete on success or on 10026. Listen to GUILD_BAN_REMOVE so manual unbans cancel pending jobs. That way a double-fire never surfaces as an alert.

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

Related codes

Error 10026 - quick answers

What does Discord error 10026 mean?

You asked about or tried to remove a ban that does not exist. The user ID is fine and may well be a real Discord user, but there is no ban record for that user in that guild. This comes from GET /guilds/{guild.id}/bans/{user.id} (check if someone is banned) and DELETE /guilds/{guild.id}/bans/{user.id} (unban).

How do I fix Discord error 10026?

1. Treat 10026 on GET as "not banned" and branch on it instead of raising 2. Treat 10026 on DELETE as already done and mark the temp-ban job complete 3. Verify the guild ID matches the server where the ban was issued 4. For bulk checks, page through GET /guilds/{guild.id}/bans rather than probing users one by one

Should I retry after error 10026?

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.