Telegram
Send alerts directly to your Telegram chat or group.
Prerequisites
- A Telegram account
- A Talarius account with a project created
Create a Telegram Bot
Open Telegram and search for @BotFather. Start a chat and send:
/newbotFollow the prompts to:
- Give your bot a name (e.g., "My App Alerts")
- Give your bot a username (e.g., "myapp_alerts_bot")
BotFather will give you a bot token that looks like:
1234567890:ABCdefGHIjklMNOpqrsTUVwxyzSave this token - you'll need it in step 3.
Get Your Chat ID
You need the chat ID where alerts will be sent. This can be a private chat with the bot or a group.
For private chat:
- Start a chat with your new bot
- Send any message to the bot
- Open this URL in your browser (replace YOUR_BOT_TOKEN):
https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdatesLook for "chat":{"id":123456789} in the response.
For group chat:
- Add your bot to the group
- Send a message in the group
- Use the same getUpdates URL above
- Group chat IDs are negative numbers (e.g., -123456789)
Configure in Talarius
In your Talarius dashboard:
- Go to your project settings
- Select Telegram as destination type
- Enter your Bot Token
- Enter your Chat ID
- Click Test Connection
- Save the configuration
Send a Test Alert
Test your integration with a quick curl command:
curl -X POST https://v1.talarius.io/alerts \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Test Alert", "body": "Telegram integration is working!"}'How alerts appear
Alerts are formatted as Telegram messages with clear structure:
My App Alerts
Server Alert
CPU usage exceeded 90% on production-web-1
Priority: high
Troubleshooting
Bot not responding?
Make sure you've started a conversation with the bot first. Bots can't initiate conversations.
Getting "chat not found" errors?
Double-check your chat ID. Remember that group IDs are negative numbers.
Alerts not appearing in group?
Ensure your bot has permission to send messages in the group. Some groups require admin approval.