Home · Help · How to get a Telegram bot token
How to get a Telegram bot token
The token is issued by @BotFather: right after you create a bot with the /newbot command, and later at any time via /mybots. It’s a single string of digits, a colon, and a secret part — CHBT uses it to verify the bot and sets the webhook itself. Below: where to find the token, how to avoid breaking it when copying, where to paste it in the dashboard, what the errors mean, and how to replace the token if it leaks.
New bot token: /newbot in @BotFather
@BotFather is Telegram’s own service bot for creating and configuring all bots. Search for it by its exact name: the real one has a blue check mark.
- Send
/newbot. - Set the name customers will see at the top of the chat, then a username — in Latin letters and ending in
bot. - BotFather will reply with a congratulations message and a link to the bot, and below it, after the phrase “Use this token to access the HTTP API:”, it will send a string — that’s the token.
You don’t need to save the token in your notes: as long as the bot exists, BotFather will show it again. How to choose a name and username and set an avatar and description is covered in the article how to create a Telegram bot.
Already have a bot: where to find the token
/mybots→ select the bot → the “API Token” button. BotFather will send the current token. Next to it is the “Revoke current token” button — it doesn’t show the token; it issues a new one and disables the old one, so don’t press it without a reason./token→ select the bot — the same token with fewer steps.
The token is visible only in the Telegram account that owns the bot. If a contractor or a former employee created the bot from their own phone, only they can get the token. You can’t view the token in the CHBT dashboard either: after connection, CHBT stores it encrypted and never displays it in the interface. If you need the token for another service, get it from BotFather.
What a token looks like
It's a single string with no spaces: digits, a colon, and a long part made of Latin letters, digits, hyphens, and underscores — 1234567890:AAH…. The digits before the colon are the bot's ID in Telegram; everything after it is the secret. In effect, it's the bot's login and password in one: whoever knows the full string receives the messages people send to the bot and can reply on its behalf. That's why you shouldn't send the token to work chats, commit it to a repository, or leave it in screenshots.
Two public strings are often confused with the token: the username (@myata_salon_bot) and the link https://t.me/myata_salon_bot. These are the bot's address for customers; they won't work in the “Token” field.
Copy the token directly from BotFather's message: in the Telegram app it's shown in a monospace font, and tapping it copies the whole string. CHBT passes to Telegram exactly what's pasted into the field, without trimming anything — an extra space at either end or a missing last character turns a working token into an error.
Where to paste the token in CHBT
- Sign in to app.chbt.io, select the bot, and go to the “Channels” section.
- Click “Connect channel” — the page scrolls to the “Connect a new channel” block and expands the Telegram card. The “Connect” button on the card itself does the same.
- Fill in the fields: “Channel name” is optional and for your own reference; “Token” is the string from BotFather.
- Click “Connect Telegram”.
The dashboard returns you to the bot's “Overview”: a Telegram row with a status appears in the “Channels” card. “Working” means the token was accepted. “Error” means Telegram's response is shown next to it; what it means is explained below. If you didn't fill in the name and the token was accepted, the row is labeled with the bot's username. The bot owner and admins can connect channels; the “Operator” role doesn't have the connection block. Telegram is available on any plan, including Free. What to check after connecting — an active flow and the first /start from your phone — is covered in the Telegram connection guide.
What CHBT does with the token on its own
- Verifies it. A
getMerequest to Telegram confirms the token is real and returns the bot’s username. - Sets the webhook. Using the
setWebhookmethod, CHBT gives Telegram an address likehttps://app.chbt.io/webhook/telegram/<channel ID>and a secret key. CHBT discards requests without this key, so no one can feed fake messages to your bot through the webhook address. - Stores and uses it. The token is stored encrypted in the database; the bot uses it to reply to customers, and operators use it to write from “Conversations”.
You don’t need your own server, domain or manual setup — there’s no webhook address field in the dashboard. If the webhook breaks, the channel row has a “Reinstall webhook” button: it re-checks the saved token and sets the CHBT webhook again.
Errors: Unauthorized, Not Found and others
- “Error” with the text “Unauthorized” right after connecting. The format is correct, but Telegram doesn’t recognize this token: a typo, a cut-off end of the secret part, a space after the token, or the token was already replaced via
/revoke. Get the current one in/mybots→ “API Token”, connect Telegram again, and delete the row with the error: the “⋯” button in the channel row → “Delete”. That row has no message history, since the bot never worked through it. - “Error” with the text “Not Found”. Something other than a token went into the field: a username, a t.me link, a string without the digits before the colon, or one with a leading space. Copy the token from the BotFather message again.
- The channel was working and now shows “bot token rejected (401 Unauthorized)”. The token was revoked or replaced in BotFather. You need a new one; how to replace it is described below.
- “Reinstall webhook” doesn’t help. The button uses the token saved in the channel. If that token has been revoked, Telegram will answer “Unauthorized” every time you click it.
- The status is “Working”, but “Conversations” is empty. The token is fine, but messages are going somewhere else — see the next section.
If the token is correct but the bot is still silent, the problem isn’t the token: go through the “Telegram bot is silent” checklist.
The bot is already connected to another service
You don’t need to create a new bot: an existing bot’s token works, and its subscribers, username and link stay the same. But a Telegram bot can have only one webhook, and once you connect it, CHBT starts receiving the messages. Your previous service won’t see them anymore, and code that fetched messages with getUpdates will get an error from Telegram, Conflict: can't use getUpdates method while webhook is active — this is expected.
The reverse situation is trickier. If you don’t disconnect the old service, on restart it may point the webhook back to itself or remove it, and messages will stop reaching CHBT. The channel row will still show “Working”: CHBT doesn’t know that Telegram is sending messages elsewhere. Remove the token from the old service or stop the code, then click “Reinstall webhook”.
Token leaked or revoked: how to replace it in the channel
Issuing a new token takes a minute: send /revoke to BotFather and choose the bot, or use “Revoke current token” in /mybots → “API Token.” The old token stops working immediately; the bot, its username, and its subscribers stay. Do this if the token ended up in a shared chat or a public repository, and when a contractor you gave it to has finished their work.
You can’t change the token in a channel that’s already connected: there’s no such field, and “Reinstall webhook” uses the old, saved token. So you connect the channel again:
- “Channels” → “Connect channel” → paste the new token into the Telegram card → “Connect Telegram.” CHBT will switch the bot’s webhook to the new channel row.
- When the new row’s status is “Working,” delete the old one: the “⋯” button → “Delete.”
Customer cards in “Contacts,” with their tags and fields, won’t be affected: they’re linked to the person’s Telegram account, not to the channel row, and the bot will recognize the same people. Messages that went through the deleted row stay in “Conversations” as read-only: open conversations in it will be closed, and new customer messages will come through the new row.
If you revoke the token and don’t replace it in CHBT, the very first attempt to reply on behalf of the bot will get a 401 from Telegram. The channel row will switch to “Error,” and the bot’s owner and admins will get an email “Your bot … needs attention” — no more than once a day, and only if “Email notifications” or the “Bot status” item isn’t turned off in “Notifications.” Don’t wait for the email: replace the token in CHBT right after /revoke.
FAQ
Where can I find the token if I lost the message from BotFather?
In BotFather itself: /mybots → choose the bot → “API Token,” or the /token command. The CHBT dashboard doesn’t show the token after it’s connected.
Does the token expire?
No. The token works until it's revoked with the /revoke command or the bot is deleted. You don't need to reconnect the channel in CHBT on a schedule.
Will the bot stop working after /revoke?
The bot itself stays in Telegram with all its subscribers, but CHBT won't be able to reply with the old token. In “Channels”, connect Telegram with the new token and delete the old channel row.
Can one token be connected to two CHBT bots?
The dashboard will accept it twice, but only the CHBT bot where the token was connected last will receive messages: a Telegram bot has only one webhook. To run one flow in several messengers, connect the channels within a single CHBT bot.
Connecting TelegramBot is silent: checklistHow to create a botTelegram bot