EN
Developer guide

Telegram Group API: Groups, Channels and Folders From a User Account

No bot to get added, no privacy mode. Search, join and manage Telegram groups, channels and shared folders from your users' own Telegram accounts, with one REST API.

Your App · Telegram groups User account
DBDeFi BuildersShared folder · 6 chatsjoined
ASAcme SupportSupergroup · you are admin3 join requests
AN@acme_newsChannel · discussion group linkedadmin
PBProduct Beta TestersPrivate group · joined by +invite linkpending
POSTsearch/groups POSTgroups/{id}/join 200 OK
Short answer

Telegram has two ways to work with groups: the Bot API, where a bot must be added to each group, and the Telegram API (MTProto), where a real user account acts. Unipile connects your user's own Telegram account. Your app then searches and joins public groups, channels, private invite links and shared folders, creates groups, and manages members, admins, join requests and invite links.

New to Telegram integrations? Start with how to get the Telegram API.

With Unipile

Work with Telegram groups in three steps

  1. Connect the accountYour user links their own Telegram account through Hosted Auth by scanning a QR code. No bot to add as an admin in each group.

  2. Find and join a groupSend POST /v2/{account_id}/search/groups with keywords, then POST /v2/{account_id}/groups/{group_id}/join.

  3. Create a group and add membersCall POST /v2/{account_id}/groups, then POST /v2/{account_id}/groups/{group_id}/participants.

Decision

Bot API or User Account: Which Telegram Group API Do You Need?

If your product needs to act as a person, inside the groups and channels that person already belongs to, you need a user account. A bot is the right tool for commands and notifications.

CriteriaTelegram Bot APIUser account (Unipile)
Who actsA bot created with BotFatherYour user's own Telegram account
Getting into a groupAn admin has to add the botJoins by @username, chat ID, + invite link or shared folder
Reading group messagesPrivacy mode limits what the bot receivesEvery message the user sees in the app
Search public groups and channelsNoYes, POST /search/groups
Shared foldersNoJoin, list and leave
Members, admins, join requestsNeeds admin rights in the groupThe user's own rights in each group
Best forCommands, notifications, public botsProducts acting for a real person: inbox, CRM, community tools
Who acts
Telegram Bot APIA bot created with BotFather
User account (Unipile)Your user's own Telegram account
Getting into a group
Telegram Bot APIAn admin has to add the bot
User account (Unipile)Joins by @username, chat ID, + invite link or shared folder
Reading group messages
Telegram Bot APIPrivacy mode limits what the bot receives
User account (Unipile)Every message the user sees in the app
Search public groups and channels
Telegram Bot APINo
User account (Unipile)Yes, POST /search/groups
Shared folders
Telegram Bot APINo
User account (Unipile)Join, list and leave
Members, admins, join requests
Telegram Bot APINeeds admin rights in the group
User account (Unipile)The user's own rights in each group
Best for
Telegram Bot APICommands, notifications, public bots
User account (Unipile)Products acting for a real person: inbox, CRM, community tools

The full comparison of both APIs is in Telegram Bot API vs Telegram API. Unipile never acts as a bot: every call runs as the connected user.

Use cases

What Teams Build on Telegram Groups and Channels

Telegram is where crypto projects, product communities and customers gather. These four products work inside those chats through their users' own accounts.

Research feed · DeFi Builders folder6 chats
"Mainnet upgrade scheduled for Thursday"@rollup_dev · 3 min agoTracked
"New audit report is out, link inside"Protocol Security Hub · 25 min agoNew
"Community call notes, week 47"DAO Governance Chat · 1 h agoNew

Crypto and community research

An analyst pastes a shared folder link. The tool joins every chat of the folder at once, then shows new messages from the channels its user chose to follow.

One link, a whole watchlist of channels.

TelegramAcme CustomersSupergroup · join approval on · Admin
LBLea BrunCustomer since 2024 · CRM matchAcceptRefuse
MOMarc OlsenNo account foundAcceptRefuse
ALAna LopesCustomer since 2025 · CRM matchAcceptRefuse

Customer support groups

