Telegram
How to add Telegram to your system
These are your credentials with the platform, not Postiz credentials.
The keys on this page belong to a developer app you register with the platform. Nobody from Postiz will ever ask for them.
Keep them in your environment or a secret manager, never in a committed .env
file, and rotate them at the platform if they leak.
Postiz talks to Telegram using long-polling (getUpdates). Telegram allows only one connected process per bot token at a time. If you run Postiz against the same TELEGRAM_TOKEN from two places (e.g. self-hosted plus cloud, or two self-hosted instances), each instance will continuously kick the other off and you'll see 409 Conflict: terminated by other getUpdates errors in the logs.
Use one bot token per Postiz deployment. If you need Telegram on multiple environments, create a separate bot for each.
Create a Telegram Bot
- Open Telegram and message @BotFather.
- Click Start
- Click Menu
- Click "Create a new bot"
- Enter a name for your bot (e.g.,
MyPostizBot).
- Choose a unique username ending with "bot" (e.g.,
MyPostizBot_bot).
Once your bot is created, BotFather will give you an API Token. Keep it safe: you will need it later.
Configure Bot Group Permissions (optional but recommended)
- Click on "Menu"
- Click on "Edit your bots"
- Select your bot
- Click on "Bot Settings"
- Click on "Group Privacy"
- If "Privacy mode" is enabled, turn it off (it is enabled by default)
Add Your Bot to Telegram Groups or Channels
- Navigate to your group/channel
- Add your bot to your group/channel
- The bot requires these permissions to work with Postiz:
- access to messages, so the bot can read messages sent in the group/channel
- Send Text Messages: so the bot can send messages
- Send Media: so the bot can send media
While not strictly required, making your bot an admin is recommended. It will give the bot all the permissions needed and make the setup easier and faster.
Add Bot Token to Your Application
In your .env file, add the Telegram Bot Name (Without the @) and the Telegram Bot API Token that you received from BotFather in Step 1:
TELEGRAM_BOT_NAME="MyPostizBot_bot"
TELEGRAM_TOKEN="MyPostizBot token"You should be able to connect your group/channel to Postiz now!