Discord API · error code

Discord error 40041: Application command name already exists

Permanent - do not retryHTTP 400Interactions and slash commands

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
An application command with that name already exists

What error 40041 means

Discord rejected a command because another command of the same type in the same scope already uses that name. Command names must be unique per type: you can have a slash command and a user context-menu command both called report, but not two slash commands called report in the same scope.

Note that creating a single command with POST /applications/{application.id}/commands using an existing name does not fail; Discord documents that it overwrites the old command. The error appears in situations that cannot be resolved as an overwrite, most commonly renaming a command with PATCH to a name another command already holds, or a bulk overwrite (PUT) array that contains the same name and type twice.

Duplicate entries in a bulk payload usually come from a loader that reads command files from disk and includes a file twice, or two files that export the same name.

What it looks like

{
  "message": "An application command with that name already exists",
  "code": 40041
}

Why it happens

  • Bulk overwrite array includes two commands with the same name and type
  • PATCH renames a command to a name already used by another command
  • Command loader reads the same file twice or two modules export one name
  • Localized default name collides with another command's name

How to fix Discord error 40041

  1. 1Log the full array you send to the bulk overwrite endpoint and search it for duplicate name and type pairs
  2. 2Fix the loader so each command module is registered exactly once
  3. 3For renames, delete or rename the conflicting command first
  4. 4Re-run registration and confirm GET /applications/{application.id}/commands shows each name once

How to stop it recurring

Validate your command set locally before registering: assert unique name and type pairs in a test. Registering through a single bulk overwrite from one source file keeps the deployed list predictable. Command count and naming limits are on the Discord limits page.

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

Related codes

Error 40041 - quick answers

What does Discord error 40041 mean?

Discord rejected a command because another command of the same type in the same scope already uses that name. Command names must be unique per type: you can have a slash command and a user context-menu command both called report , but not two slash commands called report in the same scope.

How do I fix Discord error 40041?

1. Log the full array you send to the bulk overwrite endpoint and search it for duplicate name and type pairs 2. Fix the loader so each command module is registered exactly once 3. For renames, delete or rename the conflicting command first 4. Re-run registration and confirm GET /applications/{application.id}/commands shows each name once

Should I retry after error 40041?

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.