> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wazzapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync Conversation History

> Merge WuzAPI chat history into this conversation (idempotent).

History rows are identified by WhatsApp message id and **never** treated as
brand-new inbound events: no unread bump, no agent auto-reply, no
``message.received`` webhooks. Existing engine messages are skipped.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/conversations/{conversation_id}/sync-history
openapi: 3.1.0
info:
  title: wazzapi Public API
  description: >-
    Public API surface for external API-key clients. Only stable /api/v1
    endpoints are included.


    ## Webhook deliveries

    This reference also includes the webhook requests Wazzapi sends to your
    endpoint for incoming messages, message status updates, and device status
    changes. See the `Incoming webhooks` section in the sidebar for headers,
    payload fields, and concrete examples.
  version: 1.0.0
servers: []
security: []
tags:
  - name: Incoming webhooks
    description: >-
      POST deliveries that Wazzapi sends to your webhook endpoint after you
      subscribe to supported events. Verify the signature against the raw body
      and return a 2xx response quickly.
paths:
  /api/v1/conversations/{conversation_id}/sync-history:
    post:
      tags:
        - conversations
      summary: Sync Conversation History
      description: >-
        Merge WuzAPI chat history into this conversation (idempotent).


        History rows are identified by WhatsApp message id and **never** treated
        as

        brand-new inbound events: no unread bump, no agent auto-reply, no

        ``message.received`` webhooks. Existing engine messages are skipped.
      operationId: >-
        sync_conversation_history_api_v1_conversations__conversation_id__sync_history_post
      parameters:
        - name: conversation_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Conversation Id
        - name: Authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/ConversationHistorySyncRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversationHistorySyncResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ConversationHistorySyncRequest:
      properties:
        limit:
          type: integer
          maximum: 1000
          minimum: 1
          title: Limit
          default: 100
        request_remote_sync:
          type: boolean
          title: Request Remote Sync
          default: false
        remote_sync_count:
          type: integer
          maximum: 1000
          minimum: 1
          title: Remote Sync Count
          default: 50
      type: object
      title: ConversationHistorySyncRequest
      description: Pull WuzAPI chat history into this conversation (idempotent merge).
    ConversationHistorySyncResponse:
      properties:
        conversation_id:
          type: string
          format: uuid
          title: Conversation Id
        remote_jid:
          type: string
          title: Remote Jid
        fetched:
          type: integer
          title: Fetched
        inserted:
          type: integer
          title: Inserted
        skipped_existing:
          type: integer
          title: Skipped Existing
        skipped_invalid:
          type: integer
          title: Skipped Invalid
        message:
          type: string
          title: Message
      type: object
      required:
        - conversation_id
        - remote_jid
        - fetched
        - inserted
        - skipped_existing
        - skipped_invalid
        - message
      title: ConversationHistorySyncResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````