Telegram bots2 minutes to read

Can I use my own domain for a Telegram bot webhook?

Verify a custom hostname, switch the Telegram webhook to it and use two separate checks to confirm HTTPS routing and a real Bot API reply.

Which address should Telegram call?

Use the platform HTTPS address on a Telegram webhook deployment. You can also verify a hostname you control on eligible Spark and paid HTTP deployments. With the Bothosting starter, the webhook path is /telegram. The same bot username and private chats continue to work when the receiving hostname changes.

Keep your existing webhook running until the new hostname works. For example, suppose you own the zone for club.example and want the endpoint https://bot.club.example/telegram. You need control of DNS for that zone and an HTTP deployment serving that route.

Verify the hostname before changing bot delivery

  1. Add the hostname in Settings → HTTP domains. Copy the DNS-only CNAME target and ownership TXT record exactly as shown into your DNS provider.
  2. Choose Check DNS when the records are visible. After verification and certificate issuance, open /healthz over HTTPS on both the platform address and the new hostname. The two requests should reach the same starter.
  3. Save the full new URL as TELEGRAM_WEBHOOK_URL. Keep a separate TELEGRAM_WEBHOOK_SECRET configured and restart the deployment so the starter registers the new destination.

Use the domain verification guide if the DNS provider automatically appends your zone name.

Check what Telegram actually registered

Ask the Bot API for getWebhookInfo using your bot library. Compare the returned URL, including its path, with the new endpoint. If delivery is failing, check the pending update count and the most recent error time alongside its message. An old recorded error can still be present after delivery recovers.

Now send /start in an existing private chat. One reply from the expected username verifies receipt and the outgoing Bot API call. A browser visit to the webhook path uses GET, while Telegram delivers updates with POST. Use the starter’s health path for the browser test. Telegram’s webhook status fields.