How the webhook is registered
Timely.ai calls thesetWebhook method of the Bot API pointing to its servers:
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 incrementingupdate_id, plus exactly one field with the event type:
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
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 asmessage 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.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. Useupdate_id for deduplication:
Next steps
Platform webhooks
Normalized events that Timely.ai fires to your server.
Channels — API Reference
Manage Telegram channels via API.