Reelspan posts to a Telegram channel or group through a bot you create with @BotFather and add to the chat. Posts appear under the channel's name, as if you had sent them yourself.
What you can post
| Post | How it appears |
|---|---|
| Video | A streamable video message, with the caption under it |
| Photos | One photo, or an album of up to 10. The caption sits under the first item. photos[] can mix photos and videos in one album |
| Text | A plain text message |
Captions under a video or photos hold 1,024 characters and text messages 4,096. Longer text is cut to fit, ending in …, and the result carries a warning.
A post in a public channel answers with its link (https://t.me/yourchannel/42). A private channel or a group has no public link, so url is null; post_id is the message id.
Connect your channel
You need a bot token and the chat. Setup takes about two minutes.
- Open @BotFather in Telegram and send
/newbot. Pick a name; it replies with your bot token. - Add the bot to your channel or group as an admin that can post messages.
- In the dashboard, open Accounts → Connect account, choose the profile and Telegram, then paste the token and the chat. A public channel is its
@name; a private one is its numeric id, which starts with-100.
To find a private channel's id, forward one of its posts to @userinfobot.
Reelspan checks both with Telegram before saving: the token must be valid, the bot must see the chat, and in a channel the bot must be an admin. The token is stored encrypted.
With the API
Send the same values to POST /v1/accounts/telegram. The chat can be @name, the numeric id, or a https://t.me/name link.
curl -X POST https://api.reelspan.com/v1/accounts/telegram \
-H "Authorization: Bearer $REELSPAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"profile_username": "my-brand", "bot_token": "123456789:AAH...", "chat": "@yourchannel"}'import { Reelspan } from 'reelspan';
const reelspan = new Reelspan();
await reelspan.accounts.connect('my-brand', 'telegram', {
bot_token: process.env.TELEGRAM_BOT_TOKEN,
chat: '@yourchannel',
});import os
from reelspan import Reelspan
reelspan = Reelspan()
reelspan.accounts.connect("my-brand", "telegram", bot_token=os.environ["TELEGRAM_BOT_TOKEN"], chat="@yourchannel"){ "success": true, "platform": "telegram", "account": "@yourchannel", "reconnected": false }| Field | Required | Also accepted (Upload-Post) |
|---|---|---|
bot_token |
Yes | |
chat |
Yes | chat_id |
Connecting again replaces the Telegram account on that profile. See Connect with credentials for the endpoint itself.
Example post
A video to the channel, with its own caption for Telegram:
curl -X POST https://api.reelspan.com/v1/posts/video \
-H "Authorization: Bearer $REELSPAN_API_KEY" \
-F "user=my-brand" \
-F "platform[]=telegram" \
-F "title=Launch day" \
-F "telegram_title=Launch day. Watch the 60-second tour, then tell us what you think." \
-F "first_comment=Questions? Reply here." \
-F "[email protected]"import { Reelspan } from 'reelspan';
import { readFile } from 'node:fs/promises';
const reelspan = new Reelspan();
const post = await reelspan.posts.video({
user: 'my-brand',
platforms: ['telegram'],
title: 'Launch day',
firstComment: 'Questions? Reply here.',
video: { data: await readFile('launch.mp4'), name: 'launch.mp4', type: 'video/mp4' },
extra: { telegram_title: 'Launch day. Watch the 60-second tour, then tell us what you think.' },
});from reelspan import Reelspan
reelspan = Reelspan()
post = reelspan.posts.video(
"my-brand", ["telegram"], "launch.mp4", "Launch day",
first_comment="Questions? Reply here.",
extra={"telegram_title": "Launch day. Watch the 60-second tour, then tell us what you think."},
){
"success": true,
"request_id": "9b1f6c2e8a3d4f50b7e1c9a2d6f3e8b1",
"results": {
"telegram": { "success": true, "url": "https://t.me/yourchannel/42", "post_id": "42", "first_comment": "posted" }
}
}Fields
| Field | Meaning |
|---|---|
telegram_title |
The message text or caption on Telegram. Falls back to title. |
title |
The caption every network uses, when telegram_title isn't sent. |
telegram_first_comment |
Sent as a reply to the post in the same chat. Falls back to first_comment. |
first_comment |
The first comment for every network that takes one. |
telegram_parse_mode |
HTML, MarkdownV2 or Markdown: how Telegram reads formatting in the text. Leave it out for plain text. |
telegram_disable_notification |
true posts silently: subscribers get no sound. |
telegram_protect_content |
true stops the post being forwarded or saved. |
telegram_has_spoiler |
true blurs the photos or video until tapped. |
telegram_as_document |
true sends the files uncompressed, as documents, instead of as photos or a playable video. |
Telegram has no options of its own in the dashboard composer.
Limits and behaviour
- Files: up to 50 MB each, the most a bot may send. A larger file fails the Telegram post with
file_too_large; other networks in the request are not affected. - Albums: up to 10 items. With more photos, the first 10 are sent and the result carries a warning.
- Text: captions 1,024 characters, messages 4,096. Longer text is cut with a warning.
- Formatting: text is sent as plain text unless you set
telegram_parse_mode. With a parse mode, the text must follow Telegram's rules for it (MarkdownV2 needs characters such as.and!escaped), or Telegram refuses the message. - Links: only public channels have post links. Elsewhere
urlisnull.
After posting
The bot can change the messages it sent:
- Delete a message with Unpublish. Telegram lets bots delete messages only for 48 hours after sending.
- Edit its text or caption with Edit a post. Send
fields.telegram_parse_modeagain if the new text uses formatting.
Common errors
| Code | When | Fix |
|---|---|---|
INVALID_TOKEN |
Connecting: the token isn't shaped like 123456:ABC… |
Copy the whole token from @BotFather. |
INVALID_CHAT |
Connecting: the chat isn't @name or a numeric id |
Use @yourchannel, or the -100… id of a private channel. |
BOT_NOT_ADMIN |
Connecting: the bot isn't an admin of the channel | Make the bot an admin that can post messages, then connect again. |
TELEGRAM_ERROR |
Telegram refused a call; the message is Telegram's own (for example "chat not found") | Check the chat, and that the bot is still in it. |
reauth_required |
Telegram answered 401 or 403: the token was revoked, or the bot was removed | Connect again with a working token. When connecting, this shows as REAUTH_REQUIRED. |
file_too_large |
A file is over 50 MB | Send a smaller file to Telegram. |
telegram_error |
Telegram refused the post. Retried automatically on 429 and 5xx | Read error for Telegram's reason. |
MISSING_FIELD |
Connecting without bot_token or chat |
Send both. |
Errors when connecting come back as a 400 with the code in error_code. Errors when posting are in that network's result. See Errors.