# How to Post to Telegram with an API (2026 Developer Guide) > Telegram is the easiest social platform to publish to programmatically: no OAuth, no app review, no per-post fee. Here is how to post to a channel with the Bot API, with working code and the limits that apply. **Source:** https://posteverywhere.ai/blog/post-to-telegram-api **Author:** Jamie Partridge **Published:** 2026-09-01 --- _Last updated: September 2026._ The Telegram API is the easiest major social platform to publish to programmatically, and it is not close. Everything runs through the [Telegram Bot API](https://core.telegram.org/bots/features), which is free and open to anyone. There is no OAuth dance. There is no app review that takes three weeks and might be rejected. There is no per-post fee. You message a bot, get a token, and start posting. Compared with Meta's Graph API or [X's pay-per-call pricing](/blog/x-twitter-api-pricing), the difference in effort is roughly a weekend versus an afternoon. This guide covers creating a bot, posting text and media to a channel, the limits that apply, and the specific things that trip people up. ## Table of Contents 1. [The 30-Second Answer](#the-30-second-answer) 2. [Create a Bot and Get a Token](#create-a-bot-and-get-a-token) 3. [Find Your Chat ID](#find-your-chat-id) 4. [Post a Text Message](#post-a-text-message) 5. [Post an Image or Video](#post-an-image-or-video) 6. [Telegram Limits and Media Specs](#telegram-limits-and-media-specs) 7. [Formatting, Links and Previews](#formatting-links-and-previews) 8. [Scheduling and Rate Limits](#scheduling-and-rate-limits) 9. [When to Use a Publishing API Instead](#when-to-use-a-publishing-api-instead) 10. [FAQ: Telegram API Posting](#faq-telegram-api-posting) ## The 30-Second Answer To post to a Telegram channel programmatically, create a bot with BotFather to get a token, add the bot to your channel as an administrator, then send a POST request to `https://api.telegram.org/bot/sendMessage` with `chat_id` and `text`. There is no OAuth flow, no app review, and no charge per message. The main constraints are a 4,096 character limit per message and the requirement that the bot holds admin rights on the channel it posts to. ## Create a Bot and Get a Token Everything on Telegram runs through a bot. Open Telegram, search for `@BotFather`, and send `/newbot`. You will be asked for a display name and a username ending in `bot`. BotFather replies with a token, described in Telegram's [bot features documentation](https://core.telegram.org/bots/features) as the credential that identifies your bot, that looks like `123456789:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw`. That token is the entire authentication story. Treat it as a password: anyone holding it can post as your bot, and unlike an OAuth access token it does not expire on its own. Store it in an environment variable, never in client-side code or a public repository. If a token leaks, send `/revoke` to BotFather to invalidate it and issue a new one. To post to a channel, add the bot to that channel and grant it administrator rights with permission to post messages. A bot without admin rights on a channel cannot publish to it, and the API will return a `403` rather than anything more descriptive. The [BotFather setup guide](https://core.telegram.org/bots#how-do-i-create-a-bot) covers the walkthrough in Telegram's own words. ## Find Your Chat ID Every send needs a `chat_id` identifying where the message goes. For a public channel you can use the `@username` form directly, which is by far the simplest option: ``` chat_id: "@yourchannelname" ``` For private channels you need the numeric ID, which is negative and typically starts with `-100`. The quickest way to find it is to post any message in the channel, forward it to `@userinfobot`, and read the ID it returns. Alternatively, call `getUpdates` on your bot after posting in the channel and read `result[].channel_post.chat.id` from the response. If you would rather not manage IDs at all, a [scheduling platform](/social-media-scheduler) resolves the destination for you once the channel is connected. ## Post a Text Message The base URL format is `https://api.telegram.org/bot/METHOD_NAME`, documented in the [Telegram Bot API reference](https://core.telegram.org/bots/api). Posting is a single request: ```bash curl -X POST "https://api.telegram.org/bot$TELEGRAM_TOKEN/sendMessage" \ -H "Content-Type: application/json" \ -d '{ "chat_id": "@yourchannelname", "text": "New post is live. Read it here: https://example.com/post", "parse_mode": "HTML" }' ``` In Node.js: ```js const res = await fetch( `https://api.telegram.org/bot${process.env.TELEGRAM_TOKEN}/sendMessage`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ chat_id: '@yourchannelname', text: 'New post is live.', parse_mode: 'HTML', }), } ) const data = await res.json() if (!data.ok) throw new Error(`Telegram error: ${data.description}`) ``` Always check `data.ok`. Telegram returns HTTP 200 with `ok: false` for several application-level failures, so relying on the status code alone will silently swallow errors. The `description` field explains what went wrong in plain language, which is more than most platform APIs offer. The full parameter list for [sendMessage](https://core.telegram.org/bots/api#sendmessage) covers reply threading, silent notifications and keyboard markup if you need them. > **Publishing to more than Telegram?** One endpoint reaches 11 networks including Telegram, Discord, Instagram, LinkedIn and X. [See the API docs](/developers) or [compare social media APIs](/blog/best-social-media-apis). ## Post an Image or Video Use `sendPhoto` or `sendVideo`. The simplest approach passes a publicly reachable URL and lets Telegram fetch the file: ```bash curl -X POST "https://api.telegram.org/bot$TELEGRAM_TOKEN/sendPhoto" \ -H "Content-Type: application/json" \ -d '{ "chat_id": "@yourchannelname", "photo": "https://example.com/image.jpg", "caption": "Our new feature, explained.", "parse_mode": "HTML" }' ``` You can also upload a local file as `multipart/form-data`, or reuse a `file_id` returned by a previous send. That last option is worth knowing: once a file is on Telegram's servers, re-posting it by `file_id` is instant and avoids re-uploading anything, which is useful for recurring assets like a logo card. For multiple images in one post, use `sendMediaGroup` with an array of media objects. Telegram renders them as an album rather than separate messages. Media handling is one of the more tedious parts of every platform API, which is why our [publishing layer](/social-media-publishing) normalises it. ## Telegram Limits and Media Specs These are the constraints our own publishing layer enforces for Telegram, which is to say the ones that actually cause failures in production: | Constraint | Value | |---|---| | Message character limit | 4,096 | | Image file size | 10 MB | | Image formats | JPG, PNG, WebP, GIF | | Video file size | 50 MB | | Video max duration | 3,600 seconds | | Video formats | MP4, MOV (H.264) | | Max image dimensions | 10000 x 10000 | The 4,096 character limit is generous compared with most networks. For context, X allows 25,000, LinkedIn 3,000, Instagram 2,200, and [Discord just 2,000](/blog/post-to-discord-api), a limit documented in [Discord's webhook reference](https://discord.com/developers/docs/resources/webhook). If you are [cross-posting the same content](/cross-posting) to several networks, Telegram is rarely the one that forces a truncation, but Discord frequently is. Our [multi-account setup](/multi-account-management) applies the right limit per network automatically. Captions on media are limited more tightly than standalone messages, so long copy is better sent as a text message with a link preview than as an image caption. ## Formatting, Links and Previews Telegram supports `HTML` and `MarkdownV2` for `parse_mode`. HTML is generally less painful, because MarkdownV2 requires escaping a long list of reserved characters and will reject the whole message if you miss one. Supported HTML tags, listed in the [Bot API formatting options](https://core.telegram.org/bots/api#formatting-options), include ``, ``, ``, ``, ``, `
`, and ``. Anything else is rejected rather than ignored, so sanitise content that came from a CMS before sending it.

Link previews are generated automatically from the first URL in the message. To suppress one, set `disable_web_page_preview: true`. This matters more than it sounds for [content distribution](/social-media-publishing): an unwanted preview of a tracking URL looks unprofessional, and a wanted preview substantially increases click-through.

## Scheduling and Rate Limits

The Bot API has no native scheduling. There is no `scheduled_time` parameter, so if you want a post to go out at 09:00 next Tuesday you must run something at 09:00 next Tuesday. That means a cron job, a queue, and somewhere to store pending posts, which is most of the work in building a scheduler. Our [scheduling API guide](/blog/social-media-scheduling-api-guide) covers what that infrastructure has to handle.

On rate limits, Telegram does not publish exhaustive figures, but the widely observed and documented guidance is to stay under roughly 30 messages per second overall and around 20 messages per minute to any single group. Bulk sends should be spaced deliberately rather than fired in a tight loop. Handle `429` responses by reading the `retry_after` value in the response and waiting that long before retrying, rather than backing off on a fixed schedule.

Because the token never expires, the failure modes here are different from OAuth platforms. You will not get surprise auth errors mid-campaign. You will get rate limit errors if you fan out too fast, so build the backoff properly the first time. Our guide to [automating posting through an API](/blog/automate-social-media-posting-api) covers retry patterns that apply across platforms.

## When to Use a Publishing API Instead

Direct Bot API access is genuinely fine for Telegram alone. It is free, the auth is trivial, and the endpoints are stable. If Telegram is the only place you publish, build it directly and skip the rest of this section.

The calculation changes as soon as Telegram is one of several destinations. Each additional network brings its own developer app, its own OAuth flow, its own review process, its own media pipeline and its own formatting rules. Meta requires app review. TikTok requires approval. X now meters posting per call. What was an afternoon for Telegram becomes weeks across eleven networks, followed by ongoing maintenance as each platform changes things.

A [unified publishing API](/social-media-api) collapses that into one endpoint and one auth model. The same request that reaches Telegram reaches Instagram, LinkedIn, X, Discord and the rest, with per-platform formatting applied for you. Scheduling is a parameter rather than infrastructure you build and operate.

If your publishing is driven by an assistant rather than a service, our [connectors](/connectors) wire Claude, ChatGPT and Cursor straight into publishing without any integration code, and our [agent framework comparison](/blog/ai-agent-frameworks-for-social-media) covers the build-it-yourself route.

> **Skip eleven integrations.** PostEverywhere handles auth, media, formatting and retries across every network we support. From $9/mo, 7-day trial, card required. [See pricing](/pricing).

## FAQ: Telegram API Posting

### How do I post to a Telegram channel with an API?

Create a bot with BotFather to obtain a token, add that bot to your channel as an administrator with permission to post, then send a POST request to `https://api.telegram.org/bot/sendMessage` including `chat_id` and `text`. For a public channel the `chat_id` can be the `@username` form.

