> For the complete documentation index, see [llms.txt](https://agpt.co/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agpt.co/docs/integrations/block-integrations/post_to_telegram.md).

# Ayrshare Post To Telegram

Blocks for posting messages to Telegram channels using the Ayrshare social media management API.

## Post To Telegram

### What it is

Post to Telegram using Ayrshare

### How it works

This block uses Ayrshare's API to publish messages to Telegram channels. It supports text messages, images, videos, and animated GIFs, with automatic link preview generation unless media is included.

The block authenticates through Ayrshare and sends content to your connected Telegram channel or bot. User mentions are supported via @handle syntax, and content can be scheduled for future delivery.

### Inputs

| Input              | Description                                                                                                                               | Type            | Required |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | --------------- | -------- |
| post               | The post text (empty string allowed). Use @handle to mention other Telegram users.                                                        | str             | No       |
| media\_urls        | Optional list of media URLs. For animated GIFs, only one URL is allowed. Telegram will auto-preview links unless image/video is included. | List\[str]      | No       |
| is\_video          | Whether the media is a video. Set to true for animated GIFs that don't end in .gif/.GIF extension.                                        | bool            | No       |
| schedule\_date     | UTC datetime for scheduling (YYYY-MM-DDThh:mm:ssZ)                                                                                        | str (date-time) | No       |
| disable\_comments  | Whether to disable comments                                                                                                               | bool            | No       |
| shorten\_links     | Whether to shorten links                                                                                                                  | bool            | No       |
| unsplash           | Unsplash image configuration                                                                                                              | str             | No       |
| requires\_approval | Whether to enable approval workflow                                                                                                       | bool            | No       |
| random\_post       | Whether to generate random post text                                                                                                      | bool            | No       |
| random\_media\_url | Whether to generate random media                                                                                                          | bool            | No       |
| notes              | Additional notes for the post                                                                                                             | str             | No       |

### Outputs

| Output       | Description                           | Type         |
| ------------ | ------------------------------------- | ------------ |
| error        | Error message if the operation failed | str          |
| post\_result | The result of the post                | PostResponse |
| post         | The result of the post                | PostIds      |

### Possible use case

**Channel Broadcasting**: Automatically distribute announcements, updates, or news to Telegram channel subscribers.

**Alert Systems**: Send automated notifications with media attachments to monitoring or alert channels.

**Content Syndication**: Cross-post content from other platforms to Telegram communities for broader reach.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://agpt.co/docs/integrations/block-integrations/post_to_telegram.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
