Telegram error 400: Bad Request: not enough rights to manage pinned messages in the chat
Last verified against Telegram Bot API reference
Bad Request: not enough rights to manage pinned messages in the chatWhat error 400 means
pinChatMessage, unpinChatMessage or unpinAllChatMessages was called in a chat where the bot lacks the pin permission. The reference spells out the rule: in private chats all non-service messages can be pinned, but in groups the bot must be an administrator with can_pin_messages, and in channels it needs can_edit_messages.
The message and chat exist. TDLib checks the bot's permissions before talking to Telegram's servers and returns this sentence when they are not sufficient, so nothing was attempted. The rights differ by chat type, which is why a bot that pins happily in a channel can fail in a group (or the reverse) with an identical admin setup.
Basic groups add one nuance. In TDLib's check, a bot in a basic group must be an appointed administrator to pin, even if the group lets ordinary members pin. So a bot that is merely a member fails there regardless of the group's default permissions.
What it looks like
{"ok":false,"error_code":400,"description":"Bad Request: not enough rights to manage pinned messages in the chat"}Why it happens
- The bot is not an administrator in the group or supergroup.
- The bot is an admin without
can_pin_messages(groups) orcan_edit_messages(channels). - The chat is a basic group and the bot is a regular member, which is never enough to pin there.
- Rights were granted in one chat but the bot is pinning in another.
How to fix Telegram error 400
- 1Grant Pin Messages to the bot in a group, or Edit Messages of Others in a channel.
- 2Check current rights with
getChatMemberusing the bot's own user ID. - 3Treat pinning as optional: catch this error and continue the workflow without the pin.
How to stop it recurring
Request only the rights your bot uses and verify them on join. You can pre-select rights for the "add to group" flow with setMyDefaultAdministratorRights, so admins see pin permission ticked when they add the bot. Re-check whenever a my_chat_member update reports changed rights.
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?
pinChatMessage , unpinChatMessage or unpinAllChatMessages was called in a chat where the bot lacks the pin permission. The reference spells out the rule: in private chats all non-service messages can be pinned, but in groups the bot must be an administrator with can_pin_messages , and in channels it needs can_edit_messages . The message and chat exist.
How do I fix Telegram error 400?
1. Grant Pin Messages to the bot in a group, or Edit Messages of Others in a channel. 2. Check current rights with getChatMember using the bot's own user ID. 3. Treat pinning as optional: catch this error and continue the workflow without the pin.
Stop debugging Telegram by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.