Telegram Bot API
Telegram's HTTP API for bot and mini-app developers. Lets bots receive messages, send replies, manage buttons, launch web apps, and integrate TON payments via TON Connect or Telegram Stars.
Aliases: bot api, telegram bot api
Telegram Bot API is Telegram’s official HTTP interface for bots and mini apps. Through it a bot receives user messages and sends replies; the same API exposes hooks for launching mini apps, managing UI, and processing payments.
What it gives you
The core surface:
- Messages. Receive inbound, send outbound, edit, delete.
- Buttons. Inline keyboards under messages, reply keyboards in chat, callback queries.
- Mini apps. Buttons that launch a WebApp, passing the user’s signed
initData. - Webhooks or long polling. A bot can either receive webhooks on its own server or poll the API.
- Payments. Telegram-native payments via providers (Stripe, regional gateways) and Telegram Stars.
- Files. Upload / download up to 50 MB via Bot API itself, up to 2 GB via the MTProto layer.
Relation to TON
Bot API does not talk to TON directly — it is HTTP into Telegram. But every TON mini app is built on top of it:
- The bot registers a mini app via
setMenuButton/setMainMenuButton. - The user presses the button; a WebView opens the mini app.
- Inside the mini app, the TON Connect SDK handles wallet integration — that part is a separate standard, not Bot API.
- Star payments are Bot API. TON payments are TON Connect.
In short, Bot API is the Telegram-side wrapper that makes TON apps reachable for hundreds of millions of users.
Architectural role for TON
Without Bot API there would be no Notcoin, Hamster Kombat, Catizen, or any of the dozens of mass-market TON apps. A mini app is a web app launched through Bot API, with the “real” TON logic running inside it.
Limits
- Rate limits — a bot cannot exceed a certain message rate (~30 per second per chat, higher for channels).
- No spam. Telegram bans bots that mass-DM. That limits aggressive marketing flows.
- Privacy mode. In groups, by default a bot only sees messages directed at it; privacy mode must be explicitly disabled to see everything.
- Not the full feature set. Full access to every Telegram capability lives in the MTProto API (via TDLib), but that is a much heavier integration not needed for most cases.
Docs
Official reference: core.telegram.org/bots/api. Methods are continuously expanded with each Telegram release. Mini-app docs at core.telegram.org/bots/webapps.