getChat
Get detailed information about a chat.
Request
POST /:token/getchat
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| chat_id | Integer/String | Yes | Unique identifier for the target chat or username |
Response
Returns a Chat object.
json
{
"ok": true,
"result": {
"id": -1001234567890,
"type": "supergroup",
"title": "Tech Discussion Group",
"username": "tech_group",
"first_name": null,
"description": "A group for technical discussions",
"permissions": {
"can_send_messages": true,
"can_send_media_messages": true,
"can_send_polls": true,
"can_send_other_messages": true,
"can_add_web_page_previews": true,
"can_change_info": false,
"can_invite_users": true,
"can_pin_messages": false
}
}
}Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique identifier for the chat |
| type | String | Type of the chat. Possible values: private, group, supergroup, channel |
| title | String | Title of the group or channel. Null for private chats |
| username | String | Username of the chat (if set) |
| first_name | String | First name of the other party in a private chat |
| description | String | Description of the group or channel |
| permissions | ChatPermissions | Default member permissions for the group |
Error Codes
| Code | Description |
|---|---|
| 400 | Bad request parameters, e.g. invalid chat_id format |
| 401 | Invalid or expired token |
| 403 | Bot is not a member of this chat and has no access |
