Home · Blog · How to change a bot token in Telegram, MAX and VK without losing correspondence
How to change a bot token in Telegram, MAX and VK without losing correspondence
To change a bot token in CHBT, open Channels → “⋯” in the channel row → Change key, paste the new token into the New key (API token) field and press Save key. The channel, open conversations, contacts and flows stay in place; there is no need to delete and reconnect the channel. If the new key did not fit, CHBT returns the previous one and shows the reason — the channel will not break. Change key is available for Telegram, MAX and VK; the key can be changed by the project owner and admins. Below — where to get a new token, what to do on a leak and what to do if the bot went silent after the change.
Where to get a new token
| Messenger | Where to issue a new key |
|---|---|
| Telegram | @BotFather: /revoke revokes the old token and issues a new one; the current token is in /mybots → API Token |
| MAX | The MAX for business account, bot settings |
| VK | Community: Manage → API usage → Access keys, with the Community messages and Community management rights |
The new token must belong to the same bot or the same community. CHBT checks that the key works but does not compare whether it is the same bot. Paste another bot’s token — contacts stay in the channel, but they will be written to by a bot they never talked to, and messages will not be delivered.
A planned change: order without downtime
- Issue a new key in the platform account, do not revoke the old one yet (possible in MAX and VK).
- In CHBT: Channels → “⋯” → Change key → paste the new one → Save key.
- Wait for the Works status on the channel.
- Write to the bot from a phone: the reply should arrive, the message should appear in Conversations.
- Revoke the old key in the platform account and write to the bot once more.
In Telegram /revoke revokes the old token at once, so paste the new one into CHBT right after the command — until you do, the bot is silent.
What CHBT does on saving: sets up message receiving again with the new key — the Telegram webhook, the MAX event subscription or the VK Callback API.
A token leak: what to do now
- Get a new token — in Telegram with the
/revokecommand, in MAX and VK — a new key in the platform account. - Paste it into CHBT via Change key.
- Revoke the old key where it did not happen by itself: delete the old VK community key, update the token in the MAX account.
- Test the bot from a phone — the reply should appear in Conversations.
- Remove the token from the leak source — a chat, a document, code.
A contractor who needs access to the bot does not need the token: add them to the CHBT project with the right role — a role is removed with one button.
If the new key did not fit
The form shows “The new key did not fit: … Kept the previous one.” — CHBT returned the old key and restored its webhook.
| Reason in the message | What to do |
|---|---|
| The platform did not accept the key | Copy the key in full, without spaces at the edges |
| A key from another messenger | A Telegram token — only into a Telegram channel, MAX — into MAX |
| The VK key lacks the Community messages or Community management rights | Create the key again and tick both rights |
| Network or a platform failure | Try again in a couple of minutes |
If the old token is already revoked, the “previous” key does not work either — paste a working new one as soon as possible.
Change key or delete and reconnect
| Change key | Delete and connect again | |
|---|---|---|
| Channel | The same | A new one |
| Open conversations | Continue | Closed, correspondence read-only |
| Contacts, tags, deals | In place | In place |
| Answering in an old conversation | Possible | Not possible — the conversation continues when the customer writes again |
| Channel settings | Kept | Set up again |
Deleting a channel makes sense only if you move to another bot or another community.
If the bot went silent after the change
| Symptom | Cause | What to do |
|---|---|---|
| Status Error with text about the token, the owner got an email “Bot … needs attention” | The platform rejected the key | Repeat Change key with a valid token |
| Status Works, but Conversations are empty | The token is used in parallel in another service, which intercepted the webhook | Remove the token from there and press Reinstall webhook |
| Replies are marked “not delivered” | Sending fails | Hover over the mark — the tooltip has the platform’s error text |
| Customers write, the bot cannot answer them | Another bot’s token was pasted | Return the token of the bot customers wrote to |
The key problem email arrives no more than once a day if Email notifications or Bot status are not turned off. Detailed checklists: Telegram bot is silent, MAX bot does not answer, VK bot does not answer.
Website and email
The website chat has no messenger token: the widget is connected with code that CHBT issues, there is nothing to change in it. Email has app passwords for IMAP and SMTP instead of a token. If an email password leaked, create a new app password in the mail service settings, delete the old one and reconnect email in Channels with the new password.
Channel tokens are stored encrypted in CHBT and are not shown anywhere after connecting — neither to the owner nor to operators.
How to get a Telegram bot tokenHow to connect a MAX botHow to connect a VK botWhy does the Telegram bot not respond?