Discord API · error code

Discord error 10062: Unknown interaction

Permanent - do not retryHTTP 404Interactions and slash commands

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
Unknown interaction

What error 10062 means

You tried to respond to an interaction (slash command, button, select menu, modal) that Discord no longer recognizes. The overwhelming cause is timing. When a user triggers an interaction, Discord hands you a token and expects an initial response within 3 seconds. If nothing arrives in that window the interaction is discarded, and any later attempt to reply with that token returns 10062.

The 3 seconds start when Discord creates the interaction, not when your code receives it. Network latency, a slow event loop, a cold-started serverless function, or a synchronous database call before the reply all eat into the budget. Bots that work fine on a laptop and fail in production are usually losing the extra few hundred milliseconds of hosting latency.

The fix is not to be faster; it is to acknowledge first. Sending a deferred response (type 5, DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE, or type 6 for component updates) counts as the initial response. The user sees a "thinking" state and you then have 15 minutes to edit the reply via the interaction webhook.

The pattern is two lines in any maintained library, with the acknowledgement before every piece of I/O:

// discord.js - ack within 3 seconds, then take up to 15 minutes
await interaction.deferReply();
const answer = await doSlowWork();
await interaction.editReply(answer);

# discord.py - same shape
await interaction.response.defer()
answer = await do_slow_work()
await interaction.edit_original_response(content=answer)

Note what the defer buys you: the interaction token stays usable for 15 minutes for editing the original response and posting follow-ups through the webhook routes. It does not remove the 3-second deadline; it satisfies it. If even the defer arrives late, because the process was cold-starting or the event loop was blocked, you still get 10062, which is why the defer must be the first awaited call in the handler rather than merely an early one.

What it looks like

{
  "message": "Unknown interaction",
  "code": 10062
}

Why it happens

  • Handler performs slow work (database, HTTP call, AI model) before sending any response
  • Serverless or container cold start exceeds 3 seconds
  • Bot process restarted between receiving the interaction and replying
  • Responding twice with different interaction tokens after a retry
  • Clock or event-loop starvation on the host (blocked by a synchronous task)

How to fix Discord error 10062

  1. 1Call deferReply() / response.defer() / send type 5 as the very first statement in the handler, before any await
  2. 2Do the real work, then edit the deferred response with PATCH /webhooks/{application.id}/{interaction.token}/messages/@original
  3. 3For buttons that only change the original message, use type 6 DEFERRED_UPDATE_MESSAGE so no loading state appears
  4. 4Measure time from interaction.id (a snowflake with a timestamp) to your first response; alert if it exceeds 2 seconds
  5. 5On HTTP-interaction (webhook-style) bots, make sure your endpoint returns the ack synchronously and queues the work

How to stop it recurring

Adopt defer-then-edit as the default shape for every command handler that does anything beyond returning a constant string. Keep the code path between receiving the event and sending the ack free of I/O. If you run the bot serverless, keep a warm instance or move interaction handling to a long-lived process.

The 3-second and 15-minute windows are listed with sources on the Discord limits page, and the "application did not respond" section of Discord bot not responding walks the same fix through a full bot.

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

Related codes

Error 10062 - quick answers

What does Discord error 10062 mean?

You tried to respond to an interaction (slash command, button, select menu, modal) that Discord no longer recognizes. The overwhelming cause is timing. When a user triggers an interaction, Discord hands you a token and expects an initial response within 3 seconds . If nothing arrives in that window the interaction is discarded, and any later attempt to reply with that token returns 10062.

How do I fix Discord error 10062?

1. Call deferReply() / response.defer() / send type 5 as the very first statement in the handler, before any await 2. Do the real work, then edit the deferred response with PATCH /webhooks/{application.id}/{interaction.token}/messages/@original 3. For buttons that only change the original message, use type 6 DEFERRED_UPDATE_MESSAGE so no loading state appears 4. Measure time from interaction.id (a snowflake with a timestamp) to your first response; alert if it exceeds 2…

Should I retry after error 10062?

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.