Tesselith
ProductSolutionsAI agentsCompareFree toolsBlogPricing
Log inStart free
  1. Home/
  2. Blog/
  3. Telegram Bot API: Send Messages, Photos and Media Groups to a Channel

Developers

Telegram Bot API: Send Messages, Photos and Media Groups to a Channel

November 27, 2026 · 7 min read

Send messages, photos and albums to a Telegram channel with the Bot API: bot setup, chat ids, sendMessage, sendMediaGroup, formatting, file limits and flood control.

To post to a Telegram channel with the Bot API, create a bot with @BotFather, add it to the channel as an administrator with the Post Messages right, then call `https://api.telegram.org/bot<token>/sendMessage` with `chat_id` set to the channel's `@username` (or its numeric id, which starts with -100) and your `text`. Photos use sendPhoto, and albums of 2 to 10 photos or videos use sendMediaGroup. Messages can be 4,096 characters, but media captions only 1,024. Telegram limits bots to roughly one message per second in a single chat, and returns 429 with a retry_after when you go over.

Key takeaways

  • The bot must be a channel admin with Post Messages. Being a member isn't enough.
  • Public channels take @username as chat_id. Private channels need the numeric -100... id.
  • Text: 4,096 characters. Captions: 1,024. A long caption fails the whole send.
  • Albums (sendMediaGroup) take 2 to 10 items, and only the first item's caption shows as the album caption.
  • Telegram reports most failures as ok: false in the body. Check it, not just the HTTP status.

Step 1: create the bot and make it a channel admin

  1. In Telegram, open a chat with @BotFather, send /newbot, pick a display name and a username ending in bot.
  2. BotFather replies with a token like 123456789:AA.... That token is the bot's full credential. Store it like a password.
  3. Open your channel, tap its name, then Administrators, Add Admin, search for your bot, and keep Post Messages enabled.
  4. Note the channel's public link. For t.me/bakerynews, the chat id is @bakerynews.

If you're new to channels, how to create a Telegram channel walks through setup, and Telegram channel vs group explains which one you want. A bot can post to both, but the rate limits differ.

Before your first send, check the target with getChat. It confirms the bot can see the chat and tells you its type: channel, group, supergroup or private. That check saved us a class of support tickets: getChat happily resolves a bot or a private chat, so someone entering their bot's own @username as the channel looked fine at connect time and only failed at publish, three retries later. Reject private at setup, while the person is still looking at the form.

curl "https://api.telegram.org/bot$BOT_TOKEN/getChat?chat_id=@bakerynews"

# {"ok": true, "result": {"id": -1001234567890, "title": "Bakery News", "type": "channel", "username": "bakerynews"}}

Save the numeric id too. If the channel's username changes, or the channel goes private, @username stops working but the numeric id doesn't.

Step 2: send a text message

curl -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "@bakerynews",
    "text": "Fresh croissants until 11. Pre-orders for Saturday close tonight.",
    "link_preview_options": {"is_disabled": false},
    "disable_notification": false
  }'

# {"ok": true, "result": {"message_id": 418, "date": 1795849200, "chat": {...}, "text": "..."}}

Store message_id. You need it to edit (editMessageText), delete (deleteMessage) or reply to the post. date is Unix seconds. Set disable_notification: true for a silent post that arrives without a sound, which is good manners for late-night or low-priority updates.

Current parameter names, as of Bot API 10.5 (November 22, 2026): link previews are controlled with link_preview_options, and replies use reply_parameters with a message_id. The older disable_web_page_preview and reply_to_message_id fields no longer appear in the docs. Code written before 2024 often still sends them.

Formatting: HTML is safer than MarkdownV2

Without parse_mode, text goes out exactly as written, which is the safe default for user-written copy. To add bold, italics or links, you have two options. MarkdownV2 requires a backslash before every underscore, asterisk, bracket, parenthesis, tilde, backtick, greater-than sign, hash, plus, minus, equals sign, pipe, brace, period and exclamation mark that appears in plain text, and a single unescaped period or hyphen makes Telegram reject the whole message. HTML only needs <, > and & escaped. For anything that includes user input, use HTML.

