Platforms / Telegram
Telegram API
Post to Telegram channels and groups through your bot and answer the messages people send it.
At a glance
- Platform id
telegram- Connects
- channel or group
- Sign-in
- Credentials the user enters (no OAuth app needed)
- Post types
- Text · Image · Video · Album (up to 10 photos and videos)
Capabilities
| Publishing | Yes |
|---|---|
| Scheduling | Yes |
| Comments | No |
| Direct messages | Yes |
| Mentions | No |
| Reviews | No |
| Analytics | Partly |
Required on every post
- Text or media, and an account connected with a chat (an inbox-only bot cannot post).
Options
Send these in platform_data.telegram on the post, or flat in a target's own platform_data (the target's keys win). See Publishing.
| Key | Type | What it does |
|---|---|---|
parse_mode | HTML | MarkdownV2 | Markdown | How Telegram formats the text. Default: plain text. |
disable_notification | boolean | Send silently. |
protect_content | boolean | Block forwarding and saving. |
disable_link_preview | boolean | No link preview on text posts. |
reply_to | number | Message id in the same chat to reply to. |
message_thread_id | number | Forum topic to post in. |
Limits
- 4,096 characters per message. Albums up to 10 photos and videos.
- By URL Telegram downloads photos up to 5 MB and videos up to 20 MB itself; larger files are uploaded (photos up to 10 MB, one video up to 50 MB).
- Telegram allows about 1 message per second per chat and 30 per second overall; when it slows a reply down, the API returns 429 platform.telegram.rate_limit with the wait in Retry-After.
Text over the limit fails validation before anything is sent. The caps of this server are explained in Rate limits.
Good to know
- A bot can only answer: a person must open a chat with it (/start) before it can message them. After that there is no reply window.
- Telegram gives bots no message history, so the inbox starts with messages that arrive after you connect.
- Connecting sets the bot's webhook, replacing any other service's webhook or getUpdates polling for that bot.
- Replies go out as text, or one photo or document per message (photos by URL up to 5 MB, other files up to 20 MB). Buttons and reactions are not sent.
- In groups the bot sees every message only when it is an administrator or its privacy mode is off (@BotFather → /setprivacy).
- Bot tokens do not expire. After /revoke in @BotFather, reconnect with the new token.
- One bot shared by different customers shares one webhook; give each customer their own bot.
- DM events carry chat_id and message_id in their metadata.
Publish with the API
curl https://api.zaynstack.com/v1/posts \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{
"text": "Hello from SocialWire",
"media": [{ "type": "image", "source_type": "url", "source": "https://example.com/file.jpg" }],
"targets": [{ "account_id": "<Telegram account id>" }],
"publish_now": true
}'An operation Telegram cannot do answers 501 resource.not_supported. Agents can do the same through the MCP server.
Connection errors
A connection that fails comes back to your redirect_uri with status=error, error=<code> and error_description, or as the error of the connect call. All codes: Connect accounts.
| Code | Meaning |
|---|---|
platform.telegram.auth | The bot token is wrong or was revoked. |
account.already_linked | The brand already holds a different account on this platform, or the account belongs to another brand while lock_accounts_to_brand is on. |
billing.brands_limit | No brand_id was sent, so a new brand was needed, and the plan has no room for another brand. |
Webhook events
Every platform sends the post.* and account.* events. Telegram also sends:
dm.received
Not supported yet
- Comments, mentions and message history.
- Buttons and reactions in replies.
Developer setup (self-hosting)
Only the operator of this server does this, once. Users then just click Connect.
- Message @BotFather, send /newbot, pick a name and a username ending in "bot", and copy the token it sends.
- To post: add the bot to the channel (as an administrator allowed to post) or group, then connect with metadata.bot_token and the chat's @username or numeric id in metadata.chat.
- For direct messages only: connect with the token alone.
Permissions requested
Bot token (no OAuth)
When a reconnect grants fewer permissions than before, an account.updated event with change permissions_reduced is sent. Accounts connected before a permission was added keep working but must reconnect to use the features it unlocks.
Before anyone can connect (review)
- None: no developer account, verification or app review.
Typical wait: None. Until then the app works for your own accounts and the testers you add in the console.