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

# Sinkronkan riwayat pesan ke Chatwoot

> Memulai sinkronisasi riwayat pesan WhatsApp ke Chatwoot di latar belakang.
Pesan dari jumlah hari yang dikonfigurasi akan diimpor.
Endpoint ini memerlukan CHATWOOT_ENABLED=true dalam konfigurasi.




## OpenAPI

````yaml /id/openapi.yml post /chatwoot/sync
openapi: 3.0.0
info:
  title: WhatsApp API MultiDevice
  version: 9.7.0
  description: >
    API ini digunakan untuk mengirim pesan WhatsApp melalui API.


    Dashboard web merupakan proyek terpisah (gowa-ui); server mengunduh aset
    rilis

    terbarunya dan menyajikannya di `/` (atau mengembalikan banner JSON saat

    APP_UI_ENABLED=false).


    Cakupan perangkat:

    - Kirim `X-Device-Id` pada semua panggilan REST yang memiliki cakupan
    perangkat.

    - WebSocket: hubungkan ke `/ws?device_id=<id>`.

    - Autentikasi WebSocket (saat autentikasi dasar diaktifkan): browser tidak
    dapat menyetel
      header Authorization pada koneksi WebSocket, sehingga sertakan juga
      `&authorization=<base64(user:pass)>` dalam query string. Gunakan TLS di
      produksi karena kredensial terlihat di URL.
servers:
  - url: http://localhost:3000
security:
  - basicAuth: []
tags:
  - name: app
    description: Koneksi awal ke server WhatsApp
  - name: device
    description: Pengelolaan perangkat untuk dukungan multi-perangkat
  - name: user
    description: Mengambil informasi
  - name: send
    description: Kirim pesan (teks/gambar/berkas/video).
  - name: message
    description: Manipulasi pesan (cabut/beri reaksi/perbarui).
  - name: call
    description: Pengelolaan panggilan (tolak panggilan masuk)
  - name: chat
    description: Percakapan chat dan perpesanan
  - name: group
    description: Pengaturan grup
  - name: newsletter
    description: Pengaturan newsletter
  - name: chatwoot
    description: Integrasi Chatwoot untuk dukungan pelanggan
paths:
  /chatwoot/sync:
    post:
      tags:
        - chatwoot
      summary: Sinkronkan riwayat pesan ke Chatwoot
      description: >
        Memulai sinkronisasi riwayat pesan WhatsApp ke Chatwoot di latar
        belakang.

        Pesan dari jumlah hari yang dikonfigurasi akan diimpor.

        Endpoint ini memerlukan CHATWOOT_ENABLED=true dalam konfigurasi.
      operationId: chatwootSyncHistory
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: string
                  description: >-
                    ID perangkat yang disinkronkan (menggunakan
                    CHATWOOT_DEVICE_ID jika tidak ditentukan)
                days_limit:
                  type: integer
                  default: 3
                  description: Jumlah hari riwayat yang disinkronkan
                include_media:
                  type: boolean
                  default: true
                  description: Sertakan lampiran media dalam sinkronisasi
                include_groups:
                  type: boolean
                  default: true
                  description: Sertakan chat grup dalam sinkronisasi
      responses:
        '200':
          description: Sinkronisasi berhasil dimulai
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatwootSyncResponse'
        '400':
          description: >-
            Permintaan Tidak Valid (perangkat tidak ditemukan atau Chatwoot
            belum dikonfigurasi)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
        '409':
          description: Sinkronisasi sedang berlangsung
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 409
                  code:
                    type: string
                    example: SYNC_ALREADY_RUNNING
                  message:
                    type: string
                    example: A sync is already in progress for this device
                  results:
                    type: object
                    properties:
                      progress: 779a5fd3-f3a2-4632-a5fb-44e741932eab
components:
  schemas:
    ChatwootSyncResponse:
      type: object
      properties:
        status:
          type: integer
          example: 200
        code:
          type: string
          example: SYNC_STARTED
        message:
          type: string
          example: History sync initiated in background
        results:
          type: object
          properties:
            device_id:
              type: string
              example: my-device-id
            days_limit:
              type: integer
              example: 3
            include_media:
              type: boolean
              example: true
            include_groups:
              type: boolean
              example: true
    ErrorBadRequest:
      type: object
      properties:
        code:
          type: string
          example: 400
          description: Kode Status HTTP
        message:
          type: string
          example: field cannot be blank
          description: Pesan kesalahan terperinci
        results:
          type: object
          example: null
          description: data tambahan
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

## Related topics

- [Integrasi Chatwoot](https://gowa-docs.mintlify.site/id/integrations/chatwoot.md)
- [Menerima pesan](https://gowa-docs.mintlify.site/id/examples/receiving-messages.md)
- [Minta riwayat chat yang lebih lama dari ponsel](https://gowa-docs.mintlify.site/id/api-reference/chat/minta-riwayat-chat-yang-lebih-lama-dari-ponsel.md)
- [Endpoint webhook Chatwoot per perangkat](https://gowa-docs.mintlify.site/id/api-reference/chatwoot/endpoint-webhook-chatwoot-per-perangkat.md)
- [Buat atau perbarui konfigurasi Chatwoot perangkat](https://gowa-docs.mintlify.site/id/api-reference/chatwoot/buat-atau-perbarui-konfigurasi-chatwoot-perangkat.md)


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