getChatMember
Get information about a specific member in a chat.
Request
POST /:token/getchatmember
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| chat_id | Integer/String | Yes | Unique identifier for the target chat or username |
| user_id | Integer | Yes | Unique identifier of the target user |
Response
Returns a ChatMember object.
json
{
"ok": true,
"result": {
"user": {
"id": 123456789,
"is_bot": false,
"first_name": "John",
"username": "johndoe"
},
"status": "administrator",
"custom_title": "Tech Lead",
"is_anonymous": false,
"can_manage_chat": true,
"can_post_messages": true,
"can_edit_messages": true,
"can_delete_messages": true,
"can_manage_video_chats": true,
"can_restrict_members": true,
"can_promote_members": false,
"can_change_info": true,
"can_invite_users": true,
"can_pin_messages": true
}
}Response Fields
| Field | Type | Description |
|---|---|---|
| user | User | User information object of the member |
| status | String | Member status. Possible values: creator, administrator, member, restricted, left, kicked |
| custom_title | String | Custom title of the administrator |
| is_anonymous | Boolean | Whether the administrator is anonymous |
| can_manage_chat | Boolean | Whether the member can manage the chat |
| can_post_messages | Boolean | Whether the member can post messages (channels only) |
| can_edit_messages | Boolean | Whether the member can edit messages (channels only) |
| can_delete_messages | Boolean | Whether the member can delete messages |
| can_manage_video_chats | Boolean | Whether the member can manage video chats |
| can_restrict_members | Boolean | Whether the member can restrict other members |
| can_promote_members | Boolean | Whether the member can promote other members to administrators |
| can_change_info | Boolean | Whether the member can change chat information |
| can_invite_users | Boolean | Whether the member can invite users |
| can_pin_messages | Boolean | Whether the member can pin messages |
Error Codes
| Code | Description |
|---|---|
| 400 | Bad request parameters, e.g. missing chat_id or user_id |
| 401 | Invalid or expired token |
| 403 | Bot is not a member of this chat and has no access |
