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

# Conteo de no leídos por número

> Conteo de entrantes no leídos de cada número, en una sola llamada, sin contenido de mensajes. El `total` de un número es igual al `total` de GET /v1/messages/unread para ese número. Alcance: una clave con alcance de número (o una clave de toda la cuenta con `x-whatsapp-number-id`) ve su número; un token/clave de cuenta restringido a algunos números ve esos; una credencial de toda la cuenta ve todos los números del workspace. A diferencia de la lista, una clave de toda la cuenta NO se rechaza. Los tokens OAuth/MCP y las claves de cuenta necesitan `chat:read`.



## OpenAPI

````yaml openapi.es.json GET /v1/messages/unread/counts
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    API REST pública de Pilot Status. Autentícate con el encabezado `x-api-key:
    ps_...` (o `x-api-key-id`). URL base: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/messages/unread/counts:
    get:
      tags:
        - Conversations
      summary: Conteo de no leídos por número
      description: >-
        Conteo de entrantes no leídos de cada número, en una sola llamada, sin
        contenido de mensajes. El `total` de un número es igual al `total` de
        GET /v1/messages/unread para ese número. Alcance: una clave con alcance
        de número (o una clave de toda la cuenta con `x-whatsapp-number-id`) ve
        su número; un token/clave de cuenta restringido a algunos números ve
        esos; una credencial de toda la cuenta ve todos los números del
        workspace. A diferencia de la lista, una clave de toda la cuenta NO se
        rechaza. Los tokens OAuth/MCP y las claves de cuenta necesitan
        `chat:read`.
      operationId: get_messages_unread_counts
      parameters:
        - name: whatsappNumberIds
          in: query
          required: false
          description: >-
            Opcional. Ids de WhatsAppNumber separados por comas (o repetidos),
            máximo 100. Si se omite: todos los números a los que llega la
            credencial.
          schema:
            type: string
          example: cmnum_01,cmnum_02
      responses:
        '200':
          description: Conteos
          content:
            application/json:
              schema:
                type: object
                properties:
                  byNumber:
                    type: array
                    items:
                      type: object
                      properties:
                        whatsappNumberId:
                          type: string
                        number:
                          type: string
                        displayName:
                          type:
                            - string
                            - 'null'
                        total:
                          type: integer
                  total:
                    type: integer
              example:
                byNumber:
                  - whatsappNumberId: cmnum_01
                    number: '5511999999999'
                    displayName: Suporte
                    total: 12
                  - whatsappNumberId: cmnum_02
                    number: '5511888888888'
                    displayName: null
                    total: 0
                total: 12
        '400':
          description: >-
            `TOO_MANY_NUMBERS`, `NUMBER_REQUIRED` (permiso por número sin un
            número) o `NUMBER_NOT_FOUND` (credencial no vinculada a ningún
            número)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              examples:
                tooMany:
                  summary: TOO_MANY_NUMBERS
                  value:
                    error: >-
                      whatsappNumberIds accepts at most 100 ids |
                      whatsappNumberIds aceita no máximo 100 ids
                    code: TOO_MANY_NUMBERS
                numberRequired:
                  summary: NUMBER_REQUIRED
                  value:
                    error: >-
                      Provide x-whatsapp-number-id for a per-number connection |
                      Envie o header x-whatsapp-number-id para uma conexão por
                      número
                    code: NUMBER_REQUIRED
        '401':
          description: >-
            Credencial ausente o inválida (`x-api-key` / `x-api-key-id` / token
            Bearer)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Invalid API key
        '403':
          description: >-
            `NUMBER_NOT_IN_GRANT` (un número indicado está fuera del alcance de
            la credencial) o `PERMISSION_DENIED` (rol sin `chat:read`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  This credential is not granted access to that WhatsApp number
                  | Esta credencial não tem acesso a esse número de WhatsApp
                code: NUMBER_NOT_IN_GRANT
        '404':
          description: Un número indicado no es un número de este workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  whatsappNumberIds names a number that is not a WhatsApp number
                  of this account | whatsappNumberIds indica um número que não é
                  um número de WhatsApp desta conta
                code: NUMBER_NOT_FOUND
                whatsappNumberIds:
                  - cmnum_99
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Tu API key ps_
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: Id de la API key (alternativa a x-api-key)

````

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