Who a Telegram bot is when an agent sends a message
A Telegram bot token sends as the bot. The person must message first. Privacy mode hides most group chat, and bulk sends stall near 30 messages a second.
Key takeaways
- -In this article we explore the Telegram Bot API and who the sender is when an agent texts.
- -The bot token is the identity. Anyone with the token controls the bot. A Slack-style workspace boundary is not part of this API.
- -A bot cannot start a private chat. The person has to message the bot or add it to a group first.
- -Privacy mode hides ordinary group messages. Bulk sends start failing near 30 messages a second.
The agent tells a customer "I texted you on Telegram." The customer sees nothing. The API call returned 403. The bot had never been opened by that person, so Telegram refused the private message. In the group where the bot does sit, a later send shows the bot's name, not the employee's. There is no workspace to hide behind. The token is the identity.
This post is the Telegram Bot API identity model: who sends, who must speak first, what privacy mode hides, and the broadcast numbers Telegram publishes.
The token is the bot
Telegram's bot introduction is direct. Bots are special accounts. They show a bot label, not a last-seen time. You create one by talking to @BotFather, and BotFather returns a token. Anyone with that token has full control of the bot. The introduction says to store it somewhere safe and share it only with people who need direct access. Policy as code is how you stop sendMessage from accepting a chat_id that never showed up in an update.
There is no Slack-style workspace in that model. A Slack app is installed into a workspace, which is the boundary the Slack agent post is about. A Telegram bot token is the bot, in every chat that bot is allowed to be in. If the agent and a human both use the token, they are the same sender. The customer cannot tell which process typed.
sendMessage takes a chat_id. That id is a person, a group, or a channel. It is not a user id inside a company tenant. Get the chat_id from an update the bot actually received. Do not invent one from an email address. Telegram will not resolve "[email protected]" into a chat.
There is no .env file in this project. Swytchcode keeps credentials in its own local store and reads them when a call runs. The bot token belongs there. It does not belong in the model context, because the model would then be able to call sendMessage as the bot without you.
swy search telegram
swy get telegram
swy list methodsThe Telegram catalog page is the method list once the bundle is local. Enable sendMessage only for chats you have already seen in an update.
The person has to open the chat
Telegram's rule: bots cannot start conversations with users. The person adds the bot to a group, or they message the bot first. They can search the username or open t.me/ plus that username. Until one of those happens, a private sendMessage has nowhere legal to go.
That is the 403 your logs should treat as final for that chat_id. Retrying it does not create the chat. Ask the person to open the bot, wait until an update arrives with their chat_id, and only then send.
Business Mode is a different product. Telegram Business accounts can connect a bot to answer on the user's behalf. You turn that on in @BotFather if you mean it. A normal bot token does not become the employee. If the task is "notify the on-call channel," use a group the bot has been added to, and say in the product that the speaker is the bot.
Privacy mode decides what the bot hears
By default, a bot in a group only sees messages that are relevant to it. The bots FAQ spells out the rest. Every bot sees service messages, private chats, and channels where it is a member. With privacy mode on, a group bot sees commands aimed at it, general commands like /start when it was the last bot to speak, messages sent via the bot, and replies to its own messages. It does not see the ambient chatter.
Bots also cannot see messages from other bots, in any mode. Telegram did that to stop loops. Two agents in one group will not observe each other's posts. If your design was "the research bot reads what the notify bot just said," it will fail closed. One bot has to be the speaker, or a human has to bridge them.
Privacy mode off, or bot-admin, widens the group view to everything except other bots. Turning privacy off so the agent "has context" means the bot receives the group's conversation. That is a data decision, not a debugging convenience. Leave privacy on unless the review explicitly wants the wider firehose.
Updates come from long polling or a webhook, not both. getUpdates returns the oldest 100 unconfirmed updates. Confirm them with offset set to the last processed update_id plus one. Forget the offset and the bot processes the same update forever, and may send the same reply forever.
The ceilings Telegram prints
The FAQ gives the broadcast math. In one chat, stay at or under about one message a second. Short bursts may pass. Then you get 429. In a group, 20 messages a minute is the line they name. Bulk notifications to many users sit near 30 messages a second unless you turn on paid broadcasts.
Paid broadcasts, enabled in @BotFather, raise the ceiling toward 1,000 a second. Messages above the free 30 a second cost 0.1 Stars each, from the bot's balance, and only successful ones are charged. The bot needs at least 100,000 Stars and 100,000 monthly active users before that feature is available. An agent that loops sendMessage across a user list will hit 429 long before it qualifies for that plan. Spread the sends, or stop.
Store the token with swy auth connect. Keep privacy mode on. Send only to a chat_id that already appeared in an update. Treat 403 on a new private chat as "they have not opened the bot," and treat 429 as "you crossed the per-chat or bulk ceiling."
Related reading
- Human approval for a tool call. A hold before a burst of
sendMessagecalls, on Business and Enterprise. - A security checklist before company data. What changes if you disable privacy mode in a group.
- Log every API call an agent makes. Where the 403 and the
chat_idshould be visible. - API governance tools for AI agents. Why the bot token is an allowlist problem, not a prompt problem.
FAQ
Can the agent Telegram a customer who has never opened the bot?
No. Telegram says a bot cannot start the conversation. The person must message the bot or add it to a group. A private send before that fails. Retrying does not open the chat.
Will the message appear as the employee?
It appears as the bot. The token is the bot's identity. Telegram Business can attach a bot to a business account, and that is a separate switch in @BotFather. A standard bot token does not impersonate a person.
Why can the bot not see the other agent's message in the group?
Bots do not receive messages sent by other bots. Privacy mode also hides ordinary group chatter from a bot that was only mentioned sometimes. If two bots must cooperate, design a path that does not depend on them reading each other.
What is the send limit before 429?
About one message a second in a single chat, about 20 a minute in a group, and about 30 a second for bulk notifications. Paid broadcasts cost 0.1 Stars per message above that free bulk rate and require a large bot balance and a large monthly audience.
More content
Circle API transfers and the idempotency key you must reuse
Circle puts idempotencyKey, a UUID v4, in the transfer body. Reuse that key on a retry. A new key starts a second transfer. Code 1083 means the body changed.
How to query the GDELT API without drowning the agent
GDELT's DOC API needs no key. The default search is three months of HTML, up to 75 articles. Set timespan, maxrecords, and format=json, then wait out a 429.
Bitbucket API tokens and the username that causes a 401
Bitbucket app passwords stopped being the supported path in 2026. API tokens use your Atlassian email, need scopes, and can be limited to one workspace.
