> ## 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.

> ## Agent Instructions
> Integrating Pilot Status end to end? Follow https://docs.pilotstatus.com.br/guides/integrate-with-ai.md (pt-BR: https://docs.pilotstatus.com.br/pt-BR/guides/integrate-with-ai.md). No step requires contacting support: every credential is shown in the dashboard or in an API response, and a lost one is regenerated, not recovered.
> Webhook signing secret: shown ONCE in the Signing secret window right after creating the webhook on /webhooks, and in the `secret` field of the POST /v1/webhooks response (MCP: webhooks_create). Lost it: Edit Webhook → Generate a new secret, POST /v1/webhooks/{id}/rotate-secret, or webhooks_rotate_secret (the old one stops working at once). Verify `x-pilot-status-signature` = hex HMAC-SHA256 of the raw request body keyed with that secret.
> Meta verify token (number connected with the user's own Meta app credentials): Meta Number Created! window after connecting, then the number's card on Numbers (workspace Owner), or webhook.verifyToken in the POST /v1/numbers/meta response. It is not the webhook signing secret.
> REST auth: `x-api-key: ps_...` header, never Authorization: Bearer. MCP: https://mcp.pilotstatus.com.br/mcp (148 tools, OAuth 2.1 or x-api-key); Code Mode: https://mcp.pilotstatus.com.br/code. Destructive MCP tools return a preview and a confirm_token: show the preview and call again only after the user's explicit yes. Over OAuth, revealing or creating ps_ API keys is workspace Owner only.

# Buscar chats

> Devuelve los chats almacenados, opcionalmente filtrados por una cláusula `where`. Envía un cuerpo vacío para devolver todos los chats.



## OpenAPI

````yaml openapi.evolution-v2.es.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. URL base
    `https://pilotstatus.com.br/api/layer/evolution-v2`. Autentícate con el
    encabezado `apikey` (tu clave `ps_` de Pilot Status). Los endpoints de
    instancia/sesión NO están disponibles a través del 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: Buscar chats
      description: >-
        Devuelve los chats almacenados, opcionalmente filtrados por una cláusula
        `where`. Envía un cuerpo vacío para devolver todos los chats.
      operationId: post__chat_findChats_instance
      parameters:
        - name: instance
          in: path
          required: true
          schema:
            type: string
          description: >-
            El nombre de la instancia: el nombre de la instancia anterior que
            migraste en el panel, o el nombre de la instancia de Pilot Status
            (no el nombre visible del número).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                where:
                  type: object
                  description: >-
                    Filtra con cualquiera de `_id`, `id`, `pushName`,
                    `remoteJid`.
                  example:
                    remoteJid: 5511999999999@s.whatsapp.net
      responses:
        '200':
          description: 'Éxito: cuerpo de respuesta nativo del proveedor.'
          content:
            application/json:
              schema:
                type: array
                description: >-
                  Chats de la instancia con resumen del último mensaje e
                  información de la ventana de servicio de 24 h, ordenados por
                  actividad más reciente.
                items:
                  type: object
                  properties:
                    id:
                      type:
                        - string
                        - 'null'
                      description: >-
                        Id del registro de contacto, o null cuando no hay
                        contacto almacenado.
                    remoteJid:
                      type: string
                      description: JID del chat.
                    pushName:
                      type:
                        - string
                        - 'null'
                      description: Nombre visible del chat/contacto/grupo.
                    profilePicUrl:
                      type:
                        - string
                        - 'null'
                      description: URL de la foto de perfil.
                    updatedAt:
                      type:
                        - string
                        - 'null'
                      description: Timestamp ISO de la última actividad.
                    windowStart:
                      type:
                        - string
                        - 'null'
                      description: Timestamp ISO en que comenzó la ventana de 24 h.
                    windowExpires:
                      type:
                        - string
                        - 'null'
                      description: Timestamp ISO en que expira la ventana de 24 h.
                    windowActive:
                      type: boolean
                      description: >-
                        Si la ventana de mensajería de 24 h está abierta
                        actualmente.
                    lastMessage:
                      type:
                        - object
                        - 'null'
                      description: >-
                        Último mensaje del chat recortado (cuerpos multimedia
                        limpiados).
                      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: Contenido del mensaje limpiado.
                        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: Número de mensajes no leídos en el chat.
                    isSaved:
                      type: boolean
                      description: Si existe un registro de contacto para este 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: >-
        El token de la instancia, enviado en el encabezado `apikey`: el token de
        la instancia Evolution V2 que migraste en el panel (Números → Conectar →
        Migrar), o el token propio de la instancia de Pilot Status; y debe
        pertenecer a la `{instance}` de la ruta. Una clave de API `ps_` de Pilot
        Status NO se acepta (404 `Instance not found`). Este es el único
        encabezado que lee el layer Evolution V2: `Authorization: Bearer` y
        `x-api-key` no se aceptan, y una solicitud sin `apikey` recibe 401.

````

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