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

# Solicitar sincronización del historial

> Solicita historial de mensajes anterior a un mensaje de referencia. El objeto `messageInfo` identifica el mensaje ancla (su JID `Chat`, el `ID` del mensaje, los indicadores de dirección y el `Timestamp`); los campos se deserializan desde el tipo `MessageInfo` de whatsmeow, así que las keys están en PascalCase y `Chat` es una **cadena** JID.



## OpenAPI

````yaml openapi.evolution-go.es.json POST /chat/history-sync
openapi: 3.1.0
info:
  title: Evolution GO Layer
  version: 1.0.0
  description: >-
    Pilot Status API Layer: Evolution GO. URL base
    `https://pilotstatus.com.br/api/layer/evolution-go`. Autentícate con el
    header `apikey` (tu clave `ps_` de Pilot Status); `Authorization: Bearer` no
    se acepta. Los endpoints de instancia/sesión NO están disponibles a través
    del layer.
servers:
  - url: https://pilotstatus.com.br/api/layer/evolution-go
security:
  - apiKey: []
tags:
  - name: Call (voice)
  - name: Chat
  - name: Community
  - name: Group
  - name: Label
  - name: Message
  - name: Newsletter / Channels
  - name: Send (load-balanced)
  - name: User / Contacts
paths:
  /chat/history-sync:
    post:
      tags:
        - Chat
      summary: Solicitar sincronización del historial
      description: >-
        Solicita historial de mensajes anterior a un mensaje de referencia. El
        objeto `messageInfo` identifica el mensaje ancla (su JID `Chat`, el `ID`
        del mensaje, los indicadores de dirección y el `Timestamp`); los campos
        se deserializan desde el tipo `MessageInfo` de whatsmeow, así que las
        keys están en PascalCase y `Chat` es una **cadena** JID.
      operationId: post__chat_history_sync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                messageInfo:
                  type: object
                  description: >-
                    Mensaje de referencia antes del cual sincronizar el
                    historial. Contiene `Chat` (cadena JID), `ID` (ID del
                    mensaje), `IsFromMe` (booleano), `IsGroup` (booleano) y
                    `Timestamp` (RFC 3339).
                  example:
                    Chat: 5511999999999@s.whatsapp.net
                    ID: 3EB0C767D82B0A1B2C3D
                    IsFromMe: false
                    IsGroup: false
                    Timestamp: '2026-07-09T12:00:00Z'
                count:
                  type: integer
                  description: >-
                    Cantidad de mensajes que se obtendrán antes del mensaje de
                    referencia.
                  example: 50
              required:
                - messageInfo
      responses:
        '200':
          description: 'Éxito: cuerpo de respuesta nativo del proveedor.'
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Envelope que envuelve el SendResponse de whatsmeow del mensaje
                  de solicitud de sincronización de historial peer que se envió
                  al chat.
                properties:
                  message:
                    type: string
                    description: >-
                      Estado de la operación, siempre "success" en una respuesta
                      200.
                  data:
                    type: object
                    description: >-
                      whatsmeow.SendResponse del mensaje de solicitud de
                      sincronización de historial enviado. Los nombres de campo
                      están en PascalCase (el struct no tiene tags JSON).
                    properties:
                      Timestamp:
                        type: string
                        description: >-
                          Timestamp del servidor del mensaje de solicitud de
                          sincronización de historial enviado (RFC3339).
                      ID:
                        type: string
                        description: >-
                          ID del mensaje de solicitud de sincronización de
                          historial enviado.
                      ServerID:
                        type: integer
                        description: >-
                          ID de mensaje especificado por el servidor; solo es
                          distinto de cero para mensajes de newsletter, de lo
                          contrario 0.
                      DebugTimings:
                        type: object
                        description: >-
                          Duraciones del manejo del mensaje por fase, en
                          nanosegundos, usadas para depuración.
                        properties:
                          LIDFetch:
                            type: integer
                            description: Duración (ns) obteniendo el LID.
                          Queue:
                            type: integer
                            description: Duración (ns) en cola antes del envío.
                          Marshal:
                            type: integer
                            description: Duración (ns) serializando el mensaje.
                          GetParticipants:
                            type: integer
                            description: Duración (ns) resolviendo participantes.
                          GetDevices:
                            type: integer
                            description: Duración (ns) resolviendo dispositivos.
                          GroupEncrypt:
                            type: integer
                            description: Duración (ns) del cifrado de grupo.
                          PeerEncrypt:
                            type: integer
                            description: Duración (ns) del cifrado peer.
                          Send:
                            type: integer
                            description: Duración (ns) del envío.
                          Resp:
                            type: integer
                            description: Duración (ns) esperando la respuesta del servidor.
                          Retry:
                            type: integer
                            description: Duración (ns) dedicada a reintentos.
                      Sender:
                        type: string
                        description: >-
                          La identidad (JID de número de teléfono o LID) con la
                          que se envió el mensaje; serializada como cadena JID.
              example:
                message: success
                data:
                  Timestamp: '2026-07-10T14:23:45Z'
                  ID: 3EB0C767D26A1D8A2C5B
                  ServerID: 0
                  DebugTimings:
                    LIDFetch: 0
                    Queue: 152340
                    Marshal: 210500
                    GetParticipants: 0
                    GetDevices: 318700
                    GroupEncrypt: 0
                    PeerEncrypt: 402100
                    Send: 5487300
                    Resp: 18342900
                    Retry: 0
                  Sender: 5511999999999@s.whatsapp.net
        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 header `apikey`: el token de la
        instancia de Evolution GO que migraste en el dashboard (Números →
        Conectar → Migrar), o el token propio de la instancia de Pilot Status.
        Una API key `ps_` de Pilot Status NO se acepta (404 `Instance not
        found`). Este es el único header que lee el layer de Evolution GO:
        `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.