A support team runs a private supergroup for customers. Join requests land in the helpdesk, next to the customer record, and an agent accepts or refuses them.

Only real customers get into the group.

CRM · Contact
NKNina KovacHead of Partnerships, Orbit Labs

Member of Web3 Founders BerlinGroup managed by your account

Member of Orbit x Acme PartnersPrivate supergroup · admin since March

CRM context

A CRM lists the members of the groups its user manages and matches them with contacts, so a rep sees which Telegram communities a lead is part of.

Context before the first message.

Creator studio · @acme_news
JDJade DuboisDiscussion group moderatoradmin
TKTom KellerActive memberpromote
IMInes MartinJoined this weekmember
t.me/+hKSYmzBl4whiOTI8reset

Creators and channel teams

A creator tool links a channel to its discussion group, promotes trusted members to admin and resets the invite link when it leaks.

Channel and community run from one screen.

Step 1

Find and Join Telegram Groups and Channels

Search public groups and channels by keyword, preview a private one from its invite link, then join. The Groups API accepts four ways to name a group.

  • Search. POST /search/groups with keywords returns public groups and channels with the account's own. Filter with is_member or is_public.
  • One page. Results come in a single page: raise limit, as a cursor gets a 400.
  • Preview. GET /groups/{group_id} with an invite link shows a private group's name, description and member count before joining.
  • Join. POST /groups/{group_id}/join returns the chat ID in group_id. A group that approves its members answers pending. A basic (small) group is joined with its invite link only.
TelegramFour ways to name a group
-1001005640892Chat ID of a group or channel the account sees.
@telegramPublic username of a group or channel.
+hKSYmzBl4whiOTI8Private invite link: preview it, then join.
folder_3Shared folder, or its URL-encoded t.me/addlist link.
const BASE = `https://api.unipile.com/v2/${ACCOUNT_ID}`;
const headers = { "X-API-KEY": process.env.UNIPILE_API_KEY, "content-type": "application/json" };

// 1. Search public groups and channels (one page: raise limit)
const res = await fetch(`${BASE}/search/groups?limit=20`, {
  method: "POST", headers,
  body: JSON.stringify({ keywords: "defi research", is_public: true })
});
const { data } = await res.json();

// 2. Join by @username, chat ID or +invite link
const join = await fetch(`${BASE}/groups/@telegram/join`, { method: "POST", headers });
const { group_id } = await join.json();   // the chat ID, e.g. -100...
import os, requests

BASE = f"https://api.unipile.com/v2/{ACCOUNT_ID}"
headers = {"X-API-KEY": os.environ["UNIPILE_API_KEY"]}

# 1. Search public groups and channels (one page: raise limit)
groups = requests.post(f"{BASE}/search/groups", headers=headers, params={"limit": 20},
                       json={"keywords": "defi research", "is_public": True}).json()["data"]

# 2. Join by @username, chat ID or +invite link
joined = requests.post(f"{BASE}/groups/@telegram/join", headers=headers).json()
group_id = joined["group_id"]   # the chat ID, e.g. -100...
# 1. Search public groups and channels
curl --request POST \
  --url "https://api.unipile.com/v2/{ACCOUNT_ID}/search/groups?limit=20" \
  --header "X-API-KEY: {YOUR_API_KEY}" \
  --header "content-type: application/json" \
  --data '{ "keywords": "defi research", "is_public": true }'

# 2. Join a public group or channel
curl --request POST \
  --url "https://api.unipile.com/v2/{ACCOUNT_ID}/groups/@telegram/join" \
  --header "X-API-KEY: {YOUR_API_KEY}"
→ joined, group_id: -1001005640892
Step 2

Read and Send Messages in Groups and Channels

A Telegram group or channel is also a chat of the Messaging API, with the same ID. Once the account has joined, its messages are read and sent like any other Telegram conversation.

group-messages.sh
# Same ID in the Groups API and the Messaging API
curl --request GET \
  --url "https://api.unipile.com/v2/{ACCOUNT_ID}/chats/-1001005640892/messages" \
  --header "X-API-KEY: {YOUR_API_KEY}"

