Telegram Chat Management API

Methods for managing chats and chat settings

GitHub OpenAPI

Operations 11

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 /getChat Get chat information · Get Chat #
Ask an LLM
“How do I get the current title and photo of a group chat?”
“Can I fetch up-to-date info about a chat my bot is in?”
Tell an agent
Get chat {chat_id}.
Show the current title and photo of chat {chat_id}.
POST /getChatAdministrators List chat administrators · Get Chat Administrators #
Ask an LLM
“Who are the admins of a group chat?”
“Can I list the administrator users of a chat?”
Tell an agent
List administrators of chat {chat_id}.
Show who holds admin rights in chat {chat_id}.
POST /getChatMemberCount Count members in a chat · Get Chat Member Count #
Ask an LLM
“How many members are in a chat?”
“What is the current member count of a group?”
Tell an agent
Count members in chat {chat_id}.
Tell me how many users are in chat {chat_id}.
POST /getChatMember Get a chat member's status · Get Chat Member #
Ask an LLM
“What is a specific user's status in a chat?”
“Can I check whether a user is a member of a chat?”
Tell an agent
Get member {user_id} in chat {chat_id}.
Check the status of user {user_id} in chat {chat_id}.
POST /leaveChat Leave a chat · Leave Chat #
Ask an LLM
“How do I make my bot leave a group or channel?”
“Can a bot exit a chat it's in?”
Tell an agent destructive · confirm first
Leave chat {chat_id}.
Make my bot exit chat {chat_id}.
POST /setChatPhoto Set a chat profile photo · Set Chat Photo #
Ask an LLM
“How do I upload a new profile photo to a group?”
“Can I change a chat's photo with an image file?”
Tell an agent
Set chat {chat_id}'s photo to {photo}.
Upload image {photo} as the profile photo of chat {chat_id}.
POST /deleteChatPhoto Delete a chat profile photo · Delete Chat Photo #
Ask an LLM
“How do I remove the profile photo from a chat?”
“Can I clear a group's photo back to default?”
Tell an agent destructive · confirm first
Delete the profile photo of chat {chat_id}.
Remove the chat photo from chat {chat_id}.
POST /setChatTitle Rename a chat · Set Chat Title #
Ask an LLM
“How do I change the title of a group chat?”
“Can I rename a supergroup or channel?”
Tell an agent
Set chat {chat_id}'s title to {title}.
Rename chat {chat_id} to {title}.
POST /setChatDescription Set a chat description · Set Chat Description #
Ask an LLM
“How do I add or change a group's description?”
“Can I set a description on a channel chat?”
Tell an agent
Set the description of chat {chat_id} to {description}.
Add a description to chat {chat_id}.
POST /pinChatMessage Pin a message in a chat · Pin Chat Message #
Ask an LLM
“How do I pin a message to the top of a chat?”
“Can I pin a message without notifying members?”
Tell an agent
Pin message {message_id} in chat {chat_id}.
Pin message {message_id} in chat {chat_id} silently ({disable_notification}).
POST /unpinChatMessage Unpin a message from a chat · Unpin Chat Message #
Ask an LLM
“How do I unpin a message from a chat?”
“Can I unpin a specific message without removing the chat's pinned messages?”
Tell an agent
Unpin message {message_id} from chat {chat_id}.
Clear the pinned message {message_id} in chat {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-chat-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-chat-management-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Telegram Bot Chat 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: Chat Management
  description: Methods for managing chats and chat settings
paths:
  /getChat:
    post:
      operationId: getChat
      summary: Get Chat
      description: Get up-to-date information about the chat.
      tags:
      - Chat Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
      responses:
        '200':
          description: Chat object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatResponse'
  /getChatAdministrators:
    post:
      operationId: getChatAdministrators
      summary: Get Chat Administrators
      description: Get a list of administrators in a chat.
      tags:
      - Chat Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
      responses:
        '200':
          description: Array of ChatMember objects
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMembersResponse'
  /getChatMemberCount:
    post:
      operationId: getChatMemberCount
      summary: Get Chat Member Count
      description: Get the number of members in a chat.
      tags:
      - Chat Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
      responses:
        '200':
          description: Number of chat members
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegerResponse'
  /getChatMember:
    post:
      operationId: getChatMember
      summary: Get Chat Member
      description: Get information about a member of a chat.
      tags:
      - Chat 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: ChatMember object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMemberResponse'
  /leaveChat:
    post:
      operationId: leaveChat
      summary: Leave Chat
      description: Use this method for your bot to leave a group, supergroup or channel.
      tags:
      - Chat Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
      responses:
        '200':
          description: Bot left the chat
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /setChatPhoto:
    post:
      operationId: setChatPhoto
      summary: Set Chat Photo
      description: Set a new profile photo for the chat.
      tags:
      - Chat Management
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - chat_id
              - photo
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
                photo:
                  type: string
                  format: binary
                  description: New chat photo as InputFile
      responses:
        '200':
          description: Chat photo set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /deleteChatPhoto:
    post:
      operationId: deleteChatPhoto
      summary: Delete Chat Photo
      description: Delete a chat photo.
      tags:
      - Chat Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
      responses:
        '200':
          description: Chat photo deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /setChatTitle:
    post:
      operationId: setChatTitle
      summary: Set Chat Title
      description: Change the title of a chat.
      tags:
      - Chat Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              - title
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
                title:
                  type: string
                  description: New chat title (1-255 characters)
      responses:
        '200':
          description: Chat title updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /setChatDescription:
    post:
      operationId: setChatDescription
      summary: Set Chat Description
      description: Change the description of a group, a supergroup or a channel.
      tags:
      - Chat Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
                description:
                  type: string
                  description: New chat description (0-255 characters)
      responses:
        '200':
          description: Chat description updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /pinChatMessage:
    post:
      operationId: pinChatMessage
      summary: Pin Chat Message
      description: Add a message to the list of pinned messages in a chat.
      tags:
      - Chat Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              - message_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
                message_id:
                  type: integer
                  description: Identifier of a message to pin
                disable_notification:
                  type: boolean
                  description: Pass true to notify all chat members silently
      responses:
        '200':
          description: Message pinned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
  /unpinChatMessage:
    post:
      operationId: unpinChatMessage
      summary: Unpin Chat Message
      description: Remove a message from the list of pinned messages in a chat.
      tags:
      - Chat Management
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - chat_id
              properties:
                chat_id:
                  oneOf:
                  - type: integer
                  - type: string
                  description: Unique identifier for the target chat
                message_id:
                  type: integer
                  description: Identifier of a message to unpin
      responses:
        '200':
          description: Message unpinned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanResponse'
components:
  schemas:
    IntegerResponse:
      type: object
      properties:
        ok:
          type: boolean
        result:
          type: integer
    ChatResponse:
      type: object
      properties:
        ok:
          type: boolean
        result:
          $ref: '#/components/schemas/Chat'
    Chat:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for this chat
        type:
          type: string
          enum:
          - private
          - group
          - supergroup
          - channel
          description: Type of chat
        title:
          type: string
          description: Title for supergroups, channels and group chats
        username:
          type: string
          description: Username for private chats, supergroups and channels
        first_name:
          type: string
          description: First name of the other party in a private chat
        last_name:
          type: string
          description: Last name of the other party in a private chat
        description:
          type: string
          description: Description for groups, supergroups and channel chats
        invite_link:
          type: string
          description: Primary invite link for the chat
        member_count:
          type: integer
          description: Number of members in a chat
      required:
      - id
      - type
    BooleanResponse:
      type: object
      properties:
        ok:
          type: boolean
        result:
          type: boolean
    User:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for this user or bot
        is_bot:
          type: boolean
          description: True if this user is a bot
        first_name:
          type: string
          description: User's or bot's first name
        last_name:
          type: string
          description: User's or bot's last name
        username:
          type: string
          description: User's or bot's username
        language_code:
          type: string
          description: IETF language tag of the user's language
        is_premium:
          type: boolean
          description: True if this user is a Telegram Premium user
      required:
      - id
      - is_bot
      - first_name
    ChatMembersResponse:
      type: object
      properties:
        ok:
          type: boolean
        result:
          type: array
          items:
            $ref: '#/components/schemas/ChatMember'
    ChatMemberResponse:
      type: object
      properties:
        ok:
          type: boolean
        result:
          $ref: '#/components/schemas/ChatMember'
    ChatMember:
      type: object
      properties:
        status:
          type: string
          enum:
          - creator
          - administrator
          - member
          - restricted
          - left
          - kicked
          description: The member's status in the chat
        user:
          $ref: '#/components/schemas/User'
      required:
      - status
      - user
  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