Telegram Bot '403 Forbidden: bot was blocked by the user'? The 4-Step Way to Handle It
What does "403 Forbidden: bot was blocked by the user" mean on a Telegram bot?
It means that user blocked your bot, so Telegram refuses to deliver anything to their private chat until they unblock it. In the official Telegram Bot API server source code, Telegram's internal USER_IS_BLOCKED error is turned into HTTP error code 403 with the description "bot was blocked by the user", which libraries usually print as 403 Forbidden: bot was blocked by the user. Your token, chat ID and code are fine; retrying won't help. This guide gives a 4-step method to handle it, the related 403 errors that look similar, and how to detect blocks before a send fails. Checked against Telegram's Bot API documentation and the telegram-bot-api source on 2026-11-19.
Why can't a bot just message the user again?
Because Telegram only lets bots talk to people who chose to talk to them. Telegram's introduction to bots says bots can't start conversations with users: a user must either add them to a group or send them a message first. Blocking withdraws that choice. There is no Bot API method to ask for permission again, and a bot can't unblock itself. The only way back is the user unblocking the bot and sending it something, for example /start.
| Situation | Can the bot send? | What changes it |
|---|---|---|
| User started the bot | Yes | - |
| User blocked the bot | No, 403 | User unblocks and messages it |
| User never started the bot | No | User opens the bot and presses Start |
| Account deleted | No, 403 "user is deactivated" | Nothing; remove the chat |
The 4-step "stop, flag, listen, resume" method
This is how we handle blocked users in our own Telegram bots, including the Auto X scheduler:
- Stop on the first 403. Catch the error in your send function and don't retry it. Unlike a 429, there is no
retry_afterto wait for. - Flag the chat, don't delete it. Store
blocked=trueand the date on the user record, and skip flagged chats in every broadcast, reminder and queue. - Listen for
my_chat_member. Telegram sends this update when the bot is blocked or unblocked in a private chat, so you can flag users before your next send fails. - Resume on the next message. When an unblock update or any new message arrives from a flagged user, clear the flag and continue.
How do you detect a block before sending?
Subscribe to the my_chat_member update. The Bot API's Update object says this update arrives when "the bot's chat member status was updated in a chat", and that "for private chats, this update is received only when the bot is blocked or unblocked by the user." Because in a private chat it only fires on a block or an unblock, you can read it simply: if the new status is no longer member, the user blocked the bot; if it changed back to member, they unblocked it. Log the raw status values your bot receives the first time, so your code matches what Telegram actually sends.
// Pseudocode for a webhook handler
if (update.my_chat_member && update.my_chat_member.chat.type === 'private') {
const status = update.my_chat_member.new_chat_member.status;
if (status === 'member') await users.clearBlocked(update.my_chat_member.chat.id);
else await users.flagBlocked(update.my_chat_member.chat.id);
}
If you set allowed_updates in setWebhook or getUpdates, include "my_chat_member", or the update never reaches you. When updates stop arriving at all, the cause is usually the webhook itself; see our guide to a Telegram webhook that isn't working.
Which other 403 errors look similar?
Several 403s share the "Forbidden" prefix, and each needs a slightly different record. The telegram-bot-api source returns these descriptions:
| Description | Meaning | What to store |
|---|---|---|
| bot was blocked by the user | User blocked the bot | Flag; can be reversed by the user |
| Forbidden: user is deactivated | The Telegram account is gone | Mark inactive permanently |
| Forbidden: bot was kicked from the group chat | Removed from a group | Flag the group, not the users |
| Forbidden: bot is not a member of the channel chat | Bot isn't in that channel | Check the channel admin list |
Keep the reason, not just an "inactive" flag. A blocked user may come back; a deactivated account won't. Telegram's Bot API documentation also warns that the integer error_code is subject to change, so match on the description text as well as the code.
Why do blocked users hurt a scheduler or broadcast bot?
Because every failed send still spends your rate budget. Telegram's Bots FAQ says bots should avoid more than one message per second in a single chat and can't broadcast more than about 30 messages per second for bulk notifications without paid broadcasts, and that going over leads to 429 errors. A queue that keeps retrying blocked chats spends part of that limit on messages that can never arrive; our guide to Telegram rate limits and retry_after covers the 429 side.
Treat 403 as a permanent failure in your retry logic. A message that failed with 403 belongs in a "won't deliver" state, not a retry queue; the pattern in our failed-publish retry and dead-letter guide applies here. Mobile push has the same problem with stale device tokens, and GSPTeck's guide to FCM token hygiene handles it the same way: remove recipients that can't receive.
How can a bot get blocked less often?
Send fewer, more useful messages and let people control them. Common causes are unrequested broadcasts, reminders nobody asked for, and no visible way to turn notifications off. Give users a setting or command to pause messages, keep confirmations short, and only message people about things they started.
Measure it, too. Count 403 "blocked" errors per message type for a week; if one reminder or broadcast produces most of them, that message is the one to cut or make opt-in. If you want to schedule posts to X from Telegram without building your own bot, the Auto X Telegram bot does that; it is our own product, and the Auto X homepage lists its plans. A different Bot API limit is a message that exceeds 4096 characters; see how to split a sendMessage that is too long.
FAQ
Can a bot tell if a user deleted the chat without blocking?
Not from the documented updates. Telegram sends my_chat_member in private chats only when the bot is blocked or unblocked, so a deleted chat with no block produces no update.
Should I delete a user's data when they block the bot?
That's a product and privacy decision. Flagging keeps their settings if they come back; deleting suits bots that promise not to keep data. Follow your privacy policy either way.
Does the 403 count against my bot or get it banned?
Telegram doesn't document a penalty for receiving 403 errors. The practical cost is the rate budget you waste by retrying chats that can't receive messages.
How do I know a user unblocked the bot?
You receive a my_chat_member update whose new status is member, or a new message from that user. Clear the flag when either arrives.
Sources
- Telegram Bot API: Update object, my_chat_member and allowed_updates (checked 2026-11-19)
- Telegram Bot API: Making requests, error_code and description (checked 2026-11-19)
- Telegram: Bots, an introduction for developers (checked 2026-11-19)
- Telegram: Bots FAQ, broadcasting limits (checked 2026-11-19)
- tdlib/telegram-bot-api: Client.cpp error descriptions (checked 2026-11-19)