Telegram Setup
Connect Telegram to Edictum for interactive approval buttons -- Approve/Deny directly in Telegram.
Right page if: you are connecting Telegram to Edictum Console for interactive approve/deny buttons. Wrong page if: you want Slack or Discord buttons instead -- see https://docs.edictum.ai/docs/console/notifications/slack or https://docs.edictum.ai/docs/console/notifications/discord. Gotcha: group chat IDs are negative numbers (e.g. -1001234567890). EDICTUM_BASE_URL must be a public HTTPS URL or button callbacks will silently fail.
Connect Telegram to Edictum for interactive approval buttons -- Approve/Deny directly in Telegram.
1. Create a Bot
- Open Telegram and message @BotFather
- Send
/newbot - Choose a name and username for your bot
- BotFather gives you a bot token (e.g.
7123456789:AAH...) -- copy it, you'll need it next
2. Get Your Chat ID
- Send any message to your new bot in Telegram
- Open this URL in your browser (replace
{token}with your bot token):https://api.telegram.org/bot{token}/getUpdates - Find the
chat.idin the JSON response:{ "result": [{ "message": { "chat": { "id": 123456789 } } }] } - Copy the
chat.idnumber -- this is your chat_id
Tip: For group chats, add the bot to the group first, then send a message in the group. The chat ID for groups is negative (e.g. -1001234567890).
3. Add the Channel in Edictum
- Dashboard > Settings > Notifications > Add Channel > Telegram
- Fill in:
- Bot Token: the token from step 1
- Chat ID: the chat ID from step 2
- Click Test -- a test message should appear in your Telegram chat
- Save
4. Webhook Registration
The console automatically registers a webhook with Telegram when you save the channel. This is how Telegram sends button clicks back to the console.
Requirement: EDICTUM_BASE_URL must be set to a public HTTPS URL for interactive buttons to work. The console must be reachable from Telegram's servers.
What Happens
When an agent requests approval:
- A message appears in your Telegram chat with the approval details (agent, tool, arguments, environment)
- Two inline keyboard buttons: Approve and Deny
- Click a button -- the decision is submitted to Edictum instantly
- The message updates to show the result (who decided, when, via which channel)
- The agent receives the decision and proceeds (or stops)
If someone decides via the dashboard or another channel instead, the Telegram message updates too -- no stale buttons.
Troubleshooting
| Problem | Fix |
|---|---|
| Test message not appearing | Verify the bot token and chat_id are correct. Make sure you messaged the bot first (bots can't initiate conversations). |
chat not found error | The chat_id is wrong, or the bot was removed from the group. Re-add the bot and get a fresh chat_id. |
| Buttons don't work | EDICTUM_BASE_URL must be a public HTTPS URL. Localhost won't receive Telegram callbacks. |
| Bot token stopped working | You may have regenerated it in BotFather. Copy the new token and update it in Edictum. |
| Messages to group chat fail | Add the bot to the group, then send a message in the group to get the correct (negative) chat_id. |
Security
Treat the bot token like a password. If you accidentally share it:
- Message @BotFather >
/revoke> select your bot - Copy the new token
- Update it in Edictum dashboard
The bot token is encrypted at rest in the console database. It's masked in API responses.
Next Steps
- Notification Overview -- routing filters and channel management
- Slack App Setup -- add Slack as another channel
- Discord Bot Setup -- add Discord as another channel
Last updated on