Telegram
Integrate Telegram with Enbbox for chat notifications. Send notifications to Telegram users and groups via Bot API.
Overview
Telegram is a messaging platform with a powerful Bot API. Enbbox uses Telegram Bots to send notifications directly to users or groups.
[!IMPORTANT] Telegram requires a Bot Token from BotFather and the recipient's Chat ID. Unlike webhook-based providers, you must create a Telegram bot and have users interact with it first.
Step 1: Create a Telegram Bot
- Open Telegram and search for @BotFather
- Start a conversation and send
/newbot - Choose a name for your bot (e.g., "My App Notifications")
- Choose a username for your bot (must end in
bot, e.g.,myapp_notify_bot) - BotFather will respond with your Bot Token — save it securely
Use this token to access the HTTP API:
7123456789:AAHxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[!CAUTION] Keep your Bot Token secret. Anyone with the token can control your bot.
Step 2: Get the Chat ID
The Chat ID identifies who receives the notification — a user, group, or channel.
For a User
- Have the user open your bot in Telegram and click Start
- Send any message to the bot
- Call the Telegram API to find the chat ID:
curl https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates- In the response, find
"chat": { "id": 123456789 }— this is the user's chat ID
For a Group
- Add your bot to the group
- Send a message in the group
- Call
getUpdatesas above — the group chat ID will be a negative number (e.g.,-987654321)
For a Channel
- Add your bot as an administrator to the channel
- The chat ID is
@channel_usernameor usegetUpdatesafter posting
Step 3: Connect to Enbbox
- Navigate to Integrations in the Enbbox dashboard
- Click Add Provider → select Chat → Telegram
- Enter your Bot Token from Step 1
- Click Test Connection to verify the token is valid
- Activate the integration
Step 4: Configure Subscriber Credentials
Store each subscriber's Telegram chat ID in their credentials:
import { SubscriberCredentialsApi, Configuration } from "@enbbox/api";
const config = new Configuration({ accessToken: "your-api-key" });
const credentialsApi = new SubscriberCredentialsApi(config);
await credentialsApi.setCredentials("subscriber-123", "telegram", {
credentials: { chat_id: "123456789" },
});[!NOTE] The
chat_idis a numeric string. For groups it's negative (e.g.,"-987654321").
Step 5: Send a Test Notification
Create a workflow with a Chat step, then trigger it:
import { EventsApi, Configuration } from "@enbbox/api";
const config = new Configuration({ accessToken: "your-api-key" });
const eventsApi = new EventsApi(config);
await eventsApi.triggerEvent({
name: "welcome-message",
to: { subscriberId: "subscriber-123" },
payload: { message: "Hello from Enbbox! 🎉" },
});Troubleshooting
| Issue | Solution |
|---|---|
| Bot token invalid | Regenerate via /token command in BotFather |
| Chat not found | Ensure the user has clicked "Start" on your bot |
| Group messages not received | Disable "Privacy Mode" via /setprivacy in BotFather |
| Rate limited | Telegram limits bots to ~30 msg/sec. Use the Enbbox queue for throttling |