> ## Documentation Index
> Fetch the complete documentation index at: https://gowa-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get list of chats

> Retrieve a list of chat conversations with their basic information



## OpenAPI

````yaml /openapi.yml get /chats
openapi: 3.0.0
info:
  title: WhatsApp API MultiDevice
  version: 9.7.0
  description: |
    This API is used for sending whatsapp via API.

    The web dashboard is a separate project (gowa-ui); the server downloads its
    latest release asset and serves it at `/` (or returns a JSON banner when
    APP_UI_ENABLED=false).

    Device scoping:
    - Send `X-Device-Id` on all device-scoped REST calls.
    - WebSocket: connect to `/ws?device_id=<id>`.
    - WebSocket auth (when basic auth is enabled): browsers cannot set an
      Authorization header on WebSocket connections, so also pass
      `&authorization=<base64(user:pass)>` in the query string. Use TLS in
      production since the credential is visible in the URL.
servers:
  - url: http://localhost:3000
security:
  - basicAuth: []
tags:
  - name: app
    description: Initial Connection to Whatsapp server
  - name: device
    description: Device management for multi-device support
  - name: user
    description: Getting information
  - name: send
    description: Send Message (Text/Image/File/Video).
  - name: message
    description: Message manipulation (revoke/react/update).
  - name: call
    description: Call management (reject incoming calls)
  - name: chat
    description: Chat conversations and messaging
  - name: group
    description: Group setting
  - name: newsletter
    description: newsletter setting
  - name: chatwoot
    description: Chatwoot integration for customer support
paths:
  /chats:
    get:
      tags:
        - chat
      summary: Get list of chats
      description: Retrieve a list of chat conversations with their basic information
      operationId: listChats
      parameters:
        - $ref: '#/components/parameters/DeviceIdHeader'
        - name: limit
          in: query
          schema:
            type: integer
            default: 25
            maximum: 100
          description: Maximum number of chats to return
        - name: offset
          in: query
          schema:
            type: integer
            default: 0
          description: Number of chats to skip (for pagination)
        - name: search
          in: query
          schema:
            type: string
          description: Search chats by name
        - name: has_media
          in: query
          schema:
            type: boolean
            default: false
          description: Filter chats that contain media messages
        - name: archived
          in: query
          schema:
            type: boolean
          description: >-
            Filter by archived status. true = archived only, false =
            non-archived only. Omit to return all chats.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorUnauthorized'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInternalServer'
components:
  parameters:
    DeviceIdHeader:
      name: X-Device-Id
      in: header
      required: false
      description: >
        Device identifier for multi-device support. Required when multiple
        devices are registered.

        If only one device is registered, it will be used as the default.

        Can also be provided as `device_id` query parameter.
      schema:
        type: string
        example: my-device-id
  schemas:
    ChatListResponse:
      type: object
      properties:
        code:
          type: string
          example: SUCCESS
        message:
          type: string
          example: Success get chat list
        results:
          type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/Chat'
            pagination:
              type: object
              properties:
                limit:
                  type: integer
                  example: 25
                offset:
                  type: integer
                  example: 0
                total:
                  type: integer
                  example: 150
    ErrorBadRequest:
      type: object
      properties:
        code:
          type: string
          example: 400
          description: HTTP Status Code
        message:
          type: string
          example: field cannot be blank
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
    ErrorUnauthorized:
      type: object
      properties:
        code:
          type: string
          example: 401
          description: HTTP Status Code
        message:
          type: string
          example: Unauthorized access
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
    ErrorInternalServer:
      type: object
      properties:
        code:
          type: string
          example: INTERNAL_SERVER_ERROR
          description: SYSTEM_CODE_ERROR
        message:
          type: string
          example: you are not loggin
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
    Chat:
      type: object
      properties:
        jid:
          type: string
          example: 6289685028129@s.whatsapp.net
          description: Chat JID identifier
        name:
          type: string
          example: John Doe
          description: Chat display name
        last_message_time:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
          description: Timestamp of the last message
        ephemeral_expiration:
          type: integer
          example: 0
          description: Ephemeral message expiration time in seconds (0 = disabled)
        created_at:
          type: string
          format: date-time
          example: '2024-01-10T08:00:00Z'
          description: Chat creation timestamp
        updated_at:
          type: string
          format: date-time
          example: '2024-01-15T10:30:00Z'
          description: Chat last update timestamp
        archived:
          type: boolean
          example: false
          description: Whether the chat is archived
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

## Related topics

- [Get messages from a specific chat](https://gowa-docs.mintlify.site/api-reference/chat/get-messages-from-a-specific-chat.md)
- [Get list of participants in a group](https://gowa-docs.mintlify.site/api-reference/group/get-list-of-participants-in-a-group.md)
- [Get list of user contacts](https://gowa-docs.mintlify.site/api-reference/user/get-list-of-user-contacts.md)
- [Get list connected devices](https://gowa-docs.mintlify.site/api-reference/app/get-list-connected-devices.md)
- [Get list of participant requests to join group](https://gowa-docs.mintlify.site/api-reference/group/get-list-of-participant-requests-to-join-group.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.