deleteWebhook
Deletes a webhook.
Returns: On success, returns True.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
drop_pending_updates | Boolean | Optional | Drop pending updates |
Example request
curl
curl -s "https://api.telegram.org/bot$TOKEN/deleteWebhook"
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.get(f"https://api.telegram.org/bot{TOKEN}/deleteWebhook", timeout=30)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/deleteWebhook`);
console.log(await res.json());
Step-by-step guide: How to Set Up a Telegram Bot Webhook: setWebhook, Secret Token and Troubleshooting
Related methods
getWebhookInfoReturns webhook info.setWebhookSets a webhook.getUpdatesGets updates. Use the 'Start' button for long polling.