Skip to main content
The Telegram adapter sends notifications via the Telegram Bot API. It supports HTML formatting, file/image/audio attachments, and interactive inline keyboards for approval gates.
This page covers outbound notifications (Polpo sending you alerts). To chat with Polpo via Telegram — send commands, approve tasks, have conversations — see Telegram Gateway.

Configuration

{
  "settings": {
    "notifications": {
      "channels": {
        "telegram-oncall": {
          "type": "telegram",
          "botToken": "${TELEGRAM_BOT_TOKEN}",
          "chatId": "-1001234567890"
        }
      }
    }
  }
}
FieldTypeRequiredDescription
type"telegram"YesChannel type
botTokenstringYesBot token from @BotFather
chatIdstringYesTarget chat, group, or channel ID
Both botToken and chatId support ${ENV_VAR} syntax.

Message Format

Messages are sent in HTML parse mode with a severity emoji prefix:
SeverityEmoji
infoℹ️
warning⚠️
critical🚨
Markdown in the notification body is converted to Telegram HTML: **bold** becomes <b>bold</b>, _italic_ becomes <i>italic</i>, `code` becomes <code>code</code>.

Interactive Approvals

When a notification is triggered by an approval:requested event, the Telegram message automatically includes an inline keyboard with Approve and Reject buttons.
  • Approve — immediately approves the task
  • Reject — asks the user for feedback via a ForceReply prompt. The next text message in the chat is captured as rejection feedback, and the task is sent back for rework with that feedback
This turns Telegram into a full approval interface — no need to open the web UI or CLI.
The interactive approval flow requires the TelegramCallbackPoller to be running, which Polpo starts automatically when Telegram channels are configured.

Attachments

When includeOutcomes: true is set on a notification rule, task outcomes are sent as follow-up messages:
MIME TypeTelegram Method
image/*sendPhoto (with caption)
audio/*sendAudio
Everything elsesendDocument
Text-only outcomesFormatted <pre> code blocks (truncated to 3800 chars)
If there’s a single image attachment, it’s sent as a photo with the notification text as the caption — this gives a clean, image-first layout in chat.

Connectivity Test

The test() method calls getMe on the Telegram Bot API — a real network call that validates the bot token is valid and the bot is reachable.

Setup

  1. Create a bot via @BotFather — save the bot token
  2. Get the chat ID — add the bot to a group, send a message, then call https://api.telegram.org/bot{token}/getUpdates to find the chat ID
  3. Add to Polpo config:
    {
      "type": "telegram",
      "botToken": "${TELEGRAM_BOT_TOKEN}",
      "chatId": "-1001234567890"
    }
    
  4. The bot must have permission to send messages in the target chat