Combot API
The Combot API allows you to programmatically access analytics, member data, and moderation features for your Telegram groups. It follows conventions similar to the Telegram Bot API.
All API requests are made to:
https://api.combot.org/v5/<methodName>?api_key=<key>&chat_id=<id>
Responses are JSON objects. Every response contains an ok boolean field.
On success, the result is in the result field. On failure, ok is false
and a description field explains what went wrong.
Authentication
All API methods require an api_key parameter. You can generate your API key in
Settings on the Combot website. The key is tied to your Telegram account
and grants access to all groups where you are an administrator.
Making Requests
All methods accept both GET and POST requests.
Parameters can be passed as query strings or form-encoded body.
All responses are application/json.
Example:
curl "https://api.combot.org/v5/getChatAnalytics?api_key=YOUR_KEY&chat_id=-1001234567890"
Common Parameters
| Parameter | Type | Description |
|---|---|---|
api_key |
String | Required. Your API authentication key. |
chat_id |
Integer | Required. Telegram chat ID (negative for groups, e.g. -1001234567890). |
from |
Integer | Optional. Start of time range in milliseconds since Unix epoch. Defaults to 7 days ago. |
to |
Integer | Optional. End of time range in milliseconds since Unix epoch. Defaults to now. |
Pagination
Endpoints that return lists support pagination with page and limit
parameters. Pages are 0-indexed.
| Parameter | Type | Description |
|---|---|---|
page |
Integer | Optional. Page number, starting from 0. Default: 0. |
limit |
Integer | Optional. Number of records per page. Default varies by endpoint (usually 25). Max varies (usually 500). |
Paginated responses include metadata:
{
"ok": true,
"total": 1250,
"total_pages": 50,
"has_next": true,
"has_prev": false,
"data": [...]
}
Error Handling
The response contains a JSON object which always has a Boolean field ok. If ok equals true, the request was successful and the result of the query can be found in the result field. In case of an unsuccessful request, ok equals false and the error may be explained in the description field. An error_code field may also be returned.
{
"ok": false,
"error_code": 404,
"description": "Chat not found"
}
| Field | Type | Description |
|---|---|---|
ok | Boolean | Always present. false for errors. |
error_code | Integer | HTTP-style error code (400, 401, 402, 403, 404, 500, 502, 504). |
description | String | Optional. Human-readable explanation of the error. |
MCP Server
The Combot API is also available as an MCP (Model Context Protocol) server. This lets AI assistants like Claude interact with your Telegram group data directly — query analytics, manage members, view leaderboards, and perform moderation actions through natural language.
Quick Start
Claude Code
Run this command in your terminal:
claude mcp add combot --transport http https://mcp.combot.org/mcp --header "Authorization: Bearer YOUR_COMBOT_API_KEY"
Cursor
Add the following to your .cursor/mcp.json:
{
"mcpServers": {
"combot": {
"type": "http",
"url": "https://mcp.combot.org/mcp",
"headers": {
"Authorization": "Bearer YOUR_COMBOT_API_KEY"
}
}
}
}
Other MCP clients
For clients that don't support HTTP transport natively (e.g. Claude Desktop), use the mcp-remote proxy:
{
"mcpServers": {
"combot": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-remote", "https://mcp.combot.org/mcp"],
"env": {
"API_KEY": "YOUR_COMBOT_API_KEY"
}
}
}
}
Authentication
The MCP server uses the same API key as the REST API. Generate your key in
Settings. Pass it via the API_KEY environment variable
or the Authorization: Bearer <key> header, depending on your MCP client.
Available Tools
The MCP server exposes the following tools, corresponding to the API endpoints documented below:
| Tool | Description |
|---|---|
get_chats | List groups where you are an admin |
get_chat_analytics | Message counts, active users, hourly heatmap |
get_journal | Moderation action log (bans, mutes, warnings) |
get_chat_users | Paginated member list with activity data |
get_chat_member | Detailed info about a single member |
set_chat_member_data | Set XP, reputation, or warnings for a member |
get_referrals | Referral data for a chat |
get_invite_links | List invite links with usage stats |
get_invite_link_details | Join data for a specific invite link |
restrict_member | Restrict a member's permissions (Pro) |
ban_member | Kick or permanently ban a member (Pro) |
unban_member | Unban a previously banned member (Pro) |
get_xp_leaderboard | XP leaderboard |
get_rep_leaderboard | Reputation leaderboard |
get_users_leaderboard | Message count leaderboard |
Groups
getChats
Returns all groups that the authenticated user can manage. If chat_id is provided,
returns only the matching group.
/v5/getChats
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | No | Telegram chat ID. If provided, returns only the specified group. |
Returns an array of groups:
{
"ok": true,
"groups": [
{
"id": -1001234567890,
"title": "My Group",
"username": "mygroup",
"subs": 1234,
"cs": { ... },
"mod": { ... },
"admins": [
{
"user_id": 12345678,
"name": "Alice",
"username": "alice",
"type": "telegram",
"is_creator": true,
"can_be_edited": false,
"tg_rights": {
"can_manage_chat": true,
"can_delete_messages": true,
"can_manage_video_chats": true,
"can_restrict_members": true,
"can_promote_members": true,
"can_change_info": true,
"can_invite_users": true,
"can_post_stories": false,
"can_edit_stories": false,
"can_delete_stories": false,
"can_post_messages": false,
"can_edit_messages": false,
"can_pin_messages": true,
"can_manage_topics": true,
"is_anonymous": false
},
"roles": [1]
},
{
"user_id": 87654321,
"name": "Bob",
"username": "bob_dev",
"type": "custom",
"is_creator": false,
"roles": [2, 4]
}
]
}
]
}
| Field | Type | Description |
|---|---|---|
id | Integer | Telegram chat ID. |
title | String | Group title. |
username | String | Group username (may be absent for private groups). |
subs | Integer | Member count. |
cs | Object | Chat settings. |
mod | Object | Moderation settings. |
admins | Array | Combined list of Telegram admins and Combot custom admins. See Admin object below. |
Admin object
Returned in the admins array of getChats and identifies a user who has
access to the group via Telegram admin status or as a Combot-only custom admin.
| Field | Type | Description |
|---|---|---|
user_id | Integer | Telegram user ID |
name | String | Display name (first + last name from Telegram) |
username | String | Telegram username (may be null) |
type | String | telegram if the user is a Telegram admin in the group, or custom if added through Combot only |
is_creator | Boolean | true if this user is the Telegram creator of the chat |
can_be_edited | Boolean | Telegram admins only. true if the Combot bot is allowed to edit this administrator's rights (i.e. originally promoted them). Absent on custom admins. |
tg_rights | Object | Telegram admins only. Map of can_*/is_anonymous Booleans reflecting the admin's current Telegram rights. Absent on custom admins. |
roles | Array of Integer | Combot permission role IDs granted to this user. See Permission roles. |
Permission roles
Combot represents per-admin access as an array of integer role IDs. The same constants are used in the
roles field of Admin objects and in the roles parameter
accepted by changeAdminPermissions and setAdmin.
| Value | Name | Meaning |
|---|---|---|
0 | ROLE_NONE | No access. Returned for admins whose permissions were explicitly cleared. |
1 | ROLE_ALL | Wildcard — grants every role. Returned for the group creator, the Combot bot, and global super admins. Cannot be set explicitly via changeAdminPermissions. |
2 | ROLE_ANALYTICS | Access to Analytics and Users tabs. |
3 | ROLE_SETTINGS | Access to Settings and Moderation. |
4 | ROLE_SCHEDULER | Access to Scheduler management. |
When calling changeAdminPermissions or setAdmin,
only 2, 3, and 4 are accepted. Pass an empty roles array
to revoke all access (the server stores [0]).
Admin management
The following methods require the Business plan on the chat being modified
and the caller must be either the chat creator or a Telegram admin with the
can_promote_members right.
Business setAdmin
Grants admin access to a user. Two mutually exclusive paths, selected by promote_in_telegram:
- Default (custom admin) — the user is added to Combot's custom-admin list and granted the requested Combot roles. They are not promoted to a Telegram administrator. The user must already be a member of the chat.
-
With
promote_in_telegram=true— the user is promoted to Telegram administrator viapromoteChatMemberwith the supplied admin flag fields. Combot roles are stored alongside. Any existing custom-admin entry for the user is cleared (the two states are mutually exclusive). Requires the bot itself to holdcan_promote_membersin the chat.
The same endpoint also doubles as the edit path: re-calling it for an existing Telegram admin re-issues
promoteChatMember with the supplied flags (updating the admin's Telegram rights) and overwrites
their stored Combot roles.
/v5/setAdmin
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID |
user_input | String | Yes | Numeric user ID or Telegram @username |
roles | Array of Integer | No | Combot roles to grant. Defaults to [1] (ROLE_ALL) when omitted. Pass an empty array to store [0] (ROLE_NONE). See Permission roles. |
promote_in_telegram | Boolean | No | When true, take the Telegram promotion path. Default false |
Additional optional parameters — forwarded to Telegram's promoteChatMember when promote_in_telegram=true. Each is a Boolean, default false. Flags the bot itself does not hold, or that do not apply to the chat type, are silently dropped: | |||
can_manage_chat, can_delete_messages, can_manage_video_chats, can_restrict_members, can_promote_members, can_change_info, can_invite_users, can_post_stories, can_edit_stories, can_delete_stories, can_post_messages, can_edit_messages, can_pin_messages, can_manage_topics, is_anonymous | |||
Business removeAdmin
Removes a user's admin access from a group
/v5/removeAdmin
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID |
user_id | Integer | Yes | Numeric user ID of the admin to remove |
Business changeAdminPermissions
Sets the Combot roles for an existing admin (Telegram or custom) without touching their Telegram admin
status. To revoke all access, send an empty roles array.
/v5/changeAdminPermissions
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID |
user_id | Integer | Yes | Numeric user ID. Must already be an admin (Telegram or custom) of this chat. |
roles | Array of Integer | Yes | Combot roles to grant. Use form-encoded array syntax: roles[]=2&roles[]=4. See Permission roles. |
Analytics
Pro getChatAnalytics
Returns analytics data for a chat over a given time period, including message counts, active users, hourly heatmap data, and a comparison with the previous period.
/v5/getChatAnalytics
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer or comma-separated | Yes | Telegram chat ID. Accepts a comma-separated list of up to 5 chat IDs (e.g. -1001,-1002,-1003) for composite analytics — see the note below. |
from | Integer | No | Start timestamp in milliseconds. Default: 7 days ago. |
to | Integer | No | End timestamp in milliseconds. Default: now. |
Returns analytics object with current and previous period comparison, hourly heatmap, and recent join/leave activity.
Non-Pro groups are limited to a maximum 7-day date range.
Composite analytics
When chat_id contains a comma-separated list of 2–5 chat IDs, the response aggregates
across all of them. Joined / Left / Active users are deduplicated across the selected chats — a user
present in two of them counts as one. Messages are summed (events are not deduplicated).
- All selected chats must be of the same type (groups can only be combined with groups; channels with channels).
- The caller must have Analytics permission in every selected chat.
- At most 2 of the selected chats may be on Free or Pro plans; the rest must be on Business.
The composite response also includes a composite object describing the selected chats,
and each entry in last_joined_users / last_left_users carries the source
chat_id and chat_title.
Comparison mode
Add mode=compare to a composite request and the response returns one series per chat
instead of an aggregate. No previous-period comparison is included. Each chart payload becomes:
joined_series,left_series,messages_series,active_users_series(groups only) — each is an array of{chat_id, chat_title, chat_avatar, total, points}, wherepointsis[[ts, count], ...].hours_series(groups only) — per-chat heatmap data:{chat_id, chat_title, chat_avatar, hours: [[hour, day_of_week, count], ...]}.
The flag compare: true is set on the result. last_joined_users and
last_left_users are not deduplicated by user in composite mode (compare or not) — a
user who joined or left two of the selected chats appears as two rows.
Pro getJournal
Returns the moderation journal (action log) for a chat. Includes bans, mutes, warnings, and other moderation actions with timestamps and involved users.
/v5/getJournal
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
from | Integer | No | Start timestamp in milliseconds. |
to | Integer | No | End timestamp in milliseconds. |
page | Integer | No | Page number (0-indexed). Default: 0. |
limit | Integer | No | Records per page (1–200). Default: 50. |
user_id | Integer | No | Filter by user involved in actions. |
action_by_id | Integer or comma-separated list | No | Filter by action author IDs. |
action_for_id | Integer or comma-separated list | No | Filter by target user IDs. |
action_id | Integer or comma-separated list | No | Filter by one or more action types. |
exclude_action_by_ids | Integer or comma-separated list | No | Exclude actions performed by these author IDs. |
Returns a paginated list of journal entries with timestamp, action_by, action_for, reason, action_id, and text.
action_id values:
| action_id | Meaning |
|---|---|
0 | Member removed (kick or permanent ban — see reason for type) |
1 | Permissions changed (mute / restriction) |
2 | Member warned |
4 | Message deleted |
5 | New member |
6 | Member left |
7 | Member unbanned |
8 | Member unmuted |
9 | Message reported |
10 | Join request received |
11 | Join request approved |
12 | Member rejoined |
13 | Join request declined |
Members
Pro getChatUsers
Returns a list of chat members with activity data, join/leave dates, and moderation info. Supports filtering, sorting, and CSV export.
/v5/getChatUsers
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
page | Integer | No | Page number (0-indexed). Default: 0. |
limit | Integer | No | Records per page (1–500). Default: 25. |
format | String | No | json (default) or csv. |
export | Boolean | No | Set to true to export all users (ignores pagination). |
ids_only | Boolean | No | Set to true to return only user IDs. |
show_left | Boolean | No | Include members who left. |
only_left | Boolean | No | Show only members who left. |
name_filter_value | String | No | Filter by name or username (case-insensitive substring, min 3 chars). |
date_from | Integer | No | Filter by activity in date range (Unix seconds). |
date_to | Integer | No | Filter by activity in date range (Unix seconds). |
Filters
Each filter requires an _operator parameter and a _value parameter.
Supported operators: eq, gt, lt, between.
For between, pass a second value with _value2.
Groups only unless noted otherwise.
| Filter | Parameters | Description |
|---|---|---|
| User ID | id_filter_operator, id_filter_value |
Filter by Telegram user ID. |
| Messages | messages_filter_operator, messages_filter_value |
Filter by total message count. |
| XP | xp_filter_operator, xp_filter_value |
Filter by XP value. Only available if levels are enabled. |
| Reputation | rep_filter_operator, rep_filter_value |
Filter by reputation score. Only available if reputation is enabled. |
| Warnings | warns_filter_operator, warns_filter_value |
Filter by warning count. Only available if warnings are enabled. |
| Joined date | joined_filter_operator, joined_filter_value |
Filter by join date. Operators: before, after, between, last. |
| Left date | left_filter_operator, left_filter_value |
Filter by leave date. Same operators as Joined date. |
| Last message | last_msg_filter_operator, last_msg_filter_value |
Filter by last message date. Same operators as Joined date. |
Date filters (Joined, Left, Last message) support an optional _unit parameter
when using the last operator. Values: hours, days (default),
weeks, months.
Example: joined_filter_operator=last&joined_filter_value=7&joined_filter_unit=days
Returns a paginated list of user objects with user_id, title, username, avatar, joined, left, msg_total, active_days, last_message, and moderation data (XP, reputation, warnings) if enabled.
Pro getChatMember
Returns detailed information about a chat member.
/v5/getChatMember
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
user_id | Integer | Yes | Target user's Telegram ID. |
Returns a user object with user_id, name, username, avatar, status (member or left), first_join (Unix timestamp), left (Unix timestamp), last_message (Unix timestamp), msg_total (groups only), and xp, reputation, warns when the respective features are enabled.
Pro setChatMemberData
Sets XP, reputation, and/or warns for a chat member. Requires can_restrict_members admin permission.
/v5/setChatMemberData
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
user_id | Integer | Yes | Target user's Telegram ID. |
xp | Integer | No | Set XP to this value (0–999999). |
reputation | Integer | No | Set reputation to this value (-999999–999999). |
warns | Integer | No | Set warns to this value (0–999999). |
At least one of xp, reputation, or warns must be provided.
Business getUserActivity
Returns per-user message activity for a group: a daily message-count series and a day-of-week × hour heatmap. Groups only (not supported on channels).
/v5/getUserActivity
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
user_id | Integer | Yes | Target user's Telegram ID. |
from | Integer | No | Start timestamp. Accepts seconds or milliseconds. |
to | Integer | No | End timestamp. Accepts seconds or milliseconds. |
Defaults to the last 7 days when from/to are omitted. Returns:
{
"ok": true,
"result": {
"messages": [[unix_ms, count], ...], // daily totals, ascending
"hours": [[hour, dow, count], ...], // 168 entries (7 × 24)
"from": unix_ms, // effective range start
"to": unix_ms, // effective range end
"date_range_limit": days_or_null // tier-imposed cap, if any
}
}
dow is 0–6 (Monday–Sunday), hour is 0–23, both in the chat's timezone.
Referrals
Pro getReferrals
Returns referral data for a chat over a given time period. Can be filtered by mode: all referrals, by invite link, or by approval.
/v5/getReferrals
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
from | Integer | No | Start timestamp in milliseconds. |
to | Integer | No | End timestamp in milliseconds. |
mode | String | No | all (default), links, or approvals. |
Non-Pro groups are limited to a maximum 7-day date range.
Pro getInviteLinks
Returns a list of invite links for the chat with usage statistics.
/v5/getInviteLinks
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
page | Integer | No | Page number (0-indexed). Default: 0. |
limit | Integer | No | Records per page (1–100). Default: 25. |
Returns invite link objects with code, name, creator_id, users_count, left_count, and current_count.
Pro getInviteLinkDetails
Returns detailed join data for a specific invite link, including a joins-per-day chart and individual join records.
/v5/getInviteLinkDetails
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
link_code | String | Yes | The invite link code to inspect. |
page | Integer | No | Page number (0-indexed). Default: 0. |
limit | Integer | No | Records per page (1–100). Default: 25. |
Returns chart (joins per day) and joins (individual records with timestamp and user_id).
Business createInviteLink
Creates a new chat invite link and records it in Combot's invite-link tracking. Business plan is required.
Behaviour differs by caller type:
- Admin: Requires
can_invite_userspermission. All optional parameters below are honoured. The creator field is set to the calling admin's user ID. Limited to 20 links per admin per chat; returns a localizeddescriptionwhen the cap is hit. - Regular user: The User Invite Links feature must be enabled for the group by an admin. Optional parameters (
name,expire_date, etc.) are ignored. Limited to 10 links per user; returns a localizeddescriptionwhen the cap is hit.
/v5/createInviteLink
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
name | String | No | Admin only. Invite link name (max 32 characters). |
expire_date | Integer | No | Admin only. Unix timestamp when the link expires. Must be in the future. |
member_limit | Integer | No | Admin only. Maximum number of users (1–99999). Cannot be combined with creates_join_request. |
creates_join_request | Boolean | No | Admin only. If true, joining requires admin approval. Cannot be combined with member_limit. |
Response result contains link_code, invite_link (full URL),
name, expire_date, member_limit,
creates_join_request, and creator_id.
Moderation
Pro restrictMember
Restricts a chat member's permissions. Requires can_restrict_members admin permission.
/v5/restrictMember
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
user_id | Integer | Yes | Target user's Telegram ID (must be positive). |
permissions | JSON Object | Yes | Permission flags to set (see Telegram's ChatPermissions). |
reason | String | No | Reason logged to the journal. Defaults to API. The permission changes are always appended. |
Pro banMember
Kicks or bans a chat member. Requires can_restrict_members admin permission.
/v5/banMember
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
user_id | Integer | Yes | Target user's Telegram ID. |
ban | Boolean | No | If true, permanently bans the user (cannot rejoin). If false (default), kicks the user (can rejoin via invite link). |
reason | String | No | Reason logged to the journal. Defaults to API. |
Pro unbanMember
Unbans a previously banned chat member. Requires can_restrict_members admin permission. Only unbans if currently banned.
/v5/unbanMember
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
user_id | Integer | Yes | Target user's Telegram ID. |
reason | String | No | Reason logged to the journal. Defaults to API. |
Leaderboards
Every leaderboard response contains at most 50 users. To load the next XP, reputation, or
custom-period message page, pass the response's check_from value in the next request.
All-time message results instead use a zero-based page number.
Optional row fields such as user_id and last-message time are returned to Telegram
admins and Combot custom admins with the Analytics role. The requesting user's own row may also
include its identifier when available, so clients must treat these fields as optional.
show_admins=true controls whether Telegram admins are included in the ranking; it does not
grant privileged row access and does not filter Combot-only custom admins.
Pass usernames=true to append a user's Telegram username as the final tuple item when that
user has one. The username follows any privileged fields; users without a username do not receive a
trailing null.
Pass avatars=true to insert the avatar field at the documented tuple position. Without that
parameter the avatar field is omitted entirely; when requested but unavailable, its value is
null.
getXpLeaderboard
Returns the XP leaderboard for a group, including custom ranks and level thresholds. Groups only.
If XP is disabled in the group settings, the endpoint returns 404. If XP is enabled but
no member has accumulated XP yet, it returns an empty successful result.
/v5/getXpLeaderboard
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
check_from | Integer | No | Cursor: last user_id from previous page. |
show_admins | Boolean | No | Include admin users in results. |
avatars | Boolean | No | Pass true or 1 to include user avatar images. When omitted, false, or 0, avatar image data is not loaded or returned. |
usernames | Boolean | No | Pass true or 1 to append present Telegram usernames to result tuples. |
Returns users as [xp, name, rank, user_id?, username?], or [xp, name, avatar, rank, user_id?, username?] when avatars are requested, plus ranks (custom rank names), exp (level thresholds), has_more, check_from, and optional me (requesting user's position and entry when resolved).
getRepLeaderboard
Returns the reputation leaderboard for a group. Groups only. If reputation is disabled in the group
settings, the endpoint returns 404. If reputation is enabled but no member has accumulated
reputation yet, it returns an empty successful result.
/v5/getRepLeaderboard
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
check_from | Integer | No | Cursor: last user_id from previous page. |
show_admins | Boolean | No | Include admin users in results. |
avatars | Boolean | No | Pass true or 1 to include user avatar images. When omitted, false, or 0, avatar image data is not loaded or returned. |
usernames | Boolean | No | Pass true or 1 to append present Telegram usernames to result tuples. |
Returns users as [rep, name, user_id?, username?], or [rep, name, avatar, user_id?, username?] when avatars are requested, plus has_more, check_from, and optional me.
getUsersLeaderboard
Returns users ranked by message count for a time period. Groups only.
/v5/getUsersLeaderboard
| Parameter | Type | Required | Description |
|---|---|---|---|
chat_id | Integer | Yes | Telegram chat ID. |
period | String | No | "all" or "custom" (default). All-time stats require premium access. |
date_from | Integer | No | Start timestamp in Unix seconds. Required when period=custom. |
date_to | Integer | No | End timestamp in Unix seconds. Required when period=custom. The available history depends on the chat plan. |
check_from | Integer | No | Cursor: last user_id from the previous custom-period page. |
page | Integer | No | Zero-based page number for period=all. Default: 0. |
show_admins | Boolean | No | Include admin users in results. |
avatars | Boolean | No | Pass true or 1 to include user avatar images. When omitted, false, or 0, avatar image data is not loaded or returned. |
usernames | Boolean | No | Pass true or 1 to append present Telegram usernames to result tuples. |
Returns users as
[messages, unique_reaction_givers, name, last_message_ms?, user_id?, username?], or
[messages, unique_reaction_givers, name, avatar, last_message_ms?, user_id?, username?]
when avatars are requested, plus
has_more, check_from for custom periods or the
next page for all time, and optional me. The reaction value counts
distinct members who reacted to that member's messages during the requested custom period; all-time
mode currently returns 0 for this field. The stable avatar position is
null unless avatar images are requested.