Communication
Telegram Webhooks
Messaging platform with bot API. Receive events for messages, commands, callbacks, and group updates.
Connecting Telegram to Hookbase
Create a source in Hookbase first — it gives you an ingest URL to paste into Telegram. Then:
- 1Create a bot with @BotFather and copy your bot token
- 2Copy the Secret token Hookbase generated for this source
- 3Call setWebhook: POST https://api.telegram.org/bot<token>/setWebhook with url=<your Hookbase ingest URL> and secret_token=<the Secret token>
- 4Optionally set allowed_updates to limit which update types Telegram sends
- 5Telegram now includes the token in the X-Telegram-Bot-Api-Secret-Token header of every update
Signature verification
Set the source's provider to telegram and paste the signing secret. Every request is checked before the event is stored, and anything that fails is rejected rather than quietly recorded.
- Algorithm
- IP allowlisting + secret token
- Header
- X-Telegram-Bot-Api-Secret-Token
- Where to find the secret
- Hookbase generates this token. Pass it as secret_token in your setWebhook call (1-256 chars: A-Z, a-z, 0-9, _ and -).
Telegram event types
6 of the events people route most often. Hookbase accepts every event Telegram sends, whether or not it is listed here.
message
A new message was received
edited_message
A message was edited
callback_query
A callback button was pressed
inline_query
An inline query was received
channel_post
A new post in a channel
chat_member
A chat member status changed
What a Telegram webhook looks like
A message payload. Hookbase stores the raw body exactly as it arrived, so this is also what you get back on a replay.
{
"update_id": 123456789,
"message": {
"message_id": 42,
"from": {
"id": 12345,
"is_bot": false,
"first_name": "John",
"username": "johndoe"
},
"chat": {
"id": -100123456789,
"title": "My Group",
"type": "group"
},
"date": 1678901234,
"text": "Hello, bot!"
}
}Telegram IP ranges
Paste these into the source's IP allowlist to drop anything that did not come from Telegram. Providers do change these — check their documentation before relying on the list.
149.154.160.0/2091.108.4.0/22Start receiving Telegram webhooks
Create a source, paste the URL into Telegram, and watch the first event arrive. The free tier includes 1,000 events a month.
Get Started Free