---
title: "Get all chats"
method: GET
path: "/chats"
tags: ["chats"]
---

# Get all chats

`GET /chats`

## Request

- Base URL: `https://botapi.tamtam.chat`
- URL: `https://botapi.tamtam.chat/chats`
- Auth: API key in query parameter `access_token`

Returns information about chats that bot participated in: a result list and marker points to the next page

## Query parameters

- `count` integer
- `marker` integer

## Response `200`

Returns paginated response of chats

- ChatList
  - `chats` Chat[], required: List of requested chats
    - `chat_id` integer, required: Chats identifier
    - `type` 'dialog' | 'chat' | 'channel', required: Type of chat. Dialog (one-on-one), chat or channel
    - `status` 'active' | 'removed' | 'left' | 'closed' | 'suspended', required: Chat status for current bot
    - `title` string, nullable, required: Visible title of chat. Can be null for dialogs
    - `icon` Image, required: Generic schema describing image object
      - `url` string, required: URL of image
    - `last_event_time` integer, required: Time of last event occurred in chat
    - `participants_count` integer, required: Number of people in chat. Always 2 for `dialog` chat type
    - `owner_id` integer, nullable: Identifier of chat owner. Visible only for chat admins
    - `participants` object, nullable: Participants in chat with time of last activity. Can be *null* when you request list of chats. Visible for chat admins only
    - `is_public` boolean, required: Is current chat publicly available. Always `false` for dialogs
    - `link` string, nullable: Link on chat
    - `description` string, nullable, required: Chat description
    - `dialog_with_user` UserWithPhoto
      - `user_id` integer, required: Users identifier
      - `name` string, required: Users visible name
      - `username` string, nullable, required: Unique public user name. Can be `null` if user is not accessible or it is not set
      - `is_bot` boolean, required: `true` if user is bot
      - `last_activity_time` integer, required: Time of last user activity in TamTam (Unix timestamp in milliseconds). Can be outdated if user disabled its "online" status in settings
      - `description` string, nullable: User description. Can be `null` if user did not fill it out
      - `avatar_url` string: URL of avatar
      - `full_avatar_url` string: URL of avatar of a bigger size
    - `messages_count` integer, nullable: Messages count in chat. Only for group chats and channels. **Not available** for dialogs
    - `chat_message_id` string, nullable: Identifier of message that contains `chat` button initialized chat
    - `pinned_message` Message: Message in chat
      - `sender` User
        - `user_id` integer, required: Users identifier
        - `name` string, required: Users visible name
        - `username` string, nullable, required: Unique public user name. Can be `null` if user is not accessible or it is not set
        - `is_bot` boolean, required: `true` if user is bot
        - `last_activity_time` integer, required: Time of last user activity in TamTam (Unix timestamp in milliseconds). Can be outdated if user disabled its "online" status in settings
      - `recipient` Recipient, required: New message recipient. Could be user or chat
        - `chat_id` integer, nullable, required: Chat identifier
        - `chat_type` 'dialog' | 'chat' | 'channel', required: Type of chat. Dialog (one-on-one), chat or channel
        - `user_id` integer, nullable, required: User identifier, if message was sent to user
      - `timestamp` integer, required: Unix-time when message was created
      - `link` LinkedMessage
        - `type` 'forward' | 'reply', required: Type of linked message
        - `sender` User
          - `user_id` integer, required: Users identifier
          - `name` string, required: Users visible name
          - `username` string, nullable, required: Unique public user name. Can be `null` if user is not accessible or it is not set
          - `is_bot` boolean, required: `true` if user is bot
          - `last_activity_time` integer, required: Time of last user activity in TamTam (Unix timestamp in milliseconds). Can be outdated if user disabled its "online" status in settings
        - `chat_id` integer: Chat where message has been originally posted. For forwarded messages only
        - `message` MessageBody, required: Schema representing body of message
          - `mid` string, required: Unique identifier of message
          - `seq` integer, required: Sequence identifier of message in chat
          - `text` string, nullable, required: Message text
          - `attachments` Attachment[], nullable, required: Message attachments. Could be one of `Attachment` type. See description of this schema
            - `type` string, required
          - `markup` MarkupElement[], nullable: Message text markup. See [Formatting](#section/About/Text-formatting) section for more info
            - `type` string, required: Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, link or user_mention
            - `from` integer, required: Element start index (zero-based) in text
            - `length` integer, required: Length of the markup element
      - `body` MessageBody, required: Schema representing body of message
        - `mid` string, required: Unique identifier of message
        - `seq` integer, required: Sequence identifier of message in chat
        - `text` string, nullable, required: Message text
        - `attachments` Attachment[], nullable, required: Message attachments. Could be one of `Attachment` type. See description of this schema
          - `type` string, required
        - `markup` MarkupElement[], nullable: Message text markup. See [Formatting](#section/About/Text-formatting) section for more info
          - `type` string, required: Type of the markup element. Can be **strong**, *emphasized*, ~strikethrough~, ++underline++, `monospaced`, link or user_mention
          - `from` integer, required: Element start index (zero-based) in text
          - `length` integer, required: Length of the markup element
      - `stat` MessageStat: Message statistics
        - `views` integer, required
      - `url` string, nullable: Message public URL. Can be `null` for dialogs or non-public chats/channels
      - `constructor` User
        - `user_id` integer, required: Users identifier
        - `name` string, required: Users visible name
        - `username` string, nullable, required: Unique public user name. Can be `null` if user is not accessible or it is not set
        - `is_bot` boolean, required: `true` if user is bot
        - `last_activity_time` integer, required: Time of last user activity in TamTam (Unix timestamp in milliseconds). Can be outdated if user disabled its "online" status in settings
  - `marker` integer, nullable, required: Reference to the next page of requested chats

## Other responses

- `401`: Authorization Error. No `access_token` provided or token is invalid
- `500`: Internal Server Error

## Changes

- **2021-06-02** `137e3d1e0b4f`: 4 info
  - added `highlighted` discriminator mapping keys to the `chats/items/pinned_message/allOf[#/components/schemas/Message]/body/allOf[#/components/schemas/MessageBody]/markup/items/` response property for the response status `200`
  - added `highlighted` discriminator mapping keys to the `chats/items/pinned_message/allOf[#/components/schemas/Message]/link/allOf[#/components/schemas/LinkedMessage]/message/allOf[#/components/schemas/MessageBody]/markup/items/` response property for the response status `200`
  - removed `code` discriminator mapping keys from the `chats/items/pinned_message/allOf[#/components/schemas/Message]/body/allOf[#/components/schemas/MessageBody]/markup/items/` response property for the response status `200`
  - removed `code` discriminator mapping keys from the `chats/items/pinned_message/allOf[#/components/schemas/Message]/link/allOf[#/components/schemas/LinkedMessage]/message/allOf[#/components/schemas/MessageBody]/markup/items/` response property for the response status `200`
- …earlier changes not shown

[Operation history](https://skmtc.dev/tamtam/apis/tamtam-bot-api/changes/chats/get.md)

---

[API](https://skmtc.dev/tamtam/apis/tamtam-bot-api.md) - [All operations](https://skmtc.dev/tamtam/apis/tamtam-bot-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tamtam/apis/tamtam-bot-api/revisions/fa85402ea716?raw)