const escapeHtml = (s: string) =>
  s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")

const text =
  "<b>" + escapeHtml(title) + "</b>\n" +
  escapeHtml(summary) + "\n" +
  '<a href="' + escapeHtml(url) + '">Read more</a>'

await tg("sendMessage", { chat_id: "@bakerynews", text, parse_mode: "HTML" })

Photos, videos and documents

sendPhoto, sendVideo and sendDocument each take the file in one of three ways, with different limits:

How you send the filePhoto limitOther files
Public HTTP URL (Telegram downloads it)5 MB20 MB
Multipart upload10 MB50 MB
file_id of a file Telegram already hasNo limitNo limit

Passing a URL is the easiest: Telegram fetches from your storage directly and your server never touches the bytes. Watch the URL limits, though. A 30 MB video works as a multipart upload and fails as a URL. Once a file is sent, the response includes a file_id, and reusing it for later posts costs nothing and has no size limit.

curl -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendPhoto" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "@bakerynews",
    "photo": "https://cdn.example.com/croissants.jpg",
    "caption": "Saturday batch. Pre-order by 8pm Friday."
  }'

Captions max out at 1,024 characters after entity parsing, a quarter of the message limit. If your post text is longer, either send the photo with a short caption and the full text as a separate message, or send the text first with a link preview. Truncating silently is worse than either. Send GIFs as documents or animations if you want to avoid Telegram re-encoding them as photos.

Albums with sendMediaGroup

sendMediaGroup posts 2 to 10 items as one album. Each item is an object with type (photo, video, document or audio) and media. Put the caption on the first item only. Captions on later items show up per item, which looks like the same text repeated. Documents and audio can only be grouped with items of the same type, so a PDF can't join a photo album.

curl -X POST "https://api.telegram.org/bot$BOT_TOKEN/sendMediaGroup" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "@bakerynews",
    "media": [
      {"type": "photo", "media": "https://cdn.example.com/a.jpg", "caption": "This week at the bakery"},
      {"type": "photo", "media": "https://cdn.example.com/b.jpg"},
      {"type": "video", "media": "https://cdn.example.com/c.mp4"}
    ]
  }'

# {"ok": true, "result": [{"message_id": 420, ...}, {"message_id": 421, ...}, {"message_id": 422, ...}]}

The result is an array, one message per item. Store the first message_id as the album's id, since that's the message a reply or comment should point at.

Errors and flood control

Telegram's responses always carry ok. On failure you get ok: false, an error_code and a description, sometimes with HTTP 200 and sometimes with a 4xx. Parse the body every time.

error_codeTypical descriptionRetry?
400Bad Request: chat not found / message is too long / can't parse entitiesNo. Fix the request
401Unauthorized (token revoked or wrong)No. Get a new token
403Forbidden: bot is not a member / was kicked / not enough rightsNo. Re-add the bot as admin
429Too Many Requests: retry after NYes, after parameters.retry_after seconds
5xxTelegram's sideYes, with backoff

Limits from Telegram's bot FAQ: avoid more than one message per second in a single chat (short bursts are tolerated), no more than 20 messages per minute in a group, and about 30 messages per second for bulk broadcasts across chats. Paid broadcasts, enabled in @BotFather, raise the last one to 1,000 per second at 0.1 Telegram Stars per message over the free amount. A scheduler posting to channels will rarely touch these, but a thread of ten follow-up messages fired in a loop will hit the per-chat limit. Space them a second apart.

Follow-ups, edits and analytics

  • Follow-up in the same thread of thought: send a new message with reply_parameters: {"message_id": 418}. It shows as a reply in the channel.
  • Fix a typo: editMessageText (or editMessageCaption for media) with the message_id. Subscribers see an edited label.
  • Pin: pinChatMessage in a channel needs the bot to have the Edit Messages admin right.
  • Subscribers: getChatMemberCount returns the channel's subscriber count.
  • Views per post: not available through the Bot API. View counts need the MTProto client API, which is a different integration.

