---
title: Telegram
description: Send messages, photos and documents to a Telegram chat via the Bot API.
---

Send a message, a photo or a file to a Telegram chat through your own bot, a simple way to get alerts on your phone.

Pick a saved connection in the **Credential** field, or create one from there. It signs in with a Bearer Token.

## What it does

The node sends one thing to one chat each time it runs, using a Telegram bot you create:

* **Send message**: a text message.
* **Send photo**: an image, with an optional **Caption**.
* **Send document**: any file, with an optional **Caption**.

**Photo** and **Document** accept a web address, a Telegram file id, or a base64 `data:` URL. A data URL, such as the `dataUrl` from [Screenshot Page](/nodes/extension/screenshotpage/), is uploaded as a file, so you can send a picture of the page you are on.

The node only sends. It cannot read the messages people send to your bot.

## When to use it

* Get a phone alert when a page you watch changes, with a screenshot of it.
* Receive a daily digest or an AI summary in a private chat.
* Post updates to a group or channel your bot belongs to.
* Send yourself a file a workflow produced, such as a PDF found on a page.

For Slack or Discord channels, use [Slack](/nodes/builtin/integration/slack/) or [Discord](/nodes/builtin/integration/discord/). For a notification with no bot to set up, see [Push Notification](/nodes/builtin/integration/push-notification/).

## Inputs and settings

Call the Telegram API yourself with the HTTP Request node, and pick the same connection in its **Credential** field.

* **Chat ID** is a number for a person or group (groups start with `-`, like `-1001234567890`), or `@channelname` for a public channel. To find your own chat id, send any message to your bot, then open `https://api.telegram.org/bot<your token>/getUpdates` in the browser and look for `"chat":{"id":…}`.
* **Formatting** decides how `*bold*`, `_italic_` or `<b>tags</b>` in **Text** or **Caption** are shown. Leave it on `None` for plain text. With `MarkdownV2`, characters like `.`, `-` and `!` must be escaped with `\`, so `HTML` is often easier.

## Outputs

The output is the message Telegram created: its `message_id`, the `chat` it went to, the `date`, and the `text` or the `photo` / `document` details. Keep `message_id` if a later step needs to refer to the message.

## Dependencies and credentials

* **Credential** (connection, Bearer Token): required. See [Connect Telegram](/app/connections/telegram/).

The credential is your bot's token, saved as a Bearer Token credential:

1. In Telegram, open a chat with **@BotFather** and send `/newbot`.
2. Choose a name and a username. BotFather replies with a token like `123456789:ABCdefGhIJKlmNoPQRstuVWxyz`.
3. Paste the token into a new credential. See [Create a credential](/app/connections/create/).
4. Open a chat with your new bot and press **Start**, or add it to the group or channel you want to post in. A bot cannot message someone who never started it.

Anyone with the token controls the bot, so keep it private. If it leaks, send `/revoke` to @BotFather and update the credential.

## Example workflow

1. An [Element Change](/nodes/builtin/trigger/elementchange/) trigger watches **CSS Selectors** `.stock-status` on a product page.
2. [Screenshot Page](/nodes/extension/screenshotpage/) captures the visible page.
3. Telegram, **Send photo**, **Chat ID** `123456789`, **Photo** `{{ $input.dataUrl }}`, **Caption** `<b>Stock changed</b> on {{ $('Element Change').url }}`, **Formatting** `HTML`.

## Common issues

* **"Telegram API Error: Unauthorized".** The token is wrong or was revoked. Get the current token from @BotFather and update the credential.
* **"Telegram API Error: Bad Request: chat not found".** The **Chat ID** is wrong, or the bot was never started in that chat or added to that group. Press **Start** in the bot's chat, or add the bot, then try again.
* **"Telegram API Error: Bad Request: can't parse entities…".** The text does not follow the chosen **Formatting**. Fix the markup, escape special characters, or set **Formatting** to `None`.
* **"Telegram API Error: Forbidden: bot was blocked by the user".** The person blocked the bot. They need to unblock it and press **Start** again.
* **"Only base64 data URLs are supported".** The **Photo** or **Document** value starts with `data:` but is not base64. Use the `dataUrl` from Screenshot Page as it is, or a web address.

## Related nodes

* [Screenshot Page](/nodes/extension/screenshotpage/): a picture of the page to send.
* [Push Notification](/nodes/builtin/integration/push-notification/): phone notifications through ntfy or Pushover.
* [Slack](/nodes/builtin/integration/slack/) and [Discord](/nodes/builtin/integration/discord/): other chat apps.
* [Digest](/nodes/builtin/core/digest/): bundle several changes into one message.