# Telegram Bot API limits: 429 errors and retry_after

> Telegram's documented bot limits per chat, per group and across chats, the 429 response with retry_after, paid broadcasts, and a sender that waits as told.

Published 2026-11-02. Z-API Omni team.

Telegram returns error 429 when a bot sends faster than its limits, and the response tells you how long to wait in `parameters.retry_after`. Telegram's Bots FAQ gives three limits. Send about one message per second to a single chat, at most 20 messages per minute to a group, and about 30 messages per second when broadcasting to many users. Wait the number of seconds in `retry_after`, then repeat the request. Paid broadcasts raise the cross-chat limit to 1000 messages per second for bots that qualify.

## The limits Telegram documents

The figures come from one FAQ answer, "My bot is hitting limits, how do I avoid this?" ([Bots FAQ, accessed 2026-11-02](https://core.telegram.org/bots/faq)). Telegram frames them as limits "on the number of messages they can broadcast in a single interval".

| Scope | Telegram's wording |
| --- | --- |
| One chat | "avoid sending more than one message per second" |
| One group | "bots are not be able to send more than 20 messages per minute" |
| Broadcast to many users | "bots are not able to broadcast more than about 30 messages per second" |
| With paid broadcasts | "up to 1000 messages per second" |

The group line has Telegram's own typo. The per-chat limit is soft at first. "We may allow short bursts that go over this limit, but eventually you'll begin receiving 429 errors." Don't plan on the burst, because Telegram gives no size for it.

Twenty per minute in a group works out to one message every 3 seconds. A bot that answers each member's command in a busy group reaches that limit first, long before the cross-chat ceiling.

The FAQ answer covers sending messages only. Telegram doesn't document separate limits for editing messages, answering callback queries or other methods. It also doesn't publish any other per-bot global limit.

## The 429 response and retry_after

Every Bot API response is a JSON object with a Boolean `ok`. When `ok` is false, the object carries an `error_code` and a `description`. "Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error" ([Bot API, Making requests, accessed 2026-11-02](https://core.telegram.org/bots/api)).

`ResponseParameters` "Describes why a request was unsuccessful" and has two fields.

| Field | Meaning |
| --- | --- |
| `retry_after` | "In case of exceeding flood control, the number of seconds left to wait before the request can be repeated" |
| `migrate_to_chat_id` | "The group has been migrated to a supergroup with the specified identifier." |

Telegram doesn't publish a literal 429 body. The shape below follows the fields in the Bot API docs and isn't a captured response. The description text is a placeholder.

```json
{
  "ok": false,
  "error_code": 429,
  "description": "DESCRIPTION_TEXT",
  "parameters": {
    "retry_after": 12
  }
}
```

Read `retry_after` from `parameters`. Don't parse the number out of `description`, because Telegram doesn't document that text. Telegram also doesn't say whether the wait applies to one chat or to the whole bot. The sender below pauses everything, which costs a few seconds of throughput and makes a second 429 less likely.

Handle `migrate_to_chat_id` in the same place. It means the group now lives under a new supergroup identifier. Save that ID and resend to it.

## Paid broadcasts

Paid broadcasts are switched on in @BotFather. The FAQ says they allow a bot "to broadcast up to 1000 messages per second." Each message over the free 30 per second "incurs a cost of 0.1 Stars per message", paid from the bot's Stars balance. Only successful messages are charged.

The bar to enable it is high. The bot needs "at least 100,000 Stars on its balance and at least 100,000 monthly active users."

The Bot API reference describes the switch per request. Send methods accept `allow_paid_broadcast`. Its documentation reads: "Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message." That sentence doesn't repeat the FAQ's point that only messages above 30 per second are charged. Read both pages before you budget, and treat the stricter reading as the safe one.

Without paid broadcasts, Telegram's advice is to spread notifications "over longer intervals (e.g. 8-12 hours)". A message to 100,000 users at 25 per second takes a little over an hour. Spreading it across 8 hours brings the rate near 3.5 per second.

## Two places a 429 hides

The `close` method "will return error 429 in the first 10 minutes after the bot is launched." A deploy script that calls `close` right after starting a bot gets 429 for reasons unrelated to message volume.

Webhook replies hide the error completely. The Bot API lets a bot answer a webhook update by returning a method call in the HTTP response. Telegram adds: "It's not possible to know that such a request was successful or get its result." A reply sent that way can't show you a 429, so send anything that matters through a normal HTTP call. The webhook itself is covered in [Telegram webhook setup with a secret token](/academy/articles/telegram-bot-api-webhook-setup-secret-token/).

## A sender that honors retry_after

The queue below runs in Node.js 18 or later. It applies the three documented limits with margin and pauses on 429 for the time Telegram asks. It also follows a group's migration to a supergroup.

```js
// tg-sender.mjs. Run: BOT_TOKEN=... node tg-sender.mjs CHAT_ID "Your order shipped"
const TOKEN = process.env.BOT_TOKEN;
const GLOBAL_PER_SEC = 25;   // under Telegram's "about 30 messages per second"
const PRIVATE_GAP_MS = 1000; // one message per second in a single chat
const GROUP_GAP_MS = 3000;   // 20 messages per minute in a group
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));

let pausedUntil = 0;              // set from retry_after
let tokens = GLOBAL_PER_SEC;
let last = Date.now();
const nextSlot = new Map();       // chat_id -> earliest send time
const migrated = new Map();       // old chat_id -> supergroup id

async function takeGlobal() {
  for (;;) {
    const now = Date.now();
    if (now < pausedUntil) { await sleep(pausedUntil - now); continue; }
    tokens = Math.min(GLOBAL_PER_SEC, tokens + ((now - last) / 1000) * GLOBAL_PER_SEC);
    last = now;
    if (tokens >= 1) { tokens -= 1; return; }
    await sleep(((1 - tokens) / GLOBAL_PER_SEC) * 1000);
  }
}

function reserve(chatId, isGroup) {
  const gap = isGroup ? GROUP_GAP_MS : PRIVATE_GAP_MS;
  const slot = Math.max(Date.now(), nextSlot.get(chatId) ?? 0);
  nextSlot.set(chatId, slot + gap);
  return slot - Date.now();
}

export async function sendMessage(chatId, text, { isGroup = false } = {}) {
  for (let attempt = 0; attempt < 5; attempt++) {
    const target = migrated.get(chatId) ?? chatId;
    await sleep(Math.max(0, reserve(target, isGroup)));
    await takeGlobal();
    const res = await fetch(`https://api.telegram.org/bot${TOKEN}/sendMessage`, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ chat_id: target, text }),
    });
    const json = await res.json();
    if (json.ok) return json.result;

    const p = json.parameters ?? {};
    if (json.error_code === 429 && p.retry_after) {
      pausedUntil = Math.max(pausedUntil, Date.now() + p.retry_after * 1000); // scope not documented: pause all
      continue;
    }
    if (p.migrate_to_chat_id) { migrated.set(chatId, p.migrate_to_chat_id); continue; }
    throw new Error(JSON.stringify(json)); // not a limit problem: do not retry
  }
  throw new Error(`gave up sending to ${chatId}`);
}

if (process.argv[2]) console.log(await sendMessage(process.argv[2], process.argv[3] ?? 'test'));
```

The per-chat reservation happens before any `await`, so two messages for the same chat in the same tick get separate slots. You pass `isGroup` because the code can't tell a group from a private chat by itself. The `chat.type` field in the update you are answering gives you that.

This state lives in one process. With several workers, move `pausedUntil`, the token bucket and `nextSlot` into Redis, keyed by bot token and chat ID. The same design for WhatsApp, where Meta sets a per-number rate and a per-recipient gap, is in [WhatsApp Cloud API rate limits](/academy/articles/whatsapp-cloud-api-rate-limits-throughput-pair-rate/). For the queue between the incoming webhook and the worker that sends, see [a queue between webhooks and your workers](/academy/articles/whatsapp-webhook-queue-architecture-workers/). Inline keyboards add answer and edit calls to the same bot, covered in [Telegram inline keyboards and callback queries](/academy/articles/telegram-bot-inline-keyboards-callback-queries/).

*Z-API Omni team*
