Is it possible to share webhook URL between multiple Telegram bots

I’m running into an issue with my Telegram bot setup. I currently have one bot that’s working perfectly with its webhook endpoint. Now I want to add a second bot to my project, and I was hoping to point both bots to the exact same webhook URL to keep things simple.

However, when I try to configure the second bot with the same endpoint, it doesn’t seem to receive the updates properly. The first bot still works fine, but the new one just stays silent.

Has anyone successfully configured multiple Telegram bots to use a single shared webhook endpoint? Am I missing something in the configuration, or is this approach fundamentally flawed? Any guidance would be really helpful since I’m trying to avoid setting up separate endpoints for each bot.

totally understand the struggle! yeah, using the bot token in the webhook path can work, but ur right, it gets really messy. best to stick with separate endpoints – keeps everything cleaner and reduces those annoying bugs. good luck with your setup!

Yeah, you can share webhook URLs between multiple Telegram bots, but you’ll need something to route the requests properly.

Telegram sends updates to your webhook, but each bot’s updates have different tokens in the URL or headers. Your endpoint needs to figure out which bot the update belongs to and route it there.

I’ve done this multiple times. Build a dispatcher that parses the webhook data and figures out which bot handles each update. Check the bot username in the payload or use different URL paths for each bot with the same base endpoint.

But honestly? Skip the custom routing headache and automate it. Set up a workflow that receives webhooks from multiple bots and routes them to the right handlers automatically. No dispatcher code needed.

This scales better than separate endpoints for each bot. Plus you get error handling and logging built in.

Yeah, totally doable but you’ll need to handle the routing on your server. Telegram can’t tell your bots apart when they’re sharing the same webhook URL. I’ve had success checking the webhook payload to figure out which bot should handle each request. The update data usually has the bot username or other identifiers you can use for routing. Easiest way I’ve found is turning your webhook handler into a router. When an update comes in, check the payload first to see which bot it’s for, then pass it to the right bot logic. You keep one endpoint but each bot only gets its own updates. Your second bot going silent probably means your first bot’s handler is grabbing everything instead of routing properly. Double-check that your routing covers all update types, not just regular messages.