Discord API · error code

Discord error 160005: Thread is locked

ConfigurationPermissions and access

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
Thread is locked

What error 160005 means

The thread has been locked, and the action you tried is limited to members with Manage Threads. In a locked thread, only those members can unarchive it, and the thread stays read-only for everyone else.

Locking is a moderation step, so 160005 usually means a moderator closed the thread on purpose. Bots that post status updates into ticket or support threads after staff locked them, or that try to unarchive a locked thread to add a user, get this code. The thread_metadata.locked field shows the state.

If the thread is only archived, not locked, the bot can unarchive it with ordinary permissions; that case is 50083.

Locked and archived are separate fields in thread_metadata, so check both. A thread that is both locked and archived needs a member with Manage Threads to reopen it.

What it looks like

{
  "message": "Thread is locked",
  "code": 160005
}

Why it happens

  • Moderator locked the thread and the bot lacks Manage Threads
  • Bot tries to unarchive a locked thread to post or add members
  • Ticket system posts updates to a thread staff has closed
  • Bot role lost Manage Threads after a permission change
  • The bot treats a locked thread like an archived one. Sending a message unarchives an archived thread automatically, but not a locked one.

How to fix Discord error 160005

  1. 1Fetch the thread and check thread_metadata.locked
  2. 2If the bot should manage threads, grant it Manage Threads in the parent channel
  3. 3Otherwise respect the lock: skip the post or send it to a staff channel
  4. 4Retry only after a moderator unlocks the thread
  5. 5Tell the two states apart: if thread_metadata.archived is true and locked is false, a normal message reopens the thread; if locked is true, only a member with Manage Threads can reopen it.

How to stop it recurring

Check the locked flag before acting in a thread, and decide per feature whether a lock should block the bot. For ticket systems, closing should mean the bot stops posting too. Thread caps and archive rules are on 160006 and 50083.

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

Related codes

Error 160005 - quick answers

What does Discord error 160005 mean?

The thread has been locked, and the action you tried is limited to members with Manage Threads. In a locked thread, only those members can unarchive it, and the thread stays read-only for everyone else. Locking is a moderation step, so 160005 usually means a moderator closed the thread on purpose.

How do I fix Discord error 160005?

1. Fetch the thread and check thread_metadata.locked 2. If the bot should manage threads, grant it Manage Threads in the parent channel 3. Otherwise respect the lock: skip the post or send it to a staff channel 4. Retry only after a moderator unlocks the thread 5. Tell the two states apart: if thread_metadata.archived is true and locked is false, a normal message reopens the thread; if locked is true, only a member with Manage Threads can reopen it.

Stop debugging Discord by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.