Telegram error 409: Conflict: can't use getUpdates method while webhook is active
Last verified against Telegram Bot API reference
Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook firstWhat error 409 means
A webhook is registered for this token, and your code is trying to poll with getUpdates. The Bot API documents the two delivery modes as mutually exclusive: while a webhook URL is set, every getUpdates call returns this 409, and the description tells you the remedy in the same sentence. Updates are being delivered to the webhook URL instead, or piling up there if that URL is dead.
This is the single most common cause of 'my bot runs but never receives anything' for bots that were once deployed with webhooks, or whose framework registered a webhook automatically, and are now being run locally with polling. Many libraries swallow the 409 and retry forever, so the process looks healthy in logs while receiving nothing.
Libraries surface it the same way as the other 409: python-telegram-bot raises telegram.error.Conflict, aiogram raises TelegramConflictError, Telegraf rejects with a TelegramError carrying this description, and node-telegram-bot-api emits a polling_error with code ETELEGRAM. Read the description text to tell the two apart: this one names the webhook, the other names a competing getUpdates request.
The repair is a two-call dance. First inspect, then delete:
curl "https://api.telegram.org/bot<TOKEN>/getWebhookInfo"
# {"ok":true,"result":{"url":"https://old-host.example/webhook","pending_update_count":218,...}}
curl "https://api.telegram.org/bot<TOKEN>/deleteWebhook?drop_pending_updates=true"
# {"ok":true,"result":true,"description":"Webhook was deleted"}drop_pending_updates=true discards the backlog (up to 24 hours of updates are retained); omit it if you want the queued updates replayed into your poller.
What it looks like
{"ok":false,"error_code":409,"description":"Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}Why it happens
- A previous deployment, a teammate, or a framework default called
setWebhookon this token. - The same token is shared between a webhook-based production deploy and a polling-based local run.
- A hosting platform's Telegram integration registered its own webhook.
- A migration from webhooks to polling that never called
deleteWebhook.
How to fix Telegram error 409
- 1Call
getWebhookInfo; theurlfield shows the registered webhook andpending_update_countshows the backlog. - 2If you intend to poll, call
deleteWebhook, addingdrop_pending_updates=trueif you do not want the backlog replayed. - 3If you intend to use webhooks, stop the polling process instead and leave the webhook in place.
- 4Restart the poller and confirm
getUpdatesnow returns 200 with an array of updates. - 5If the 409 comes back later, something re-registered the webhook; search your codebase and platform integrations for
setWebhookcalls.
How to stop it recurring
Decide per environment: webhooks in production, polling in development, and different tokens for each. Have your polling entrypoint call deleteWebhook on startup and your webhook entrypoint call setWebhook on startup, so the mode is always explicit rather than inherited from the last deploy. Check getWebhookInfo as the first diagnostic whenever a bot goes quiet; that habit is step 1 of the checklist in Telegram bot not responding, and the webhook-side failure modes are covered in the webhook debugging guide. Port and scheme rules for the webhook you register are listed under webhook limits.
Official reference: Telegram Bot API reference. See all Telegram error codes or the Telegram limits and quotas.
Related codes
- 409: Conflict: terminated by other getUpdates requestConflict: terminated by other getUpdates request; make sure that only one bot…
- 400: Bad Request: bad webhook: HTTPS url must be provided for webhookBad Request: bad webhook: HTTPS url must be provided for webhook
- 400: Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 or 8443Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 or…
- 401: UnauthorizedUnauthorized
Error 409 - quick answers
What does Telegram error 409 mean?
A webhook is registered for this token, and your code is trying to poll with getUpdates . The Bot API documents the two delivery modes as mutually exclusive: while a webhook URL is set, every getUpdates call returns this 409, and the description tells you the remedy in the same sentence. Updates are being delivered to the webhook URL instead, or piling up there if that URL is dead.
How do I fix Telegram error 409?
1. Call getWebhookInfo ; the url field shows the registered webhook and pending_update_count shows the backlog. 2. If you intend to poll, call deleteWebhook , adding drop_pending_updates=true if you do not want the backlog replayed. 3. If you intend to use webhooks, stop the polling process instead and leave the webhook in place. 4. Restart the poller and confirm getUpdates now returns 200 with an array of updates. 5. If the 409 comes back later, something re-registered the…
Stop debugging Telegram by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.