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

# Request history sync

> Requests older message history from before a reference message. The `messageInfo` object identifies the anchor message (its `Chat` JID, message `ID`, direction flags, and `Timestamp`); fields are unmarshalled from the whatsmeow `MessageInfo` type, so keys are PascalCase and `Chat` is a JID **string**.



## OpenAPI

````yaml openapi.evolution-go.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. Base URL
    `https://pilotstatus.com.br/api/layer/evolution-go`. Authenticate with the
    `apikey` header (your Pilot Status `ps_` key) or `Authorization: Bearer`.
    Instance/session endpoints are NOT available through the 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: Request history sync
      description: >-
        Requests older message history from before a reference message. The
        `messageInfo` object identifies the anchor message (its `Chat` JID,
        message `ID`, direction flags, and `Timestamp`); fields are unmarshalled
        from the whatsmeow `MessageInfo` type, so keys are PascalCase and `Chat`
        is a JID **string**.
      operationId: post__chat_history_sync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                messageInfo:
                  type: object
                  description: >-
                    Reference message to sync history before. Contains `Chat`
                    (JID string), `ID` (message id), `IsFromMe` (boolean),
                    `IsGroup` (boolean), and `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: Number of messages to fetch before the reference message.
                  example: 50
              required:
                - messageInfo
      responses:
        '200':
          description: Success — provider-native response body.
          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: 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>`.

````