Documentation Index
Fetch the complete documentation index at: https://orbit-docs.devotel.io/llms.txt
Use this file to discover all available pages before exploring further.
Telegram
Orbit’s Telegram channel wraps the Telegram Bot API so you can send and receive messages, photos, documents, inline keyboards, and callbacks from the same unified Messaging surface used for every other channel. Each Orbit organization can attach one or more bots; webhook delivery is automatic.Send a message
Response
Capabilities
- Text + media — text (with HTML / MarkdownV2 formatting), photo, video, audio, document, voice, animation, sticker.
- Inline + reply keyboards —
inline_keyboard,reply_keyboard, plusforce_replyandremove_keyboard. - Callbacks —
callback_queryevents surfaced astelegram.callbackwebhooks; auto-answerCallbackQueryis handled by Orbit so the spinner clears in the user’s client. - Chat actions —
typing,upload_photo, etc., either via the API or auto-emitted by Orbit when a long-running send is in flight. - Edit + delete — the
PATCH /messages/:idandDELETE /messages/:idendpoints translate toeditMessageTextanddeleteMessage. - Inline mode + bot commands — registered via the bot setup wizard;
/startdeep-links land on your conversation routing rules. - Webhook security — Telegram’s
secret_tokenheader is validated against the per-bot secret stored in Orbit’s encrypted credential vault.
Onboarding flow
- Talk to @BotFather and create a bot. Save the token it returns.
- From the dashboard, navigate to Channels → Telegram → Add bot and paste the token.
- Orbit auto-registers the webhook URL
https://api.orbit.devotel.io/api/v1/webhooks/inbound/telegramand rotates thesecret_tokenheader value. - Optional: configure inline mode and the bot command list directly from the channel detail page.
Token handling — your responsibility
Telegram bot tokens are bearer credentials. Anyone who has the token can read every message sent to your bot, send messages on its behalf, and — until the token is revoked via BotFather — pose as your bot to your users. Orbit encrypts the token at rest with anenc:v1: envelope and never echoes it back through any API response, but the token’s safety upstream of Orbit (in your password manager, your laptop, your CI/CD variables, your screenshots) is yours to protect:
- Never commit a bot token to git, public or private. GitHub and GitLab both surface tokens to search; bots have scraped them in seconds.
- Never paste a token into a chat, ticket, screenshot, or screen-share. Use the dashboard paste field, which masks the value after submit.
- Rotate immediately via
/revokein BotFather if you believe a token has been exposed. Old tokens stop working the moment a new one is issued; reconnect in Orbit with the new value and the existing conversation history is preserved (we key history bybot_id, not by the token). - Scope each environment to its own bot. Use distinct BotFather bots for dev / staging / production so a leaked dev token doesn’t compromise customer conversations.
Ownership disputes
Orbit identifies a bot by itsbot_id (the numeric prefix of the token) and enforces a single-tenant claim: once an Orbit organization connects a bot, the same bot cannot be connected to a second Orbit organization until the first one disconnects. The dashboard surfaces TELEGRAM_BOT_ALREADY_CONNECTED (HTTP 409) when a second tenant attempts the same bot.
Connecting a bot to Orbit proves you have the bot’s token. It does NOT prove you are the BotFather owner of the bot. If a token leaks (see “Token handling” above) and a hostile actor claims it on their own Orbit tenant before you do, you will see a 409 on your own connect attempt — your bot is locked to someone else’s Orbit organization. Two recovery paths, in order of preference:
-
Revoke the token via BotFather (you, as the bot’s BotFather owner). Open @BotFather, select the bot, and run
/revoke. BotFather issues a new token; the leaked token immediately stops working. The hostile tenant’s webhook registration is now dead — Telegram refuses every send / receive against the old token. Once the hostile claim is functionally inert, contact Orbit support (see step 2) to release thebot_idclaim so you can connect with the new token. -
Open an ownership-dispute ticket with Orbit support. Email support@devotel.io with subject
Telegram bot ownership dispute — <bot_username>and include:- The bot’s
@usernameand numericbot_id(the digits before the colon in any token you’ve held). - Proof of BotFather ownership — a screenshot of the
/mybotslist in BotFather showing the bot under your Telegram account, OR a fresh token rotation timestamp from BotFather that we can correlate against Telegram’sgetMeresponse on the live token. - The Orbit organization you want the bot claim transferred to.
bot_idso you can connect from your own Orbit organization. Median response time is one business day; security-sensitive disputes are escalated to on-call. - The bot’s
Common errors
| Code | HTTP | Cause | Fix |
|---|---|---|---|
TG_INVALID_TOKEN | 401 | The bot token has been revoked or rotated by BotFather. | Issue a new token via /revoke in BotFather, then update credentials in the dashboard. |
TG_CHAT_NOT_FOUND | 404 | The chat id no longer exists or the user has blocked the bot. | Skip the recipient; this is permanent until the user re-engages. |
TG_FORBIDDEN_BY_USER | 403 | The user has explicitly blocked the bot. | Mark the contact as opted-out; do not retry. |
TG_FILE_TOO_LARGE | 413 | Attachment exceeds 50 MB (text-API) / 2 GB (Bot API). | Use the file upload endpoint to chunk, or host externally and send a URL. |
TG_FLOOD_WAIT | 429 | Too many requests in a short window. | Honour the Retry-After header — Telegram’s flood-control is strict. |