Discord API · error code

Discord error 40061: Tag names must be unique

Permanent - do not retryHTTP 400Validation and request shape

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
Tag names must be unique

What error 40061 means

You tried to create or modify a forum or media channel whose available_tags array contains two tags with the same name. Discord requires tag names within one channel to be unique, case-sensitively distinct as far as the API is concerned. The error comes from Create Guild Channel or Modify Channel when the tag list is included.

Bots that manage forum channels (support portals, suggestion boards, auto-tagging bots) run into this when they rebuild the tag list from an external source and the source has duplicates, or when they append a new tag without checking that a tag with that name already exists. Because Modify Channel replaces the whole available_tags array, any duplicate anywhere in the list fails the entire update.

What it looks like

{
  "message": "Tag names must be unique",
  "code": 40061
}

Why it happens

  • Appending a tag that already exists in available_tags
  • Building the tag list from a config or database that contains duplicate names
  • Two tags differing only in trailing whitespace or an emoji prefix being normalized to the same name
  • Merging tags from multiple sources without deduplication

How to fix Discord error 40061

  1. 1Fetch the channel (GET /channels/{id}) and inspect available_tags before modifying
  2. 2Deduplicate by name before sending; keep the existing tag's id when a name already exists
  3. 3Send the full, deduplicated available_tags array in the PATCH
  4. 4Remember forum channels allow at most 20 tags with names of 0-20 characters

How to stop it recurring

Treat tag name as a unique key in whatever store backs your bot's forum configuration, and always reconcile against the live channel before writing. Add a validation step in your config loader that rejects duplicate tag names up front.

Forum tag management is a full-array replace, which makes it a natural place for a reconciliation function: fetch, merge by name, dedupe, write. The 20-tag budget and tag name length are on the Discord limits page; structural tag errors beyond duplication (too many, too long) come back as 50035 with the field named.

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

Related codes

Error 40061 - quick answers

What does Discord error 40061 mean?

You tried to create or modify a forum or media channel whose available_tags array contains two tags with the same name. Discord requires tag names within one channel to be unique, case-sensitively distinct as far as the API is concerned. The error comes from Create Guild Channel or Modify Channel when the tag list is included.

How do I fix Discord error 40061?

1. Fetch the channel (GET /channels/{id}) and inspect available_tags before modifying 2. Deduplicate by name before sending; keep the existing tag's id when a name already exists 3. Send the full, deduplicated available_tags array in the PATCH 4. Remember forum channels allow at most 20 tags with names of 0-20 characters

Should I retry after error 40061?

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.