> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vibeflow.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Telegram

> Send messages, media, polls, and manage chats via the Telegram Bot API

Telegram Bot API integration for sending messages, photos, documents, polls, locations, managing chats, and receiving updates.

**Required Configuration:**

* Bot token authentication

## Setup

<Steps>
  <Step title="Create a Telegram Bot">
    Open Telegram and start a chat with [@BotFather](https://t.me/BotFather). Send `/newbot` and follow the prompts to choose a name and username for your bot.

    BotFather will return a bot token that looks like `123456789:ABCdefGhIJKlmNoPQRstuVWXyz`.
  </Step>

  <Step title="Add Bot Token to VibeFlow">
    In VibeFlow, navigate to **Settings** > **Connectors**, select **Telegram**, and paste your bot token into the connector modal.

    Your bot token is encrypted by default and stored securely.
  </Step>
</Steps>

## Finding a Chat ID

Most Telegram endpoints require a `chat_id` to identify which chat to send to. Chat IDs are not visible in the Telegram UI, so you'll need a helper bot to look them up.

<Steps>
  <Step title="For your personal chat ID">
    Open Telegram and start a chat with [@userinfobot](https://t.me/userinfobot). Send any message and it will reply with your numeric user ID — this is the `chat_id` to use when your bot messages you directly.
  </Step>

  <Step title="For a group or channel chat ID">
    Add [@RawDataBot](https://t.me/RawDataBot) (or [@getmyid\_bot](https://t.me/getmyid_bot)) to the group or channel. It will post a message containing the chat's `id` field — that's the `chat_id`. Group chat IDs are negative numbers (e.g. `-1001234567890`); user IDs are positive.

    You can remove the helper bot once you have the ID.
  </Step>

  <Step title="For a chat with your own bot">
    Have the user send a message to your bot first, then call `POST /api/actions/telegram/get-updates` — the response includes `chat.id` for each incoming message.
  </Step>
</Steps>

<Tip>
  Bots can only message users who have started a conversation with them first (by sending `/start` or any message). For groups, the bot must be added as a member.
</Tip>

## Available Endpoints

<AccordionGroup>
  <Accordion title="POST /api/actions/telegram/send-message">
    Send a text message to a chat.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/edit-message">
    Edit a previously sent message.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/delete-message">
    Delete a message.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/forward-message">
    Forward a message from one chat to another.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/send-photo">
    Send a photo to a chat.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/send-document">
    Send a document to a chat.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/send-location">
    Send a location to a chat.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/send-poll">
    Send a poll to a chat.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/get-chat-info">
    Get information about a chat.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/get-chat-administrators">
    Get the list of administrators in a chat.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/get-chat-member">
    Get information about a specific member of a chat.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/get-chat-members-count">
    Get the number of members in a chat.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/get-bot-info">
    Get information about the bot.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/get-updates">
    Receive incoming updates using long polling.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/answer-callback-query">
    Send a response to a callback query from an inline keyboard button.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/export-chat-invite-link">
    Generate a new invite link for a chat.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/set-webhook">
    Set a webhook URL to receive incoming updates.
  </Accordion>

  <Accordion title="POST /api/actions/telegram/get-messages">
    Retrieve incoming messages.
  </Accordion>
</AccordionGroup>
