Telegram Bot API · error code

Telegram error 400: Bad Request: not enough rights to restrict/unrestrict chat member

ConfigurationHTTP 400400 Bad Request: identifiers, content and rights

Last verified against Telegram Bot API reference

What Telegram returns
Bad Request: not enough rights to restrict/unrestrict chat member

What error 400 means

A moderation call such as restrictChatMember or banChatMember was made in a supergroup or channel where the bot does not have the permission to restrict members. The docs for both methods say the bot must be an administrator and must have the appropriate administrator rights; the right in question is can_restrict_members, documented as letting an admin "restrict, ban or unban chat members".

TDLib checks this before contacting Telegram's servers and returns the sentence with the slash in it. The target user, chat and permissions object are not the problem. The bot simply is not allowed to apply them.

Anti-spam and captcha bots see this most often right after being added: the group owner adds the bot as an admin but leaves Ban Users unticked, so the first new member who fails the check cannot be muted or removed. It also appears when an owner trims admin permissions later.

What it looks like

{"ok":false,"error_code":400,"description":"Bad Request: not enough rights to restrict/unrestrict chat member"}

Why it happens

  • The bot is an admin without the Ban Users right (can_restrict_members).
  • The bot was added as an ordinary member, so it holds no admin role in that supergroup.
  • Rights were reduced after setup, for example during a permissions clean-up.

How to fix Telegram error 400

  1. 1Grant the bot Ban Users in the chat's administrator settings.
  2. 2Confirm with getChatMember on the bot's own ID that can_restrict_members is true.
  3. 3Request the right up front with setMyDefaultAdministratorRights so the add-to-group dialog includes it.
  4. 4Tell the chat owner which right is missing instead of failing silently.

How to stop it recurring

Verify moderation rights the moment the bot becomes an admin, and post a one-time setup message listing anything missing. Check rights again on every my_chat_member update. Note that some targets cannot be restricted even with full rights; see user is an administrator of the chat.

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?

A moderation call such as restrictChatMember or banChatMember was made in a supergroup or channel where the bot does not have the permission to restrict members. The docs for both methods say the bot must be an administrator and must have the appropriate administrator rights; the right in question is can_restrict_members , documented as letting an admin "restrict, ban or unban chat members".

How do I fix Telegram error 400?

1. Grant the bot Ban Users in the chat's administrator settings. 2. Confirm with getChatMember on the bot's own ID that can_restrict_members is true. 3. Request the right up front with setMyDefaultAdministratorRights so the add-to-group dialog includes it. 4. Tell the chat owner which right is missing instead of failing silently.

Stop debugging Telegram by hand

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