Prerequisites
- A Telegram bot created with BotFather
- A valid Bot Token
- A Secret Token to validate the webhook
Backend Configuration (API)
In your API environment, both production and staging, configure:NEXT_PUBLIC_SENDBOT_API_URLmust point to your public API so Studio can generate the webhook URL.- In a local environment, use a public URL such as
https://<your-ngrok>.ngrok.ioand make sure HTTPS is enabled.
Webhook Configuration in Telegram
In Telegram, configure the webhook using the Bot API:Studio Configuration
- Go to Share on the bot -> Telegram.
- Create the credentials:
- Bot Token
- Secret Token
- Copy the Webhook URL and the Secret Token.
- Configure the webhook in Telegram with the URL and secret token.
- Enable Enable Telegram integration and publish the bot.
Production Checklist
NEXT_PUBLIC_SENDBOT_API_URLconfigured in the backend- Webhook configured in Telegram with
secret_token - Credentials saved and integration enabled on the bot
Quick Troubleshooting
- Webhook 401: invalid or missing secret token
- No reply: make sure the webhook was registered correctly in Telegram