Discord API · error code

Discord error 160004: A thread has already been created for this message

Permanent - do not retryHTTP 400Validation and request shape

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
A thread has already been created for this message

What error 160004 means

You called POST /channels/{channel.id}/messages/{message.id}/threads on a message that already has a thread. Each message can start at most one thread; once it exists, the message is permanently linked to it.

Auto-thread bots (for example "create a thread for every message in #suggestions") see this when two instances of the bot run at once, when a gateway resume replays the same MESSAGE_CREATE, or when a human clicked Create Thread first. The thread you wanted already exists, so nothing is lost.

The existing thread's ID is the same as the message ID, so you can address it directly at /channels/{message.id} without a lookup.

The same limit applies when a person creates the thread from the message in the client. If your bot also handles THREAD_CREATE, it sees that thread and can adopt it instead of creating its own.

What it looks like

{
  "message": "A thread has already been created for this message",
  "code": 160004
}

Why it happens

  • Two bot processes or shards handling the same message
  • Gateway resume replayed MESSAGE_CREATE and the handler ran twice
  • User created the thread manually before the bot
  • Retry after a timeout on a request that actually succeeded

How to fix Discord error 160004

  1. 1Check message.thread (or the message's flags) before creating
  2. 2On 160004, use the message ID as the thread ID and continue
  3. 3Deduplicate gateway events by message ID
  4. 4Make sure only one bot instance handles each guild
  5. 5Handle THREAD_CREATE and record threads people create so the bot does not try again

How to stop it recurring

Make thread creation idempotent: try to create, and on 160004 fetch the channel with the message ID and carry on. Track processed message IDs for a short window to absorb replays. Thread membership caps are on 30033. Log which path created each thread.

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

Related codes

Error 160004 - quick answers

What does Discord error 160004 mean?

You called POST /channels/{channel.id}/messages/{message.id}/threads on a message that already has a thread. Each message can start at most one thread; once it exists, the message is permanently linked to it.

How do I fix Discord error 160004?

1. Check message.thread (or the message's flags) before creating 2. On 160004, use the message ID as the thread ID and continue 3. Deduplicate gateway events by message ID 4. Make sure only one bot instance handles each guild 5. Handle THREAD_CREATE and record threads people create so the bot does not try again

Should I retry after error 160004?

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.