# Telegram Bot API

> The messaging platform that's a pleasure to build on. My first pick for a bot, when the users are there.

- Verdict: My default
- Vendor: Telegram
- Layer: [Email and messaging](https://cloudlesslabs.com/stack/layers/email/index.md). Job: Messaging users and bots
- Last reviewed: 22 October 2026, by Nicolas Dao (Cloudless Labs, Sydney)
- Web page: https://cloudlesslabs.com/stack/telegram/. The whole stack in one file: https://cloudlesslabs.com/stack/brief.md

I moved a live product from WhatsApp to Telegram after WhatsApp blocked our account, and the difference was night and day.

On Telegram you deal with the real thing. No partner in the middle, no business verification, no template approval: anyone can create a bot by talking to @BotFather, and a few minutes later it's receiving messages. The documentation is clear, the API is flexible (buttons, inline keyboards, Mini Apps, files, groups), and the team behind it clearly built it for developers. Our users had a better experience too.

It isn't lawless. Telegram's developer terms ban spam, scams and pyramid schemes, and it can ban a bot. Digital goods sold inside Telegram must be paid in Stars. But the rules are the ones you'd expect, and nothing stands between you and shipping.

The catch is the one that matters most: where are your users? Telegram has about a billion of them, but in Australia it's a fraction of WhatsApp's audience, and if your users won't install it, its developer experience is worth nothing. So it's my first pick for a bot when the audience allows it, and the fallback channel I keep ready when it doesn't.

## Use it when

- A bot or an agent that users message: notifications, tasks, questions and answers, approvals.
- Your audience will install Telegram, or already has it: strong in Europe, Asia, the Middle East and crypto and tech communities.
- You want to ship this week: create a bot with @BotFather, set a webhook, reply.

## Don't use it when

- Your users are on WhatsApp and won't install another app. In Australia, about 2 million people use Telegram against 16 million on WhatsApp.
- Selling digital goods with your own payment provider: inside Telegram they must be paid in Stars.

## Pricing

Free: no approval, no per-message fees. Paid broadcasts above the normal limits cost 0.1 Star per message. Digital goods sold inside Telegram must be paid in Telegram Stars.

## Gotchas, with fixes

- **Gotcha:** Sending too fast returns HTTP 429: about one message a second per chat, 20 a minute per group, 30 a second in bulk.
  **Fix:** Send through a rate-limited queue and wait the retry_after the error gives you.
- **Gotcha:** Bots can download files up to 20 MB and upload up to 50 MB.
  **Fix:** Run Telegram's local Bot API server: no download limit, uploads up to 2,000 MB.
- **Gotcha:** A bot receives updates by webhook or by polling, never both, and the webhook only works on ports 443, 80, 88 or 8443 over TLS.
  **Fix:** Use a webhook on 443 in production (a Lambda function URL or a Worker is enough), and drop the webhook before polling in development.
- **Gotcha:** "Task" and "earn" bots are a known scam pattern on Telegram, and its terms let it ban bots too.
  **Fix:** Link to your own website and privacy policy, never message people who didn't start the bot, and keep the brand consistent.

## Provisioning

No provider · No Terraform provider

A bot is created by talking to @BotFather, and its webhook is set with one API call. Nothing to provision.

## Instead, consider

- [WhatsApp Business Platform](https://cloudlesslabs.com/stack/whatsapp/index.md): Your users are on WhatsApp and won't move: accept the approval process and the risk of a ban.
- [Amazon SES](https://cloudlesslabs.com/stack/aws-ses/index.md): One-way notifications: email reaches everyone, with no app to install.

## Worked examples

- [WhatsApp or Telegram](https://cloudlesslabs.com/stack/guides/whatsapp-or-telegram/index.md): Our bot should reach users in a messaging app. WhatsApp or Telegram, and why did yours get blocked?

## Where it fits

- [A bot users message](https://cloudlesslabs.com/stack/use-cases/messaging-bot/index.md): pick 1. Start here if your users will install it. No approval, no fees, a direct API.

## Sources

- [Telegram: Bot API](https://core.telegram.org/bots/api)
- [Telegram: Bots FAQ (limits, webhooks)](https://core.telegram.org/bots/faq)
- [Telegram: payments in Stars](https://core.telegram.org/bots/payments-stars)
- [Telegram: Bot Platform Developer Terms](https://telegram.org/tos/bot-developers)
- [Telegram Bot API server (local mode)](https://github.com/tdlib/telegram-bot-api)

## Related

- [Email and messaging](https://cloudlesslabs.com/stack/layers/email/index.md): every tool in this layer, with its verdict
- [The whole stack in one file](https://cloudlesslabs.com/stack/brief.md): every use case and tool, for questions that span many
- [Map of every Markdown file on cloudlesslabs.com, with what each one answers](https://ask.cloudlesslabs.com)
