Telegram
MessagingPublish text, photos, videos, documents and albums to Telegram channels and groups with the Zernio API, edit published messages, and handle the connected group or channel in the inbox.
Authentication details
Connecting accounts guideBot Token
Connect endpoints
GET /v1/connect/telegramGenerate Telegram codePOST /v1/connect/telegramConnect Telegram directlyPATCH /v1/connect/telegramCheck Telegram status
Publish text, photos, videos, documents and albums to a Telegram channel or group with POST /v1/posts and platform: "telegram". Messages in the connected group or channel reach the inbox; private DMs to the bot are not stored.
Quick reference
| Property | Value |
|---|---|
| Text limit | 4,096 characters (text messages) |
| Caption limit | 1,024 characters (media captions) |
| Images per album | 10 |
| Videos per album | 10 |
| Mixed media | Yes (images and videos in the same album) |
| Image formats | JPEG, PNG, GIF, WebP |
| Image max size | 10 MB (auto-compressed) |
| Video formats | MP4, MOV |
| Video max size | 50 MB (auto-compressed) |
| Scheduling | Yes |
| Editing published posts | Yes (text or caption, media cannot be changed) |
| Inbox (DMs) | Connected group or channel only (private DMs to the bot are not stored) |
| Inbox (comments) | No |
| Analytics | No (Telegram limitation) |
Before you start
Telegram requires Zernio's bot, @LateScheduleBot (shown as "Social Media Connector"), to be an administrator of your channel or group with permission to post.
There is no OAuth and there are no scopes. What the bot can do comes from the admin permissions you grant it.
In a channel, posts appear as the channel's name and logo. In a group, posts appear as sent by "Social Media Connector", and that cannot be changed.
Add @LateScheduleBot as an administrator with the Post Messages permission before you connect.
A bot that is a plain member, or an admin without post permission, is the most common setup failure.
The connect call returns 400 and every post fails with "Bot is not a member of the channel".
Connect
Call GET /v1/connect/telegram with profileId to generate an access code, valid for 15 minutes.
The user adds the bot to the channel or group and sends it the code. You poll until the connection completes.
The full flow, with code for every step, is on Connect.
Publish a post
This request sends an HTML-formatted message to a Telegram channel or group right away.
const { data: published } = await zernio.posts.createPost({
body: {
content: '<b>Release 2.3 is out.</b>\n\nRead the <a href="https://example.com/changelog">changelog</a>.',
platforms: [
{
platform: 'telegram',
accountId: '66b2e19d8c3f5a7e9d0b1c2d',
platformSpecificData: { parseMode: 'HTML' }
}
],
publishNow: true
}
});
console.log(published.post.platforms[0].platformPostUrl);Every option is on Publish.
In this section
Connect
Connect a Telegram account with the Zernio API, every step with code.
Publish
Publish text, photos, videos, documents and albums to a Telegram channel or group, and edit published messages.
Platform fields & media
Every Telegram platformSpecificData field and the image and video requirements.
Inbox
Telegram direct messages, bot commands and inbox webhooks.
Limits & errors
Analytics availability, what Telegram's Bot API does not expose and the common errors when publishing.
Related
- Connecting accounts: the access code flow next to the OAuth platforms.
- Create post: every field of the request.
- Edit post: edit the text or caption of a published message.
- Media uploads: upload images and videos instead of hosting them.
- Messages and Account settings: the inbox API and bot commands.
- Pricing: what the inbox and outbound messages cost.
Telegram
6- GET
- POST
- PATCH
- GET
- PUT
- DELETE
Publishing
24· Unified API, shared with other platforms- POST
- POST
- POST
- POST
- GET
- POST
- GET
- PUT
- DELETE
- POST
- POST
- POST
Direct messages
24· Unified API, shared with other platforms- GET
- POST
- GET
- GET
- PUT
- DELETE
- GET
- POST
- PATCH
- DELETE
- POST
- POST