Telegram
API actions for the Telegram integration.
Telegram
Send Telegram messages, manage chat pins, and generate invite links.
Create an invite link
Generate a new join link for a chat.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | string | Yes | The chat to create an invite link for. |
name | string | No | Optional label to help you recognize this link. |
expire_date | number | No | Optional. When the link should expire, as a Unix timestamp in seconds (for example, 1706745600). Leave blank for a link that never expires. |
member_limit | number | No | Optional. The maximum number of people who can join using this link. |
Response
{
"expire_date": 1706745600,
"invite_link": "https://t.me/+abcdef123456",
"member_limit": 100,
"status": "success"
}Forward a message
Forward a message from one chat to another.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | string | Yes | The chat to forward the message to. |
from_chat_id | string | Yes | The chat that currently has the message. |
message_id | number | Yes | The ID of the message to forward. |
Response
{
"chat_id": 123456789,
"message_id": 12347,
"status": "success"
}Get chat member count
Retrieve the number of members in a chat.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | string | Yes | The chat to count members in. |
Response
{
"count": 147,
"status": "success"
}Pin a chat message
Pin a message in a chat with optional silent notification.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | string | Yes | The chat that has the message. |
message_id | number | Yes | The ID of the message to pin. |
disable_notification | boolean | No | Set to true to pin the message without notifying members. |
Response
{
"status": "success"
}Send a message
Send a text message to a Telegram chat.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | string | Yes | Which chat to send to, given as its numeric chat ID or @username. |
text | string | Yes | The text of the message to send. |
parse_mode | string | No | Optional. How to format the message text: HTML, Markdown, or MarkdownV2. Leave blank for plain text. |
Response
{
"chat_id": 987654321,
"message_id": 12345,
"status": "success"
}Send a photo
Send a photo to a Telegram chat, with an optional caption.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | string | Yes | Which chat to send to, given as its numeric chat ID or @username. |
photo_url | string | Yes | A link to the photo you want to send. |
caption | string | No | Optional caption to show below the photo. |
Response
{
"chat_id": 987654321,
"message_id": 12346,
"status": "success"
}