### Is the Telegram Bot API free?

Yes. Telegram does not charge for Bot API access and there is no per-message fee, which makes it one of the cheapest networks to publish to programmatically. Rate limits apply, but there is no billing attached to sending messages.

### Do I need OAuth to post to Telegram?

No. Telegram uses a static bot token rather than OAuth, so there is no authorisation flow, no refresh tokens and no expiry to handle. The token functions as a password, so store it server-side in an environment variable and revoke it through BotFather if it is ever exposed.

### What is the Telegram message character limit?

A single message is limited to 4,096 characters. Media captions are limited more tightly, so long-form copy is better sent as a text message than as a caption on a photo or video.

### Why does my bot get a 403 when posting to a channel?

Almost always because the bot is not an administrator of that channel, or it is an administrator without the post messages permission. Adding the bot to a channel is not sufficient on its own. Check its admin rights in the channel settings.

### Can the Telegram Bot API schedule posts?

No. The Bot API has no scheduling parameter, so publishing at a future time requires your own cron job or queue plus storage for pending posts. A scheduling platform handles this as a parameter instead, which removes the need to run and monitor that infrastructure.

### What is the difference between sendMessage and sendPhoto?

`sendMessage` posts text and generates a link preview from the first URL it contains. `sendPhoto` posts an image with an optional caption. For several images in a single album use `sendMediaGroup`. Files can be supplied as a public URL, a multipart upload, or a `file_id` from a previous send.

### How do I find a private Telegram channel's chat ID?

Post any message in the channel and forward it to `@userinfobot`, which replies with the numeric ID. Alternatively call `getUpdates` on your bot after posting in the channel and read `result[].channel_post.chat.id`. Private channel IDs are negative and usually begin with `-100`.