CONNECT APP
Build with Telegram
Telegram, is a cloud-based, cross-platform, encrypted instant messaging (IM) service.
Communication
- API key
MCP
Give your agent Telegram tools
Every Telegram action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Telegram account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "telegram_bot_api",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Create Chat Invite Link:
const result = await mcp.callTool({
name: "telegram_bot_api-create-chat-invite-link",
arguments: {
chatId: "Chat ID",
name: "Invite link name",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "telegram_bot_api",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Create Chat Invite Link:
result = await session.call_tool("telegram_bot_api-create-chat-invite-link", {
"chatId": "Chat ID",
"name": "Invite link name",
})SDK
Run Telegram actions from your backend
Connect a user's Telegram account once, then run Create Chat Invite Link on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "telegram_bot_api-create-chat-invite-link",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
telegram_bot_api: { authProvisionId: "apn_xxxxxxx" },
chatId: "Chat ID",
name: "Invite link name",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="telegram_bot_api-create-chat-invite-link",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"telegram_bot_api": {"authProvisionId": "apn_xxxxxxx"},
"chatId": "Chat ID",
"name": "Invite link name",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "telegram_bot_api-create-chat-invite-link",
"configured_props": {
"telegram_bot_api": { "authProvisionId": "apn_xxxxxxx" },
"chatId": "Chat ID",
"name": "Invite link name"
}
}'TOOLS
Telegram actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Create Chat Invite Link
actionCreate an additional invite link for a chat, See the docs for more informationWritev0.0.8 -
Delete a Message
actionDeletes a message. See the docs for more informationWritev0.0.8 -
Download Voice Message
actionDownloads a Telegram voice message to the/tmpdirectory using itsfile_id. Use this after receiving a voice message update to persist the audio locally. See the documentationWritev0.0.3 -
Edit a Media Message
actionEdits photo or video messages. See the docs for more informationWritev0.0.9 -
Edit a Text Message
actionEdits text or game messages. See the docs for more informationWritev0.0.8 -
Export Chat Invite Link
actionGenerate a new primary invite link for a chat, See the docs for more informationWritev0.0.8 -
Forward a Message
actionForwards messages of any kind. See the docs for more informationWritev0.0.8 -
Get the Number of Members in a Chat
actionUse this module to get the number of members in a chat. See the docs for more informationRead-onlyv0.0.8 -
Kick a Chat Member
actionUse this method to kick a user from a group, a supergroup or channel. See the docs for more informationWritev0.0.8 -
List Administrators In Chat
actionUse this module to get a list of administrators in a chat. See the docs for more informationRead-onlyv0.0.8 -
List Chats
actionList available Telegram chats. See the docs for more informationRead-onlyv0.0.8 -
List Commands Options
actionRetrieves available options for the Commands field.Read-onlyv0.0.3 -
List Updates
actionRetrieves a list of updates from the Telegram server. See the docs for more informationRead-onlyv0.0.8 -
Pin a Message
actionPins a message. See the docs for more informationWritev0.0.8 -
Promote a Chat Member
actionUse this method to promote or demote a user in a supergroup or a channel. See the docs for more informationWritev0.0.8 -
Restrict a Chat Member
actionUse this method to restrict a user in a supergroup. See the docs for more informationWritev0.0.8 -
Send a Document/Image
actionSends a document or an image to your Telegram Desktop application. See the docs for more informationWritev0.0.9 -
Send a Photo
actionSends a photo to your Telegram Desktop application. See the docs for more informationWritev0.0.9 -
Send a Sticker
actionSends a .webp sticker to you Telegram Desktop application. See the docs for more informationWritev0.0.8 -
Send a Text Message or Reply
actionSends a text message or a reply to your Telegram Desktop application. See the docs for more informationWritev0.0.8 -
Send a Video
actionSends a video file to your Telegram Desktop application. See the docs for more informationWritev0.0.9 -
Send a Video Note
actionAs of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. See the docs for more informationWritev0.0.9 -
Send a Voice Message
actionSends a voice message. See the docs for more informationWritev0.0.9 -
Send an Album (Media Group)
actionSends a group of photos or videos as an album. See the docs for more informationWritev0.0.9 -
Send an Audio File
actionSends an audio file to your Telegram Desktop application. See the docs for more informationWritev0.0.9 -
Send Media by URL or ID
actionSends a file (document, photo, video, audio, ...) by HTTP URL or by ID that exists on the Telegram servers. See the docs for more informationWritev0.0.9 -
Set Chat Permissions
actionSet default chat permissions for all members. See the docs for more informationWritev0.0.8 -
Unpin a Message
actionUnpins a message. See the docs for more informationWritev0.0.8
EVENTS
Telegram triggers
Event sources your backend can deploy for users and receive through a webhook.
-
New Bot Command Received (Instant)
triggerEmit new event each time a Telegram Bot command is received.Instantv0.0.8 -
New Channel Updates (Instant)
triggerEmit new event each time a channel post is created or updated.Instantv0.1.8 -
New Message Updates (Instant)
triggerEmit new event each time a Telegram message is created or updated.Instantv0.1.9 -
New Updates (Instant)
triggerEmit new event for each new Telegram event.Instantv0.1.8
MULTI-APP
Use Telegram with other popular apps
Most products don't stop at one integration. Pair Telegram with the other apps your users rely on, and ship use cases that span both.
- App slug
- telegram_bot_api
- Authentication
- API key
- Categories
- Communication
- Actions
- 28
- Triggers
- 4
- API proxy
- Not available