---
title: "Telegram API"
description: "Use Ayrshare's Telegram API to post text, links, images, and video to channels and groups, then schedule or delete them, through one REST API for 14+ networks."
canonical: https://www.ayrshare.com/telegram-api/
lastModified: 2026-11-05
pageType: landing
---

# Telegram API

> Use Ayrshare's Telegram API to post text, links, images, and video to channels and groups, then schedule or delete them, through one REST API for 14+ networks.

## Telegram API for Posting and Scheduling to Channels and Groups

Ayrshare's Telegram API lets developers publish text, links, images, videos, and animated GIFs to Telegram channels and groups via a single REST endpoint. It supports scheduled posts, link previews, rich text, mentions, deletion, and history across 14+ social networks through one integration.

Your users add @AyrshareBot as an administrator of their channel or group and paste a code from Ayrshare. You don't build, host, or secure a Telegram bot of your own.

[Read the Telegram Docs](/docs/apis/post/social-networks/telegram)
[Get Your API Key](/pricing/)

- **>99.99%** — API uptime
- **30M+** — API calls per day
- **14+** — Social media networks
- **AI-Native** — Native MCP server for any AI agent

## What Do You Need to Use the Telegram API?

You need one API key and a user who adds @AyrshareBot as an administrator of their channel or group. Ayrshare runs the bot, so there is no @BotFather token, no server to host, and no webhook handling before your first message.

After that, Ayrshare keeps the integration running: bot hosting and security, retries on failed sends, Bot API changes, and new Telegram features as they ship.

- **Access**: Your users add @AyrshareBot as an administrator and paste a code from Ayrshare into the chat. The channel is linked within minutes, with no bot of your own to register.
- **Ongoing maintenance**: Telegram updates the Bot API on its own schedule. Ayrshare hosts and secures the bot, handles delivery and retries, and keeps the integration current, so you don't have to.
- **Account types**: Telegram channels and groups. Channel posts show the channel's name and logo as the author, so your users' audiences see their brand, not a bot.
- **Link previews and rich text**: Put a URL in the text and Telegram renders the preview card. Wrap words in HTML tags and Ayrshare converts them to Unicode bold and italics, and @handle mentions another Telegram account.

## Post and Schedule to Telegram Channels and Groups in Your Language

Each sample publishes a text post with a link now, then schedules an image post for later. Same endpoint, same JSON, in Node.js, Python, PHP, Java, Go, Ruby, C#, or plain cURL. Add a Profile-Key header to post to one of your users' channels.

[Full Post API Reference](/docs/apis/post/overview)

- **cURL**
- **Node.js**
- **Python**
- **PHP**
- **Java**
- **Go**
- **Ruby**
- **C#**

## Telegram API Limits: Post Types, Media, and Characters

Telegram's rules in one place. The full list lives in the [Telegram media guidelines](/docs/media-guidelines/telegram) and the [Telegram publishing options](/docs/apis/post/social-networks/telegram).

- **1 media item per post (Post types)**: Text, links, one image, one video, or one animated GIF per post. Post text can be an empty string when the media is the message.
- **Channels and groups (Accounts)**: Telegram channels and groups. Channel posts show the channel's name and logo as the author, and group posts show the Ayrshare name and logo.
- **5 MB per image (Images)**: JPG, PNG, GIF, or WEBP. Width plus height can't exceed 10,000 px, and the aspect ratio can't exceed 20 to 1.
- **20 MB per video (Video)**: One video per post. If the URL doesn't end in a known video extension such as .mp4, set isVideo to true. The same flag sends a GIF whose URL doesn't end in .gif.
- **1,024 characters per post (Characters)**: Longer text is truncated rather than rejected. Bold and italics work through HTML tags that Ayrshare converts to Unicode, and @handle mentions another Telegram account.
- **Admin not just a member (Linking)**: The user adds @AyrshareBot as an administrator, then pastes a code from the Ayrshare dashboard into the chat. The success reply can take up to 5 minutes.
- **First link in the text (Link previews)**: Telegram previews the first link in the text. Attach an image or video and the media shows instead.
- **25 posts per account per day (Scheduling and limits)**: Pass a scheduleDate to publish later. Ayrshare recommends no more than 25 Telegram posts a day per account and allows 300 API calls per 5 minutes per profile.

## What Else Can You Do With the Telegram API?

- **Post a link with a preview card**: Send the text with the URL and no media, and Telegram renders the preview card in the channel or group. Add an image to the same request and the image replaces the preview.
- **Send an animated GIF**: One GIF URL per post. This URL doesn't end in .gif, so the request sets isVideo and Ayrshare sends it as an animation rather than a still image.
- **Format text and mention accounts**: Wrap words in HTML tags and Ayrshare converts them to Unicode bold and italics that Telegram shows as written. Add @handle to mention another Telegram account, and only mention people who want to hear from you.
- **Cancel or remove a message**: Send the Ayrshare post ID to the delete endpoint. A scheduled post is cancelled before it goes out, and a published message disappears from the channel or group.

