# Telegram — Pipedream Connect

> Telegram, is a cloud-based, cross-platform, encrypted instant messaging (IM) service.

- API slug: `telegram_bot_api` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Communication
- Website: https://telegram.org
- This page (HTML): https://pipedream.com/apps/telegram-bot-api
- Tools: 28 actions · 4 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: telegram_bot_api`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
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 accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_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",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## SDK

```ts
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",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (28)

### `telegram_bot_api-create-chat-invite-link` — Create Chat Invite Link (Write)

Create an additional invite link for a chat, See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/create-chat-invite-link.md

### `telegram_bot_api-delete-message` — Delete a Message (Write)

Deletes a message. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/delete-message.md

### `telegram_bot_api-download-voice-message` — Download Voice Message (Write)

Downloads a Telegram voice message to the /tmp directory using its file_id. Use this after receiving a voice message update to persist the audio locally. See the documentation

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/download-voice-message.md

### `telegram_bot_api-edit-media-message` — Edit a Media Message (Write)

Edits photo or video messages. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/edit-media-message.md

### `telegram_bot_api-edit-text-message` — Edit a Text Message (Write)

Edits text or game messages. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/edit-text-message.md

### `telegram_bot_api-export-chat-invite-link` — Export Chat Invite Link (Write)

Generate a new primary invite link for a chat, See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/export-chat-invite-link.md

### `telegram_bot_api-forward-message` — Forward a Message (Write)

Forwards messages of any kind. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/forward-message.md

### `telegram_bot_api-get-num-members-in-chat` — Get the Number of Members in a Chat (Read-only)

Use this module to get the number of members in a chat. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/get-num-members-in-chat.md

### `telegram_bot_api-kick-chat-member` — Kick a Chat Member (Write)

Use this method to kick a user from a group, a supergroup or channel. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/kick-chat-member.md

### `telegram_bot_api-list-administrators-in-chat` — List Administrators In Chat (Read-only)

Use this module to get a list of administrators in a chat. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/list-administrators-in-chat.md

### `telegram_bot_api-list-chats` — List Chats (Read-only)

List available Telegram chats. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/list-chats.md

### `telegram_bot_api-list-commands-options` — List Commands Options (Read-only)

Retrieves available options for the Commands field.

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/list-commands-options.md

### `telegram_bot_api-list-updates` — List Updates (Read-only)

Retrieves a list of updates from the Telegram server. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/list-updates.md

### `telegram_bot_api-pin-message` — Pin a Message (Write)

Pins a message. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/pin-message.md

### `telegram_bot_api-promote-chat-member` — Promote a Chat Member (Write)

Use this method to promote or demote a user in a supergroup or a channel. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/promote-chat-member.md

### `telegram_bot_api-restrict-chat-member` — Restrict a Chat Member (Write)

Use this method to restrict a user in a supergroup. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/restrict-chat-member.md

### `telegram_bot_api-send-document-or-image` — Send a Document/Image (Write)

Sends a document or an image to your Telegram Desktop application. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/send-document-or-image.md

### `telegram_bot_api-send-photo` — Send a Photo (Write)

Sends a photo to your Telegram Desktop application. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/send-photo.md

### `telegram_bot_api-send-sticker` — Send a Sticker (Write)

Sends a .webp sticker to you Telegram Desktop application. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/send-sticker.md

### `telegram_bot_api-send-text-message-or-reply` — Send a Text Message or Reply (Write)

Sends a text message or a reply to your Telegram Desktop application. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/send-text-message-or-reply.md

### `telegram_bot_api-send-video` — Send a Video (Write)

Sends a video file to your Telegram Desktop application. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/send-video.md

### `telegram_bot_api-send-video-note` — Send a Video Note (Write)

As 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 information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/send-video-note.md

### `telegram_bot_api-send-voice-message` — Send a Voice Message (Write)

Sends a voice message. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/send-voice-message.md

### `telegram_bot_api-send-album` — Send an Album (Media Group) (Write)

Sends a group of photos or videos as an album. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/send-album.md

### `telegram_bot_api-send-audio-file` — Send an Audio File (Write)

Sends an audio file to your Telegram Desktop application. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/send-audio-file.md

### `telegram_bot_api-send-media-by-url-or-id` — Send Media by URL or ID (Write)

Sends a file (document, photo, video, audio, ...) by HTTP URL or by ID that exists on the Telegram servers. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/send-media-by-url-or-id.md

### `telegram_bot_api-set-chat-permissions` — Set Chat Permissions (Write)

Set default chat permissions for all members. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/set-chat-permissions.md

### `telegram_bot_api-unpin-message` — Unpin a Message (Write)

Unpins a message. See the docs for more information

Full schema: https://pipedream.com/apps/telegram-bot-api/actions/unpin-message.md

## Triggers (4)

### `telegram_bot_api-new-bot-command-received` — New Bot Command Received (Instant) (Instant)

Emit new event each time a Telegram Bot command is received.

Full schema: https://pipedream.com/apps/telegram-bot-api/triggers/new-bot-command-received.md

### `telegram_bot_api-channel-updates` — New Channel Updates (Instant) (Instant)

Emit new event each time a channel post is created or updated.

Full schema: https://pipedream.com/apps/telegram-bot-api/triggers/channel-updates.md

### `telegram_bot_api-message-updates` — New Message Updates (Instant) (Instant)

Emit new event each time a Telegram message is created or updated.

Full schema: https://pipedream.com/apps/telegram-bot-api/triggers/message-updates.md

### `telegram_bot_api-new-updates` — New Updates (Instant) (Instant)

Emit new event for each new Telegram event.

Full schema: https://pipedream.com/apps/telegram-bot-api/triggers/new-updates.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
