Use this method to get a list of administrators in a chat

POST /getChatAdministrators

Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.

Body Required

  • chat_id integer | string Required

    Any of:

    Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

    Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

Responses

  • default
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is false.

    • error_code integer Required
    • description string Required
    • parameters object

      Contains information about why a request was unsuccessful.

      Hide parameters attributes Show parameters attributes object
      • migrate_to_chat_id integer

        Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

      • retry_after integer

        Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated

  • 200
    Hide response attributes Show response attributes object
    • ok boolean Required

      Default value is true.

    • result array[object] Required

      This object contains information about one member of a chat.

      Hide result attributes Show result attributes array[object]
      • user object Required

        This object represents a Telegram user or bot.

        Hide user attributes Show user attributes object
        • id integer Required

          Unique identifier for this user or bot

        • is_bot boolean Required

          True, if this user is a bot

        • first_name string Required

          User's or bot's first name

        • last_name string

          Optional. User's or bot's last name

        • username string

          Optional. User's or bot's username

        • language_code string

          Optional. IETF language tag of the user's language

        • can_join_groups boolean

          Optional. True, if the bot can be invited to groups. Returned only in getMe.

        • can_read_all_group_messages boolean

          Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.

        • supports_inline_queries boolean

          Optional. True, if the bot supports inline queries. Returned only in getMe.

      • status string Required

        The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”

        Values are creator, administrator, member, restricted, left, or kicked.

      • custom_title string

        Optional. Owner and administrators only. Custom title for this user

      • is_anonymous boolean

        Optional. Owner and administrators only. True, if the user's presence in the chat is hidden

      • can_be_edited boolean

        Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user

      • can_post_messages boolean

        Optional. Administrators only. True, if the administrator can post in the channel; channels only

      • can_edit_messages boolean

        Optional. Administrators only. True, if the administrator can edit messages of other users and can pin messages; channels only

      • can_delete_messages boolean

        Optional. Administrators only. True, if the administrator can delete messages of other users

      • can_restrict_members boolean

        Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members

      • can_promote_members boolean

        Optional. Administrators only. True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)

      • can_change_info boolean

        Optional. Administrators and restricted only. True, if the user is allowed to change the chat title, photo and other settings

      • can_invite_users boolean

        Optional. Administrators and restricted only. True, if the user is allowed to invite new users to the chat

      • can_pin_messages boolean

        Optional. Administrators and restricted only. True, if the user is allowed to pin messages; groups and supergroups only

      • is_member boolean

        Optional. Restricted only. True, if the user is a member of the chat at the moment of the request

      • can_send_messages boolean

        Optional. Restricted only. True, if the user is allowed to send text messages, contacts, locations and venues

      • can_send_media_messages boolean

        Optional. Restricted only. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes

      • can_send_polls boolean

        Optional. Restricted only. True, if the user is allowed to send polls

      • can_send_other_messages boolean

        Optional. Restricted only. True, if the user is allowed to send animations, games, stickers and use inline bots

      • can_add_web_page_previews boolean

        Optional. Restricted only. True, if the user is allowed to add web page previews to their messages

      • until_date integer

        Optional. Restricted and kicked only. Date when restrictions will be lifted for this user; unix time

POST /getChatAdministrators
curl \
 -X POST https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getChatAdministrators \
 -H "Content-Type: application/json" \
 -d '{"chat_id":42}'
Request example
{
  "chat_id": 42
}
Request examples
{
  "chat_id": 42
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (default)
{
  "ok": false,
  "error_code": 42,
  "description": "string",
  "parameters": {
    "migrate_to_chat_id": 42,
    "retry_after": 42
  }
}
Response examples (200)
{
  "ok": true,
  "result": [
    {
      "user": {
        "id": 42,
        "is_bot": true,
        "first_name": "string",
        "last_name": "string",
        "username": "string",
        "language_code": "string",
        "can_join_groups": true,
        "can_read_all_group_messages": true,
        "supports_inline_queries": true
      },
      "status": "creator",
      "custom_title": "string",
      "is_anonymous": true,
      "can_be_edited": true,
      "can_post_messages": true,
      "can_edit_messages": true,
      "can_delete_messages": true,
      "can_restrict_members": true,
      "can_promote_members": true,
      "can_change_info": true,
      "can_invite_users": true,
      "can_pin_messages": true,
      "is_member": true,
      "can_send_messages": true,
      "can_send_media_messages": true,
      "can_send_polls": true,
      "can_send_other_messages": true,
      "can_add_web_page_previews": true,
      "until_date": 42
    }
  ]
}
Response examples (200)
{
  "ok": true,
  "result": [
    {
      "user": {
        "id": 42,
        "is_bot": true,
        "first_name": "string",
        "last_name": "string",
        "username": "string",
        "language_code": "string",
        "can_join_groups": true,
        "can_read_all_group_messages": true,
        "supports_inline_queries": true
      },
      "status": "creator",
      "custom_title": "string",
      "is_anonymous": true,
      "can_be_edited": true,
      "can_post_messages": true,
      "can_edit_messages": true,
      "can_delete_messages": true,
      "can_restrict_members": true,
      "can_promote_members": true,
      "can_change_info": true,
      "can_invite_users": true,
      "can_pin_messages": true,
      "is_member": true,
      "can_send_messages": true,
      "can_send_media_messages": true,
      "can_send_polls": true,
      "can_send_other_messages": true,
      "can_add_web_page_previews": true,
      "until_date": 42
    }
  ]
}