Keys / Telegram

TELEGRAM_BOT_TOKEN

The token your app uses to control a Telegram bot through the Bot API. @BotFather gives you one when you create a bot with /newbot.

Expires
the docs don't say
API
replace only, for managed bots; others use @BotFather

Get it

Create one on t.me/botfather. The steps aren't recorded yet.

Set it

TELEGRAM_BOT_TOKEN=...

The Bot API libraries Telegram lists are community projects it doesn't maintain, so your app reads the variable and passes the token in. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Send /token to @BotFather to generate a new token for the bot.
  2. Deploy it everywhere the bot runs right away. The docs don't say whether the old token keeps working.
  3. For a managed bot, the manager bot can call replaceManagedBotToken instead. It revokes the current token and returns a new one.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16