---
service: "Publicasta"
schema_version: "1.0"
article_id: 226
title: "How to connect an existing Telegram bot to RouteHook in 3 minutes"
language: "en"
default_language: "ru"
canonical_url: "https://publicasta.com/routehook/connect_existing_telegram_bot_routehook?lang=en"
json_url: "https://publicasta.com/routehook/connect_existing_telegram_bot_routehook.json?lang=en"
api_url: "https://publicasta.com/api/public/v1/channels/routehook/articles/connect_existing_telegram_bot_routehook?lang=en"
channel_url: "https://publicasta.com/api/public/v1/channels/routehook"
channel_articles: "https://publicasta.com/api/public/v1/channels/routehook/articles"
search_url: "https://publicasta.com/api/public/v1/search"
documentation_url: "https://publicasta.com/api-docs#reading-publicasta"
openapi_url: "https://publicasta.com/api-docs/openapi.json"
published_at: "2026-08-18T09:01:59+00:00"
updated_at: "2026-08-18T09:01:59+00:00"
translations:
  - language: "en"
    html_url: "https://publicasta.com/routehook/connect_existing_telegram_bot_routehook?lang=en"
    markdown_url: "https://publicasta.com/routehook/connect_existing_telegram_bot_routehook.md?lang=en"
    json_url: "https://publicasta.com/routehook/connect_existing_telegram_bot_routehook.json?lang=en"
  - language: "ru"
    html_url: "https://publicasta.com/routehook/connect_existing_telegram_bot_routehook?lang=ru"
    markdown_url: "https://publicasta.com/routehook/connect_existing_telegram_bot_routehook.md?lang=ru"
    json_url: "https://publicasta.com/routehook/connect_existing_telegram_bot_routehook.json?lang=ru"
---

# How to connect an existing Telegram bot to RouteHook in 3 minutes

> A short practical flow: buy a relay, send the bot token, keep the current webhook, and replace the Bot API base URL in your code.

![RouteHook setup diagram with three steps: buy relay, keep webhook, replace Bot API URL](https://publicasta.com/storage/projects/26/pages/226/2026/07/6177b17e-5b9a-4b7f-822f-5d9e4718683b.webp)

 If your Telegram bot already works, the easiest RouteHook setup is to avoid moving the project and avoid rewriting the webhook. In most cases, you keep the current webhook and replace the Bot API base URL for outgoing requests.

 Start the setup in Telegram: [@RouteHookBot](https://t.me/RouteHookBot).

 ## What you need

 - the bot token of your Telegram bot;
- a working HTTPS webhook, if the bot receives incoming updates;
- the place in your code where the Bot API base URL is defined.

 RouteHook needs the bot token to configure the relay. It is not shown back in the interface.

 ## Step 1. Buy a relay

 Open [@RouteHookBot](https://t.me/RouteHookBot) and tap `Купить relay`.

 One payment connects one relay for one Telegram bot. After payment, the bot will offer to add your Telegram bot.

 ## Step 2. Send the bot token

 Tap `Добавить бота` and send the token in this format:

 ```text
123456789:AA...
```

 RouteHook checks the token with Telegram `getMe` and reads the current webhook with `getWebhookInfo`.

 ## Step 3. Keep the current webhook

 If a webhook already exists, choose `Оставить текущий webhook`.

 Your server will continue receiving normal Telegram updates. RouteHook simply becomes the relay layer between Telegram and your webhook.

 Enter a new webhook URL only when you intentionally want to change the downstream webhook and the new URL already accepts Telegram updates.

 ## Step 4. Replace the Bot API URL in code

 After setup, RouteHook gives you:

 ```text
API base URL: https://routehook.ipcfg.com/<public_id>
```

 In PHP, it usually looks like this.

 Before:

 ```php
$apiUrl = 'https://api.telegram.org/bot' . $botToken . '/';
```

 After:

 ```php
$apiUrl = 'https://routehook.ipcfg.com/<public_id>/bot' . $botToken . '/';
```

 The rest of the code can stay as it is. If you already have calls like:

 ```php
file_get_contents($apiUrl . 'sendMessage?' . http_build_query($params));
```

 they will continue working through the relay.

 ## If you do not need a webhook

 For bots that only send messages and do not receive incoming updates, choose `API-only, webhook не нужен`.

 In this mode, RouteHook does not set a Telegram webhook and only gives you the `API base URL` for outgoing Bot API requests.

 ## How to check

 After setup, open `Мой доступ`, choose the bot, and tap `Проверить`.

 You can also run:

 ```text
/checkbot <public_id>
```

 The check shows the current Telegram webhook, pending updates, and the latest delivery error if there is one.

 The short version: keep the webhook, replace the Bot API URL, and verify the setup with `/checkbot`.

 Connect your bot here: [@RouteHookBot](https://t.me/RouteHookBot).