For channel strategy rather than code, read our Telegram channel marketing guide and how to schedule Telegram posts.

When to use a scheduling API instead of building it yourself

The Bot API is the easiest publishing API of any network here: no OAuth, no review, no fees. A cron job and sendMessage is a fine way to post to your own channel. A scheduler earns its keep when Telegram is one of several channels, when non-developers write the posts, or when you need a calendar, approvals and failure alerts around the sends.

Tesselith posts to Telegram channels today, with albums, silent posts and follow-up replies, from the app or the REST API. For the bigger picture, see our scheduling API checklist, the automation walkthrough, and the docs.

Questions people ask

How do I send a message to a Telegram channel with a bot?
Add the bot to the channel as an administrator with Post Messages, then call sendMessage with chat_id set to the channel's @username or numeric -100 id and your text.
What chat_id do I use for a private Telegram channel?
The numeric id, which starts with -100. Get it from getChat while the channel is public, or from an update the bot receives from the channel.
How many photos can a Telegram media group have?
Between 2 and 10 items per sendMediaGroup call. Only the first item's caption is shown as the album caption.
What is the Telegram caption limit?
1,024 characters for media captions, versus 4,096 for a text message.
Why does my Telegram bot get 403 Forbidden on a channel?
The bot isn't an administrator of the channel, lacks the Post Messages right, or was removed. Re-add it as an admin.

Try Tesselith free

Connect your channels and schedule your first post in minutes. No credit card required.

Start free

Related pages

Schedule Telegram posts with TesselithTelegram channel marketing guideHow to schedule Telegram postsTelegram character counter

More from the blog

Discord Webhooks: Send Messages, Embeds and Files (With Rate Limits That Won't Bite)Buffer API Alternative: What to Do Before the Legacy API Retires on February 1, 2027How to Automate Social Media Posting With an API (Node.js and Python Examples)Social Media Webhooks, Explained: Get Notified the Moment a Post Publishes or Fails

Free to start

One calendar for everything you post.

No credit card. Connect your first channel and schedule a post in under two minutes.

Start free
Tesselith

The social scheduler for creators, teams and agencies. One calendar, every network you post to.

Product

  • Composer
  • Calendar
  • Analytics
  • Automation
  • AI assistant
  • Posting queue
  • API & webhooks
  • MCP server
  • All features

AI agents

  • Claude
  • Claude Code
  • ChatGPT
  • Codex
  • Cursor
  • Gemini CLI
  • n8n
  • All AI agents

Solutions

  • Creators
  • Agencies
  • Small business
  • E-commerce
  • All solutions

Compare

  • Scheduler pricing 2026
  • vs Buffer
  • vs Hootsuite
  • Metricool alternatives
  • Planoly alternatives
  • SocialBee alternatives
  • All comparisons
  • All alternatives

Free tools

  • Character counter
  • Best time to post
  • UTM builder
  • Engagement rate
  • All tools

Company

  • About
  • Blog
  • Research
  • Developer docs
  • Pricing
  • Contact
  • Security
  • Status

Legal

  • Privacy
  • Terms
  • Cookies
  • Acceptable Use
  • DPA
  • Refunds

Schedule posts for

  • X (Twitter)
  • Instagram
  • Facebook Pages
  • LinkedIn
  • YouTube
  • TikTok
  • Threads
  • Bluesky
  • Mastodon
  • Pinterest
  • Reddit
  • Discord
  • Telegram
  • Dev.to
  • Hashnode

Popular guides

  • Post to all social media at once
  • Schedule Discord messages
  • Cross-post to Bluesky, Mastodon and Threads
  • Buffer pricing
  • Sprout Social pricing
  • Metricool pricing
  • Sendible pricing
  • Loomly pricing
© 2026 Tesselith. All rights reserved.
PrivacyTermsCookiesSecurityData deletion
Tesselith