## Why Use Ayrshare Instead of the Telegram API Directly?

Ayrshare already runs the bot, so your product sends the same /post request it sends to every other network and gets back the message ID and t.me link. Ayrshare handles the linking code, decides whether the link preview or the media shows, converts rich text to Unicode, and keeps each post inside Telegram's limits.

Deleting is one request with the same ID. When Telegram changes the Bot API, the fix ships on our side, not in your sprint.

For the case for a Telegram channel, read [Why Your Business Should Have a Telegram Strategy](/blog/why-your-business-should-have-a-telegram-strategy/).

[See the Telegram Publishing Options](/docs/apis/post/social-networks/telegram)

- **One simple endpoint**: Just send a single POST request with your text, an optional media URL, and the user's Profile-Key. A URL in the text becomes a preview card, and isVideo flags a GIF without a .gif extension. We keep the integration lean so your team can launch faster.
- **We run the bot**: Channel and group linking, hosting and securing @AyrshareBot, rich text conversion, and the 1,024-character cap. None of it reaches your code.
- **Schedule and manage every message**: Get the Telegram message number and t.me link right away. Schedule a post for any date, cancel it before it goes out, or delete a published message with the same Ayrshare ID.

## Beyond Posting: The Rest of the Telegram Lifecycle

The same channel link that publishes also schedules, deletes, lists history, and checks each message before it goes out.

See every network you can reach with the same integration on the [supported networks page](/supported-networks/).

- **Delete posts**: Delete a scheduled Telegram post before it goes out, or a published message after.
  - [Delete post docs](/docs/apis/post/delete-post)
- **History**: List every Telegram post sent through Ayrshare, with its status and schedule, filtered by platform and date.
  - [History API](/history-api/)
- **Pre-publish checks**: Ayrshare enforces the 1,024-character cap and the one-media limit, and applies the 25-posts-a-day recommendation. Telegram posts skip the duplicate-content filter.
  - [Post verification docs](/docs/testing/post-verification)
- **Scheduling**: Schedule a message for any date in ISO 8601 UTC and cancel it any time before it sends. Ayrshare recommends up to 25 Telegram posts a day per account.
  - [Post API reference](/docs/apis/post/overview)

## FAQs About the Telegram API

### Can I post to Telegram through an API?

Yes, you can post to Telegram through an API. Ayrshare's Telegram API lets developers publish text, links, images, videos, and animated GIFs to Telegram channels and groups via a single REST endpoint. It supports scheduled posts, link previews, rich text, mentions, deletion, and history across 14+ social networks through one integration. Start with the [Telegram publishing options](/docs/apis/post/social-networks/telegram).
### Is the Telegram API free?

The Telegram API is free: Telegram charges nothing for the Bot API or for an api_id on the MTProto API. Bots only pay, in Telegram Stars, for broadcasts above about 30 messages per second. The cost of going direct is building, hosting, and securing the bot. Ayrshare's plans include Telegram posting through @AyrshareBot, so there's no bot to run. [Compare Ayrshare plans](/pricing/).
### How do I get access to the Telegram API?

To get access to the Telegram API for posting, message @BotFather, create a bot, and copy its token, then add the bot as an administrator of each channel or group. There's no app review. The MTProto API instead needs an api_id and api_hash from my.telegram.org. With Ayrshare, your users add @AyrshareBot, and the [Post API reference](/docs/apis/post/overview) shows the one request you need.
### How do I post to a Telegram channel with an API?

To post to a Telegram channel with an API, make a bot an administrator of the channel, then send the message through the Bot API. With Ayrshare, your user adds @AyrshareBot as an admin and pastes a code from the dashboard, and your product sends a POST to /post with telegram in platforms. See [how to link a Telegram channel or group](/docs/dashboard/connect-social-accounts/telegram) for the steps.
### What's the difference between the Telegram Bot API and the Telegram API?

The difference between the Telegram Bot API and the Telegram API is who you sign in as. The Bot API is HTTP and JSON for a bot account with a token from @BotFather. The Telegram API is MTProto, Telegram's own protocol, signed in as a real user with an api_id. Channel and group posting only needs the Bot API, which Ayrshare runs for you. Read the [Telegram docs](/docs/apis/post/social-networks/telegram) next.
### Can you schedule Telegram posts with an API?

Yes, you can schedule Telegram posts with an API. Pass a scheduleDate in ISO 8601 UTC and Ayrshare sends the message to the channel or group at that time. A scheduled post can be deleted before it goes out with the same Ayrshare post ID, and Ayrshare recommends staying under 25 Telegram posts a day per account. See the [Post API reference](/docs/apis/post/overview) for every scheduling option.

## Your Users Are on Telegram. Your Product Can Be Too.

Get an API key, link a channel with @AyrshareBot, publish your first message, and turn on the other networks with the same call when you need them.

[Get Your API Key](/pricing/)
[Read the Telegram Docs](/docs/apis/post/social-networks/telegram)
