# Allow configuring the Telegram Bot API base URL

**URL:** https://meta.discourse.org/t/allow-configuring-the-telegram-bot-api-base-url/408154
**Category:** Feature
**Tags:** chat-integration
**Created:** [July 21, 2026, 2:01pm UTC](https://meta.discourse.org/t/allow-configuring-the-telegram-bot-api-base-url/408154 "2026-07-21T14:01:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Oniel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/oniel/32/365830_2.png) [@Oniel](https://meta.discourse.org/u/Oniel)
#### Post date: [July 21, 2026, 2:01pm UTC](https://meta.discourse.org/t/allow-configuring-the-telegram-bot-api-base-url/408154/1 "2026-07-21T14:01:33Z")

</div>

The Telegram provider in the Discourse Chat Integration plugin currently sends all requests directly to `https://api.telegram.org`.

In some countries and hosting environments, Telegram is blocked or unavailable at the network level. This prevents the integration from working, including the initial webhook setup.

I propose adding a site setting that allows administrators to replace the Telegram Bot API base URL with the address of a trusted HTTPS proxy. For example, requests could be routed through a small Cloudflare Worker while keeping the existing Telegram integration unchanged.

The default value would remain `https://api.telegram.org`, so this would not affect existing installations.

My PR:

> <https://github.com/discourse/discourse/pull/41818>
>
> \## What changed
> 
> Adds \`chat\_integration\_telegram\_api\_base\_url\` setting for the… Telegram chat integration (discourse-chat-integration plugin)
> 
> The setting defaults to \`https://api.telegram.org\`, so existing installations keep their current behavior.
> 
> \## Why
> 
> Some Discourse installations cannot reach \`api.telegram.org\` directly because Telegram is blocked or restricted by local network providers.
> 
> This setting allows administrators to route Telegram Bot API requests through a trusted reverse proxy, such as a Cloudflare Worker, without patching the plugin.
> 
> \## Cloudflare Worker example
> 
> The following Worker can be deployed as a small Telegram Bot API proxy:
> 
> \`\`\`js
> export default {
> async fetch(request) {
> const url = new URL(request.url);
> 
> if (
> !url.pathname.startsWith("/bot") &&
> !url.pathname.startsWith("/file/bot")
> ) {
> return new Response("Not found", { status: 404 });
> }
> 
> url.hostname = "api.telegram.org";
> url.protocol = "https:";
> url.port = "";
> 
> return fetch(new Request(url, request));
> },
> };
> \`\`\`
> 
> The proxy must be trusted because Telegram bot tokens are included in Bot API request paths.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [July 22, 2026, 3:28pm UTC](https://meta.discourse.org/t/allow-configuring-the-telegram-bot-api-base-url/408154/4 "2026-07-22T15:28:11Z")

</div>

Thanks @Oniel 👍 I did a post “cleanup” and merged :git_merged: the PR.
