Telegram Bot API · error code

Telegram error 400: Bad Request: user is an administrator of the chat

Permanent - do not retryHTTP 400400 Bad Request: identifiers, content and rights

Last verified against Telegram Bot API reference

What Telegram returns
Bad Request: user is an administrator of the chat

What error 400 means

The bot tried to restrict or ban a user who is an administrator. Telegram's servers answer such requests with the MTProto error USER_ADMIN_INVALID, and the Bot API server source rewrites that name into this sentence.

Restrictions and bans apply to regular members. To act on an admin, they must first be demoted, and a bot can only change an admin it is allowed to edit. The ChatMemberAdministrator object exposes this as can_be_edited: "True, if the bot is allowed to edit administrator privileges of that user." The docs for can_promote_members add that an admin can demote only the administrators they promoted, directly or indirectly.

So the bot may have every right and still fail, because the target was promoted by the owner or another admin. Moderation bots hit this when a rule flags an admin's message, or when a mute command is used on a moderator.

What it looks like

{"ok":false,"error_code":400,"description":"Bad Request: user is an administrator of the chat"}

Why it happens

  • An automated rule tried to mute or ban an admin.
  • A moderator used a ban or mute command on another moderator.
  • The target was promoted by someone else, so the bot cannot demote them first.

How to fix Telegram error 400

  1. 1Check the target with getChatMember; skip when status is administrator or creator.
  2. 2If the bot must act, demote first with promoteChatMember (all rights false); this only works when can_be_edited is true.
  3. 3Ask the owner to demote the user manually when the bot cannot edit them.
  4. 4Show moderators a clear message rather than the raw error.

How to stop it recurring

Keep an admin cache per chat from getChatAdministrators, refresh it on chat_member updates, and exclude admins from automated actions. If your bot is meant to manage admins, have it promote them itself so it retains the ability to edit them later.

Official reference: Telegram Bot API reference. See all Telegram error codes or the Telegram limits and quotas.

Related codes

Error 400 - quick answers

What does Telegram error 400 mean?

The bot tried to restrict or ban a user who is an administrator. Telegram's servers answer such requests with the MTProto error USER_ADMIN_INVALID , and the Bot API server source rewrites that name into this sentence. Restrictions and bans apply to regular members. To act on an admin, they must first be demoted, and a bot can only change an admin it is allowed to edit.

How do I fix Telegram error 400?

1. Check the target with getChatMember ; skip when status is administrator or creator . 2. If the bot must act, demote first with promoteChatMember (all rights false); this only works when can_be_edited is true. 3. Ask the owner to demote the user manually when the bot cannot edit them. 4. Show moderators a clear message rather than the raw error.

Should I retry after error 400?

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 Telegram by hand

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