Skip to main content
Telegram uses a model called Updates to notify bots about any interaction: received messages, edits, inline button clicks, group joins, and more. When you connect a Telegram bot in Timely.ai, the platform automatically configures a webhook in the Telegram Bot API to receive those updates and transform them into workspace events. This page documents the raw update format — useful for debugging or direct integrations with the Telegram API.

How the webhook is registered

Timely.ai calls the setWebhook method of the Bot API pointing to its servers:
To check the current webhook configuration of your bot, use:
If you manage the bot directly (without Timely as an intermediary), never configure two webhooks on the same token — Telegram delivers each update to only one endpoint.

Base structure of an Update

Every Telegram update has a unique and incrementing update_id, plus exactly one field with the event type:
Possible fields at the root level are: message, edited_message, channel_post, edited_channel_post, inline_query, callback_query, my_chat_member, chat_member, among others.

Payload: message

The most common type — a new message sent to the bot.

Message with media

Telegram sends multiple image sizes in the photo array. Always use the last element (highest resolution). To download: GET https://api.telegram.org/bot{TOKEN}/getFile?file_id={FILE_ID} then https://api.telegram.org/file/bot{TOKEN}/{file_path}.

Payload: edited_message

Sent when the user edits an already-sent message. Contains the same fields as message plus the edit_date field.
Timely.ai treats edited_message as an update to the original message. Edit history is not stored — only the most recent content is displayed in the conversation.

Payload: callback_query

Triggered when the user clicks an inline keyboard button. Commonly used for interactive menu flows.
After receiving a callback_query, you must reply with answerCallbackQuery to dismiss the loading indicator in the client:

Chat types

Key Update fields

Idempotency via update_id

Telegram guarantees at-least-once delivery. In case of a network failure, the same update may be resent. Use update_id for deduplication:
In production, persist the processed IDs in Redis or a database — not in memory.

Next steps

Platform webhooks

Normalized events that Timely.ai fires to your server.

Channels — API Reference

Manage Telegram channels via API.