# Send a message in the group
curl --request POST \
  --url "https://api.unipile.com/v2/{ACCOUNT_ID}/chats/-1001005640892/messages/send" \
  --header "X-API-KEY: {YOUR_API_KEY}" \
  --header "content-type: application/json" \
  --data '{ "text": "Welcome to the beta group!" }'
→ one chat ID for both APIs
  • Read. List the messages of the chat with its -100 ID, and receive new ones with the Messaging API webhooks.
  • Send. A supergroup is a group chat where members write. A channel stays read-only for users who cannot post in it.
  • Everything else in a chat (attachments, reactions, replies) works as in a private Telegram conversation.

Code for every message type is in our Telegram API send message guide.

No group posts on Telegram

GET and POST /groups/{group_id}/posts answer 501 for Telegram, because group messages are chats, not posts. Use the Messaging API for them.

Step 3

Create and Configure a Telegram Group

POST /groups creates a private supergroup owned by the connected account. PATCH /groups/{group_id} then renames it, changes its description or turns on join approval.

POST

Create

A name of 1 to 128 characters and an optional description of at most 255. The group is private: is_public gets a 400.

PATCH

Rename and describe

Send name or description. An empty description removes it.

PATCH

Join approval

join_approval: true makes admins approve each person who asks to join.

// 1. Create a private supergroup owned by the account
const created = await (await fetch(`${BASE}/groups`, {
  method: "POST", headers,
  body: JSON.stringify({ name: "Acme Beta Testers", description: "Early access feedback" })
})).json();

// 2. Make admins approve the people who ask to join
await fetch(`${BASE}/groups/${created.id}`, {
  method: "PATCH", headers,
  body: JSON.stringify({ join_approval: true })
});
# 1. Create a private supergroup owned by the account
created = requests.post(f"{BASE}/groups", headers=headers,
                        json={"name": "Acme Beta Testers", "description": "Early access feedback"}).json()

# 2. Make admins approve the people who ask to join
requests.patch(f"{BASE}/groups/{created['id']}", headers=headers,
               json={"join_approval": True})
# 1. Create a private supergroup
curl --request POST \
  --url "https://api.unipile.com/v2/{ACCOUNT_ID}/groups" \
  --header "X-API-KEY: {YOUR_API_KEY}" \
  --header "content-type: application/json" \
  --data '{ "name": "Acme Beta Testers", "description": "Early access feedback" }'

# 2. Turn on join approval
curl --request PATCH \
  --url "https://api.unipile.com/v2/{ACCOUNT_ID}/groups/{GROUP_ID}" \
  --header "X-API-KEY: {YOUR_API_KEY}" \
  --header "content-type: application/json" \
  --data '{ "join_approval": true }'
→ supergroup created, join approval on

Not supported: making a group public, deleting a group, creating a channel or a shared folder, and changing a group's picture or permissions.

User account, not a bot

Build Telegram group features this week

Connect a Telegram account with Hosted Auth, then search, join and manage groups and channels through the same REST API as your messages.

Build Now
Step 4

Members, Admins and Join Requests

In the groups and channels the account administers, the Groups API handles what an admin does in the Telegram app: members, admin rights, join requests and the invite link.

All paths under https://api.unipile.com/v2/{account_id}
GET/groups/{group_id}/participantsMembers, paged with cursor. Only admins list a channel's members.
POST/groups/{group_id}/participantsAdd a member by user ID, @username or phone number.
PATCH/groups/{group_id}/participants/{user_id}is_admin: true or false to promote or demote.
DELETE/groups/{group_id}/participants/{user_id}Remove a member.
GET/groups/{group_id}/join-requestsPending join requests, up to 100.
POST/groups/{group_id}/join-requests/{request_id}/acceptAccept a request. /cancel refuses it.
GET/groups/{group_id}/invite-linkRead the invite link. POST .../invite-link/reset replaces it.
Telegramgroups/{id}/join-requests
SRSara RuizRequested 2 h agoAcceptRefuse
PNPriya NairRequested yesterdayAcceptRefuse
GETpending requests200 OK
  • Privacy settings win. When a person's settings forbid being added, Telegram answers 403: send them the invite link instead.
  • Admin rights. is_admin: true gives the rights Telegram grants new admins by default.
  • Invite codes keep their +, which tells them apart from a username.
