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

# Solicitar sincronização de histórico

> Solicita o histórico de mensagens mais antigas anteriores a uma mensagem de referência. O objeto `messageInfo` identifica a mensagem âncora (seu JID `Chat`, o `ID` da mensagem, as flags de direção e o `Timestamp`); os campos são desserializados a partir do tipo `MessageInfo` do whatsmeow, portanto as chaves são PascalCase e `Chat` é uma **string** JID.



## OpenAPI

````yaml openapi.evolution-go.pt.json POST /chat/history-sync
openapi: 3.1.0
info:
  title: Evolution GO Layer
  version: 1.0.0
  description: >-
    Camada de API do Pilot Status — Evolution GO. Base URL
    `https://pilotstatus.com.br/api/layer/evolution-go`. Autentique com o header
    `apikey` (sua chave `ps_` do Pilot Status) ou `Authorization: Bearer`.
    Endpoints de instância/sessão NÃO estão disponíveis na camada.
servers:
  - url: https://pilotstatus.com.br/api/layer/evolution-go
security:
  - apiKey: []
tags:
  - name: Chamada (voz)
  - name: Chat
  - name: Comunidade
  - name: Grupo
  - name: Etiqueta (label)
  - name: Mensagem
  - name: Newsletter / Canais
  - name: Envio (balanceado)
  - name: Usuário / Contatos
paths:
  /chat/history-sync:
    post:
      tags:
        - Chat
      summary: Solicitar sincronização de histórico
      description: >-
        Solicita o histórico de mensagens mais antigas anteriores a uma mensagem
        de referência. O objeto `messageInfo` identifica a mensagem âncora (seu
        JID `Chat`, o `ID` da mensagem, as flags de direção e o `Timestamp`); os
        campos são desserializados a partir do tipo `MessageInfo` do whatsmeow,
        portanto as chaves são PascalCase e `Chat` é uma **string** JID.
      operationId: post__chat_history_sync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                messageInfo:
                  type: object
                  description: >-
                    Mensagem de referência antes da qual sincronizar o
                    histórico. Contém `Chat` (string JID), `ID` (id da
                    mensagem), `IsFromMe` (boolean), `IsGroup` (boolean) e
                    `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: >-
                    Número de mensagens a buscar antes da mensagem de
                    referência.
                  example: 50
              required:
                - messageInfo
      responses:
        '200':
          description: Sucesso — corpo de resposta nativo do provedor.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Envelope wrapping the whatsmeow SendResponse for the peer
                  history-sync request message that was sent to the chat.
                properties:
                  message:
                    type: string
                    description: Operation status, always "success" on a 200 response.
                  data:
                    type: object
                    description: >-
                      whatsmeow.SendResponse for the sent history-sync request
                      message. Field names are PascalCase (struct has no JSON
                      tags).
                    properties:
                      Timestamp:
                        type: string
                        description: >-
                          Server timestamp of the sent history-sync request
                          message (RFC3339).
                      ID:
                        type: string
                        description: ID of the sent history-sync request message.
                      ServerID:
                        type: integer
                        description: >-
                          Server-specified message ID; only non-zero for
                          newsletter messages, otherwise 0.
                      DebugTimings:
                        type: object
                        description: >-
                          Per-phase message handling durations in nanoseconds,
                          used for debugging.
                        properties:
                          LIDFetch:
                            type: integer
                            description: Duration (ns) fetching the LID.
                          Queue:
                            type: integer
                            description: Duration (ns) queued before sending.
                          Marshal:
                            type: integer
                            description: Duration (ns) marshalling the message.
                          GetParticipants:
                            type: integer
                            description: Duration (ns) resolving participants.
                          GetDevices:
                            type: integer
                            description: Duration (ns) resolving devices.
                          GroupEncrypt:
                            type: integer
                            description: Duration (ns) of group encryption.
                          PeerEncrypt:
                            type: integer
                            description: Duration (ns) of peer encryption.
                          Send:
                            type: integer
                            description: Duration (ns) of the send.
                          Resp:
                            type: integer
                            description: Duration (ns) waiting for the server response.
                          Retry:
                            type: integer
                            description: Duration (ns) spent on retries.
                      Sender:
                        type: string
                        description: >-
                          The identity (phone-number or LID JID) the message was
                          sent with; serialized as a JID string.
              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: Erro — erro do provedor ou da camada.
          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>`.

````