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

# Find chats

> Returns stored chats, optionally filtered by a `where` clause. Send an empty body to return all chats.



## OpenAPI

````yaml openapi.evolution-v2.json POST /chat/findChats/{instance}
openapi: 3.1.0
info:
  title: Evolution V2 Layer
  version: 1.0.0
  description: >-
    Pilot Status API Layer — Evolution V2. Base URL
    `https://pilotstatus.com.br/api/layer/evolution-v2`. Authenticate with the
    `apikey` header (your Pilot Status `ps_` key). Instance/session endpoints
    are NOT available through the layer.
servers:
  - url: https://pilotstatus.com.br/api/layer/evolution-v2
security:
  - apiKey: []
tags:
  - name: Call & Business
  - name: Chat
  - name: Group
  - name: Label
  - name: Message
  - name: Profile
  - name: Settings & Proxy
  - name: Storage (S3)
  - name: Template
paths:
  /chat/findChats/{instance}:
    post:
      tags:
        - Chat
      summary: Find chats
      description: >-
        Returns stored chats, optionally filtered by a `where` clause. Send an
        empty body to return all chats.
      operationId: post__chat_findChats_instance
      parameters:
        - name: instance
          in: path
          required: true
          schema:
            type: string
          description: The number's display name in the Pilot Status dashboard.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                where:
                  type: object
                  description: Filter with any of `_id`, `id`, `pushName`, `remoteJid`.
                  example:
                    remoteJid: 5511999999999@s.whatsapp.net
      responses:
        '200':
          description: Success — provider-native response body.
          content:
            application/json:
              schema:
                type: array
                description: >-
                  Chats for the instance with last-message summary and 24h
                  service-window info, ordered by most recent activity.
                items:
                  type: object
                  properties:
                    id:
                      type:
                        - string
                        - 'null'
                      description: Contact record id, or null when no contact is stored.
                    remoteJid:
                      type: string
                      description: Chat JID.
                    pushName:
                      type:
                        - string
                        - 'null'
                      description: Chat/contact/group display name.
                    profilePicUrl:
                      type:
                        - string
                        - 'null'
                      description: Profile picture URL.
                    updatedAt:
                      type:
                        - string
                        - 'null'
                      description: ISO timestamp of last activity.
                    windowStart:
                      type:
                        - string
                        - 'null'
                      description: ISO timestamp when the 24h window started.
                    windowExpires:
                      type:
                        - string
                        - 'null'
                      description: ISO timestamp when the 24h window expires.
                    windowActive:
                      type: boolean
                      description: Whether the 24h messaging window is currently open.
                    lastMessage:
                      type:
                        - object
                        - 'null'
                      description: Trimmed last message of the chat (media bodies cleaned).
                      properties:
                        id:
                          type: string
                        key:
                          type: object
                          properties:
                            remoteJid:
                              type: string
                            fromMe:
                              type: boolean
                            id:
                              type: string
                        pushName:
                          type:
                            - string
                            - 'null'
                        participant:
                          type:
                            - string
                            - 'null'
                        messageType:
                          type: string
                        message:
                          type: object
                          description: Cleaned message content.
                        contextInfo:
                          type:
                            - object
                            - 'null'
                        source:
                          type: string
                        messageTimestamp:
                          type: integer
                        instanceId:
                          type: string
                        sessionId:
                          type:
                            - string
                            - 'null'
                        status:
                          type:
                            - string
                            - 'null'
                    unreadCount:
                      type: integer
                      description: Number of unread messages in the chat.
                    isSaved:
                      type: boolean
                      description: Whether a contact record exists for this chat.
                  required:
                    - remoteJid
                    - windowActive
                    - unreadCount
                    - isSaved
              example:
                - id: clzcontact001aaa111bbb222
                  remoteJid: 5511999999999@s.whatsapp.net
                  pushName: Maria Silva
                  profilePicUrl: https://pps.whatsapp.net/v/t61.24694-24/123456_abcdef.jpg
                  updatedAt: '2026-07-09T18:20:00.000Z'
                  windowStart: '2026-07-09T13:00:00.000Z'
                  windowExpires: '2026-07-10T13:00:00.000Z'
                  windowActive: true
                  lastMessage:
                    id: clzmsg0012233445566778899
                    key:
                      remoteJid: 5511999999999@s.whatsapp.net
                      fromMe: false
                      id: 3EB0C767D26A1D8A0F1B
                    pushName: Maria Silva
                    participant: null
                    messageType: conversation
                    message:
                      conversation: Oi, tudo bem?
                    contextInfo: null
                    source: android
                    messageTimestamp: 1720544400
                    instanceId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    sessionId: null
                    status: READ
                  unreadCount: 2
                  isSaved: true
        default:
          description: Error — provider or layer error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  error:
                    type: string
                  message:
                    type: string
                  response:
                    type: object
              example:
                status: 400
                error: Bad Request
                message: Invalid payload
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: apikey
      description: >-
        Your Pilot Status API key (ps_...). Evolution GO also accepts
        `Authorization: Bearer <key>`.

````