Telegram Bot API

Set up a Telegram bot and get an API token for sending messages, managing groups, and building bot interactions.

⏱ 5 minutes messaging bots core.telegram.org/bots/api
getapi telegram

Prerequisites

  • A Telegram account

Credentials

Variable Description Sensitive
TELEGRAM_BOT_TOKEN Bot token for authenticating requests to the Telegram Bot API Secret

Setup Steps

  1. 1 Info

    We'll get you a Telegram bot token via BotFather, the official tool for creating and managing Telegram bots.

  2. 2 Open URL

    Opening BotFather in Telegram. This is the official bot for creating and managing Telegram bots.

    https://t.me/BotFather
  3. 3 Choice

    Do you already have a bot you want to use?

  4. 4 Info

    Send /newbot to BotFather. It will ask you for a display name (can be anything) and then a username (must end in 'bot', e.g. 'my_cool_bot'). Once done, BotFather will reply with your bot token.

  5. 5 Confirm

    Bot created?

    Checkpoint — confirm before continuing
  6. 6 Info

    Send /mybots to BotFather, select your bot, then tap 'API Token' to view the token.

  7. 7 Input

    Paste your bot token here (looks like 123456789:ABCdefGhI...):

    → TELEGRAM_BOT_TOKEN
    At least 8 characters
  8. 8 Validate

    Checking your bot token works...

    Bot token verified. Your bot is ready to use.
    Couldn't verify the token. Make sure you copied it correctly and the bot hasn't been deleted.

Things to Know

  • Bot tokens don't expire, but can be revoked by sending /revoke to BotFather.
  • Bots can't message users first. A user must send /start to your bot before it can reply to them.
  • Bot usernames must end in 'bot' (e.g. 'my_cool_bot' or 'MyCoolBot').
  • The API rate limit is roughly 30 messages per second globally and 1 message per second per individual chat.
  • For webhooks, you need a publicly accessible HTTPS URL. Self-signed certificates are supported.