Telegram Member Management API

Methods for managing chat members and administrators

GitHub OpenAPI

Operations 7

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /banChatMember Ban a user from a group or channel · Ban Chat Member #
Ask an LLM
“How do I ban a spammer from my Telegram group?”
“Can I ban someone for a set number of days and revoke their messages?”
Tell an agent destructive · confirm first
Ban user {user_id} in chat {chat_id}.
Ban {user_id} in {chat_id} until {until_date} and revoke their messages.
POST /unbanChatMember Unban a previously banned user · Unban Chat Member #
Ask an LLM
“How do I lift a ban on someone who apologized?”
“Can I unban a user only if they were actually banned?”
Tell an agent
Unban user {user_id} in chat {chat_id}.
Unban {user_id} in {chat_id} unless they are not banned.
POST /restrictChatMember Restrict a user in a supergroup · Restrict Chat Member #
Ask an LLM
“How do I restrict a user's ability to post in a supergroup?”
“Can I restrict a user's permissions until a certain date?”
Tell an agent
Restrict user {user_id} in chat {chat_id} with permissions {permissions}.
Restrict {user_id} in {chat_id} until {until_date} with {permissions}.
POST /promoteChatMember Promote or demote a chat administrator · Promote Chat Member #
Ask an LLM
“How do I make someone an admin of my supergroup?”
“Can I give an admin the power to ban members but not change the group title?”
Tell an agent
Promote user {user_id} in chat {chat_id} as an admin.
Make {user_id} an admin of {chat_id} with can_post_messages {can_post_messages} and can_restrict_members {can_restrict_members}.
POST /setChatAdministratorCustomTitle Set a custom admin title · Set Chat Administrator Custom Title #
Ask an LLM
“Can I give an admin a custom title like 'Moderator'?”
“What's the character limit for an admin's custom title?”
Tell an agent
Set custom title {custom_title} for admin {user_id} in chat {chat_id}.
Give {user_id} in {chat_id} the title {custom_title}.
POST /approveChatJoinRequest Approve a pending chat join request · Approve Chat Join Request #
Ask an LLM
“How do I accept a user who requested to join my group?”
“Can I approve a pending join request for a new member?”
Tell an agent
Approve the join request from user {user_id} in chat {chat_id}.
Accept {user_id}'s request to join {chat_id}.
POST /declineChatJoinRequest Decline a pending chat join request · Decline Chat Join Request #
Ask an LLM
“How do I turn down a user who asked to join my group?”
“Can I decline a pending join request without banning the user?”
Tell an agent
Decline the join request from user {user_id} in chat {chat_id}.
Turn down {user_id}'s request to join {chat_id}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/telegram:telegram-member-management-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

telegram-member-management-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Telegram Bot Member Management API
  description: The Telegram Bot API is an HTTP-based interface created for developers keen on building bots for Telegram. Bots can receive messages, send messages, manage chats, handle payments, work with stickers, and much more. All methods are HTTPS POST requests to https://api.telegram.org/bot/METHOD_NAME.
  version: '9.5'
  contact:
    name: Telegram Support
    url: https://core.telegram.org/bots/api
  license:
    name: Terms of Service
    url: https://telegram.org/tos
  termsOfService: https://telegram.org/tos
servers:
- url: https://api.telegram.org/bot{token}
  description: Telegram Bot API Server
  variables:
    token:
      default: YOUR_BOT_TOKEN
      description: Bot authentication token obtained from @BotFather
security:
- BotToken: []
tags:
- name: Member Management
  description: Methods for managing chat members and administrators
