> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Telegram API

> Options for posting using the Telegram API

## Posting to Telegram

JSON for a basic post with a link and image using the Telegram API:

```json Telegram Post theme={"system"}
{
  "post": "The best Telegram message ever #best https://www.telegram.com", // empty string is allowed
  "mediaUrls": ["https://img.ayrshare.com/012/gb.jpg"],
  "platforms": ["telegram"]
}
```

Telegram will automatically preview the link in the channel or group unless there is an image or video included. In the above example the image will show. Removing the image will cause the link preview to show.

If your video doesn't end in a known video extension such as mp4, please use the `isVideo` parameter. See the [/post endpoint](/apis/post/post) for details.

See [Telegram Media Guidelines](/media-guidelines/telegram) and [Telegram Authorization](/dashboard/connect-social-accounts/telegram) for more information.

## Animated GIFs

Only one URL is allowed with a Telegram animated GIF. If the media URL does not end in ".gif" or ".GIF", set the `isVideo` field to `true`.

```json Telegram Animated GIF theme={"system"}
{
    "randomPost": true,
    "platforms": [
        "telegram"
    ],
    "isVideo": true,    // Set to true if the mediaURL does not end in .gif or .GIF
    "mediaUrls": ["https://img.ayrshare.com/012/cat.gif"]
}
```

## Telegram Mentions

Mention another Telegram handle by adding `@handle` in the post text. For example:

```json Telegram Post with Mention theme={"system"}
{
  "post": "The best Telegram image post ever @handle",
  "platforms": ["telegram"]
}
```

<Warning>
  Please review the [important rules](/testing/post-verification#mentions) on mentions.
</Warning>

## Character Limits

Please see [Telegram Character Limits](/help-center/technical-support/character_limits#telegram-character-limits) for more information.