Step 5

Shared Folders and Discussion Groups

Telegram has two kinds of chats that belong to another: the chats of a shared folder, and the discussion group of a channel. The Groups API reads both as subgroups.

Telegramfolder_3 · subgroups
RD@rollup_devChanneljoined
PSProtocol Security HubChanneljoined
DGDAO Governance ChatSupergroupjoined
LPLiquidity Providers LoungeSupergroupjoined
POSTgroups/{addlist link}/join200 OK
  • Join a folder. Send its URL-encoded https://t.me/addlist/... link as group_id: the account joins all the chats of the folder at once.
  • List and leave. The folder then becomes the group folder_<id>. GET /groups/folder_3/subgroups lists its chats, POST /groups/folder_3/leave leaves the folder and its chats.
  • Discussion group. A channel's subgroup is its discussion group. POST /groups/{channel_id}/subgroups with chat_id links an existing group, DELETE unlinks it.
  • Forum topics are not chats and are not exposed.
shared-folder.sh
# Join every chat of a shared folder (URL-encoded t.me/addlist link)
curl --request POST \
  --url "https://api.unipile.com/v2/{ACCOUNT_ID}/groups/https%3A%2F%2Ft.me%2Faddlist%2F{SLUG}/join" \
  --header "X-API-KEY: {YOUR_API_KEY}"

# List the chats of the folder
curl --request GET \
  --url "https://api.unipile.com/v2/{ACCOUNT_ID}/groups/folder_3/subgroups" \
  --header "X-API-KEY: {YOUR_API_KEY}"
→ folder joined, chats listed
Same API

One Groups API for Telegram, WhatsApp, Facebook and LinkedIn

The routes you call for Telegram work for the other networks your users connect. Only what each network allows changes.

NetworkWhat /groups coversGroup posts
Groups, channels and shared foldersMessages are chats, no posts
Communities: create, members, subgroups, invite linksMessages are chats, no posts
Groups: search, join, members, postsYes, read and publish
Groups: search, join, members, postsYes, read and publish
What /groups coversGroups, channels and shared folders
Group postsMessages are chats, no posts
What /groups coversCommunities: create, members, subgroups, invite links
Group postsMessages are chats, no posts
What /groups coversGroups: search, join, members, posts
Group postsYes, read and publish
What /groups coversGroups: search, join, members, posts
Group postsYes, read and publish

See our WhatsApp Group API guide for communities, and the Facebook Groups API guide for reading and posting in groups.

Manage Telegram groups from your app

Connect your users' Telegram accounts, join the groups, channels and folders they need, and manage members and join requests with one REST API. Chats, messages and webhooks come with the Unipile Telegram API.

The complete Telegram API guide

Groups are one part of the picture. Account connection, chats and messages are covered in how to get the Telegram API, step by step.

Telegram Group API FAQ

Quick answers on group IDs, creating groups, adding members and searching groups and channels.

A Telegram group or channel ID looks like -1001005640892. With Unipile, POST /v2/{account_id}/search/groups returns the IDs of public groups and channels and of the account's own. Joining by @username or invite link also returns the chat ID in group_id. The same ID works as the chat ID in the Messaging API.

Yes, from a user account. POST /v2/{account_id}/groups with a name of 1 to 128 characters and an optional description creates a private supergroup owned by the connected account. You can then rename it, describe it or turn on join approval with PATCH /groups/{group_id}.

Call POST /v2/{account_id}/groups/{group_id}/participants with a user_id: a user ID, a @username or a phone number. If the person's privacy settings forbid it, Telegram answers 403. Send them the group's invite link instead, read with GET /groups/{group_id}/invite-link.

Yes. POST /v2/{account_id}/search/groups with keywords searches public groups and channels together with the account's own. Filter with is_member or is_public. Results come in one page: raise limit to get more.

Still have questions? Our team is here to help.

Talk to an expert