paths:
  /banChatMember:
    post:
      operationId: banChatMember
      summary: Ban Chat Member
      description: Ban a user in a group, a supergroup or a channel.
      tags:
      - Member Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              - user_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target group or username
                user_id:
                  type: integer
                  description: Unique identifier of the target user
                until_date:
                  type: integer
                  description: Date when the user will be unbanned (Unix time)
                revoke_messages:
                  type: boolean
                  description: Pass true to delete all messages from the chat for the user
      responses:
        '200':
          description: User banned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /unbanChatMember:
    post:
      operationId: unbanChatMember
      summary: Unban Chat Member
      description: Unban a previously banned user in a supergroup or channel.
      tags:
      - Member Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              - user_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target group
                user_id:
                  type: integer
                  description: Unique identifier of the target user
                only_if_banned:
                  type: boolean
                  description: Do nothing if the user is not banned
      responses:
        '200':
          description: User unbanned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /restrictChatMember:
    post:
      operationId: restrictChatMember
      summary: Restrict Chat Member
      description: Restrict a user in a supergroup.
      tags:
      - Member Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              - user_id
              - permissions
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
                user_id:
                  type: integer
                  description: Unique identifier of the target user
                permissions:
                  $ref: '#/components/schemas/ChatPermissions'
                until_date:
                  type: integer
                  description: Date when restrictions will be lifted for the user (Unix time)
      responses:
        '200':
          description: User restrictions updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /promoteChatMember:
    post:
      operationId: promoteChatMember
      summary: Promote Chat Member
      description: Promote or demote a user in a supergroup or a channel.
      tags:
      - Member Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              - user_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
                user_id:
                  type: integer
                  description: Unique identifier of the target user
                can_change_info:
                  type: boolean
                  description: Pass true if the administrator can change chat title, photo and other settings
                can_post_messages:
                  type: boolean
                  description: Pass true if the administrator can post in the channel
                can_edit_messages:
                  type: boolean
                  description: Pass true if the administrator can edit messages of other users
                can_delete_messages:
                  type: boolean
                  description: Pass true if the administrator can delete messages of other users
                can_restrict_members:
                  type: boolean
                  description: Pass true if the administrator can restrict, ban or unban chat members
                can_promote_members:
                  type: boolean
                  description: Pass true if the administrator can add new administrators
                can_manage_chat:
                  type: boolean
                  description: Pass true if the administrator can manage the chat
      responses:
        '200':
          description: Administrator rights updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /setChatAdministratorCustomTitle:
    post:
      operationId: setChatAdministratorCustomTitle
      summary: Set Chat Administrator Custom Title
      description: Set a custom title for an administrator in a supergroup promoted by the bot.
      tags:
      - Member Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              - user_id
              - custom_title
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
                user_id:
                  type: integer
                  description: Unique identifier of the target user
                custom_title:
                  type: string
                  description: New custom title for the administrator (0-16 characters)
      responses:
        '200':
          description: Custom title set successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /approveChatJoinRequest:
    post:
      operationId: approveChatJoinRequest
      summary: Approve Chat Join Request
      description: Approve a chat join request.
      tags:
      - Member Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              - user_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
                user_id:
                  type: integer
                  description: Unique identifier of the target user
      responses:
        '200':
          description: Join request approved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /declineChatJoinRequest:
    post:
      operationId: declineChatJoinRequest
      summary: Decline Chat Join Request
      description: Decline a chat join request.
      tags:
      - Member Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              - user_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
                user_id:
                  type: integer
                  description: Unique identifier of the target user
      responses:
        '200':
          description: Join request declined
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
components:
  schemas:
    ChatPermissions:
      type: object
      properties:
        can_send_messages:
          type: boolean
          description: True if the user is allowed to send text messages
        can_send_audios:
          type: boolean
          description: True if the user is allowed to send audios
        can_send_documents:
          type: boolean
          description: True if the user is allowed to send documents
        can_send_photos:
          type: boolean
          description: True if the user is allowed to send photos
        can_send_videos:
          type: boolean
          description: True if the user is allowed to send videos
        can_send_polls:
          type: boolean
          description: True if the user is allowed to send polls
        can_send_other_messages:
          type: boolean
          description: True if the user is allowed to send animations, games, stickers
        can_add_web_page_previews:
          type: boolean
          description: True if the user is allowed to add web page previews to messages
        can_change_info:
          type: boolean
          description: True if the user is allowed to change chat title, photo and settings
        can_invite_users:
          type: boolean
          description: True if the user is allowed to invite new users to the chat
        can_pin_messages:
          type: boolean
          description: True if the user is allowed to pin messages
    BooleanResponse:
      type: object
      properties:
        ok:
          type: boolean
        result:
          type: boolean
  securitySchemes:
    BotToken:
      type: apiKey
      in: path
      name: token
      description: Bot authentication token obtained from @BotFather (embedded in URL path)
externalDocs:
  description: Official Telegram Bot API Documentation
  url: https://core.telegram.org/bots/api