[GH-ISSUE #1221] Feature Request: configurable Telegram API URL environment variable #825

Closed
opened 2026-02-25 23:43:42 +03:00 by kerem · 5 comments
Owner

Originally created by @arsalanses on GitHub (Oct 22, 2025).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/1221

Add support for custom Telegram API URL via environment variable.

Proposed change:

TELEGRAM_API_URL = os.getenv("TELEGRAM_API_URL", "https://api.telegram.org")
SM = f"{settings.TELEGRAM_API_URL}/bot{settings.TELEGRAM_TOKEN}/sendMessage"

Thank you

Originally created by @arsalanses on GitHub (Oct 22, 2025). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/1221 Add support for custom Telegram API URL via environment variable. Proposed change: ``` TELEGRAM_API_URL = os.getenv("TELEGRAM_API_URL", "https://api.telegram.org") SM = f"{settings.TELEGRAM_API_URL}/bot{settings.TELEGRAM_TOKEN}/sendMessage" ``` Thank you
kerem closed this issue 2026-02-25 23:43:42 +03:00
Author
Owner

@cuu508 commented on GitHub (Oct 27, 2025):

Thanks for the suggestion. What is the use case for this?

<!-- gh-comment-id:3450892716 --> @cuu508 commented on GitHub (Oct 27, 2025): Thanks for the suggestion. What is the use case for this?
Author
Owner

@arsalanses commented on GitHub (Oct 27, 2025):

This could be particularly useful in scenarios where Telegram is banned or restricted by certain providers, as it would allow users to bypass such restrictions by specifying an alternative API endpoint.

<!-- gh-comment-id:3450909038 --> @arsalanses commented on GitHub (Oct 27, 2025): This could be particularly useful in scenarios where Telegram is banned or restricted by certain providers, as it would allow users to bypass such restrictions by specifying an alternative API endpoint.
Author
Owner

@cuu508 commented on GitHub (Oct 27, 2025):

I see. There could be an analogous situation with other integrations too – Slack, Discord, Google Chat, MS Teams etc. So I would rather not add something Telegram-specific. Wouldn't a better solution be a VPN that proxies all traffic, not just requests to Telegram?

<!-- gh-comment-id:3450936116 --> @cuu508 commented on GitHub (Oct 27, 2025): I see. There could be an analogous situation with other integrations too – Slack, Discord, Google Chat, MS Teams etc. So I would rather not add something Telegram-specific. Wouldn't a better solution be a VPN that proxies all traffic, not just requests to Telegram?
Author
Owner

@arsalanses commented on GitHub (Oct 28, 2025):

A VPN is overkill, it adds latency, complexity, and affects all traffic unnecessary when only Telegram’s API endpoint needs overriding (common in restricted networks or with local mirrors).
Projects like Gatus and Alertmanager already support TELEGRAM_API_URL. A simple, optional env var keeps things lightweight and consistent.

P.S. By the way, integrating Alertmanager would be a great idea too!
@cuu508

<!-- gh-comment-id:3455700609 --> @arsalanses commented on GitHub (Oct 28, 2025): A VPN is overkill, it adds latency, complexity, and affects all traffic unnecessary when only Telegram’s API endpoint needs overriding (common in restricted networks or with local mirrors). Projects like Gatus and Alertmanager already support TELEGRAM_API_URL. A simple, optional env var keeps things lightweight and consistent. P.S. By the way, integrating Alertmanager would be a great idea too! @cuu508
Author
Owner

@cuu508 commented on GitHub (Jan 7, 2026):

I'm not planning to add TELEGRAM_API_URL. I want to avoid the sprawl of environment variables, especially if we over time start adding similar settings for other integrations as well.

The easiest workaround would be to use the webhook integration.

<!-- gh-comment-id:3719084276 --> @cuu508 commented on GitHub (Jan 7, 2026): I'm not planning to add TELEGRAM_API_URL. I want to avoid the sprawl of environment variables, especially if we over time start adding similar settings for other integrations as well. The easiest workaround would be to use the webhook integration.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#825
No description provided.