Skip to content

PopSQL: limited support.

Migrate now →

Telegram

Wiring up Telegram: what to create at the provider, what to paste here, what goes in Target, and how to test before depending on it.

What it is

Bot API. The bot must already be in the chat, and the chat id goes on the route or on the contact — not here.

Set up

About 5 minutes to a working channel.

  1. 01Create the bot with @BotFather. Open Telegram, talk to @BotFather, send /newbot, choose a display name and a username ending in “bot”. He answers with a token shaped like 123456789:AAE… .
  2. 02Paste the token, then Test. Test calls getMe: it proves the token is valid. It does not send a message, because the destination chat lives on the route.
  3. 03Put the bot where you want the report. Direct chat: send it any message. Group: add it as a member, then send a message. Channel: add it as an administrator.
  4. 04Read the chat_id. Use the Chat ids button on this channel: it lists every chat that has messaged the bot, with the id to copy. (The same data is at https://api.telegram.org/bot<TOKEN>/getUpdates, but that puts your bot token in a browser URL.) Groups come back negative — copy the minus sign too.
  5. 05Put the chat_id on the route. Report → Destinations → Channel, and paste the chat_id into Target. An empty Target fails with “Telegram route Target is empty (need chat_id)”.

Fields

FieldRequiredWhat it is
Bot tokenYesWhat @BotFather answered to /newbot. The chat id does not go here — it goes on the route. (123456789:AAE…)

What goes in Target

The numeric chat_id. A person: a positive number, and they must have messaged the bot first — a bot cannot open a conversation. A group or supergroup: negative, usually starting with -100, and the bot has to be a member. A PUBLIC channel or supergroup is the one case where @name works; a person’s @name never does.

Target is required for this channel: a route without one never leaves. — chat_id, e.g. -1001234567890

Test

Every channel has a Test button in the channel list (Settings → Channels). The result is kept — date, status and the provider's error when there was one — and a channel that was never tested is marked in the list.

Test calls getMe with the token: it proves the bot exists. It does not prove the chat id — if the bot is not in the group, or nobody has messaged it, the first real delivery fails with "chat not found".

Check it end to end

  1. 01Report: open a report, add this channel under Destinations (with the Target when the channel needs one), click Run now and open the run. The log says which channel each recipient went through and what the provider answered.
  2. 02Alert: under Monitoring → Alert routes, create a route with this channel as an escalation step. Routes match on severity and source; the first match wins.
  3. 03To fire an alert without breaking anything: create an HTTP monitor pointing at a URL that returns an error (for example https://httpstat.us/500) with a short interval. When it goes down the alert leaves through the route; delete the monitor afterwards. The message carries an acknowledge link — click it and the escalation stops.
  4. 04Report rules (new rows, value out of range) arrive through the same route, with source "report rule".

What most often goes wrong

A person’s @username is not addressable by a bot at all — “@someone” always comes back as “chat not found”. Use the numeric id, and remember the bot cannot see messages sent before it joined: send one afterwards or there is no chat id to read.