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

# مزامنة سجل الرسائل إلى Chatwoot

> يفتح مزامنة خلفية لسجل رسائل WhatsApp إلى Chatwot.
سيتم استيراد الرسائل من عدد الأيام المكونة .
نقطة النهاية هذه تتطلب CHATWOOT_ENABLED=true في التكوين.




## OpenAPI

````yaml /ar/openapi.yml post /chatwoot/sync
openapi: 3.0.0
info:
  title: واتسآب API متعدد الأجهزة
  version: 9.7.0
  description: >
    يتم استخدام هذا API لإرسال أي تطبيق عبر API.


    لوحة المعلومات هي مشروع منفصل (gowa-ui)؛ يقوم الخادم بتنزيل أحدث أصول
    الإصدار

    ويخدمه في `/` (أو يرجع لافتة JSON عندما

    APP_UI_ENABLED=false).


    تحديد الجهاز:

    - إرسال `X-Device-Id` على جميع مكالمات REST على نطاق الجهاز.

    - WebSocket: الاتصال بـ `/w?جهاز_id=<id>`.

    - مصادقة WebSocket (عندما يتم تمكين المصادقة الأساسية): المتصفحات لا يمكن
    تعيين
      رأس التفويض على اتصالات WebSocket ، كذلك اجتاز
      `&authorization=<base64(user:pass)>` في سلسلة الاستفسار. استخدم TLS في إنتاج
      لأن بيانات الاعتماد مرئية في عنوان URL.
servers:
  - url: http://localhost:3000
security:
  - basicAuth: []
tags:
  - name: app
    description: الاتصال الأولي بخادم Whatsapp
  - name: device
    description: إدارة الجهاز لدعم الأجهزة المتعددة
  - name: user
    description: الحصول على المعلومات
  - name: send
    description: إرسال رسالة (نص/صورة/ملف/فيديو).
  - name: message
    description: التلاعب بالرسالة (إلغائ/react/update).
  - name: call
    description: إدارة المكالمات (رفض المكالمات الواردة)
  - name: chat
    description: محادثات الدردشة والرسائل
  - name: group
    description: إعداد المجموعة
  - name: newsletter
    description: إعداد النشرة الإخبارية
  - name: chatwoot
    description: تكامل Chatwoot لدعم العملاء
paths:
  /chatwoot/sync:
    post:
      tags:
        - chatwoot
      summary: مزامنة سجل الرسائل إلى Chatwoot
      description: |
        يفتح مزامنة خلفية لسجل رسائل WhatsApp إلى Chatwot.
        سيتم استيراد الرسائل من عدد الأيام المكونة .
        نقطة النهاية هذه تتطلب CHATWOOT_ENABLED=true في التكوين.
      operationId: chatwootSyncHistory
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: string
                  description: >-
                    معرف الجهاز للمزامنة (يستخدم CHATWOOT_DEVICE_ID إذا لم يتم
                    تحديده)
                days_limit:
                  type: integer
                  default: 3
                  description: عدد أيام التاريخ المراد مزامنتها
                include_media:
                  type: boolean
                  default: true
                  description: تضمين مرفقات الوسائط في المزامنة
                include_groups:
                  type: boolean
                  default: true
                  description: تضمين دردشة جماعية في المزامنة
      responses:
        '200':
          description: بدأت المزامنة بنجاح
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatwootSyncResponse'
        '400':
          description: طلب خاطئ (لم يتم العثور على الجهاز أو لم يتم تكوين Chatwoot)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
        '409':
          description: المزامنة قيد التقدم بالفعل
          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: 0696d163-67fa-4e2c-94b6-50fbddcf4a92
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: رمز حالة HTTP
        message:
          type: string
          example: field cannot be blank
          description: تفاصيل رسالة الخطأ
        results:
          type: object
          example: null
          description: بيانات إضافية
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

## Related topics

- [تكامل Chatwoot](https://gowa-docs.mintlify.site/ar/integrations/chatwoot.md)
- [طلب سجل محادثة أقدم من الهاتف](https://gowa-docs.mintlify.site/ar/api-reference/chat/طلب-سجل-محادثة-أقدم-من-الهاتف.md)
- [إرسال الرسائل](https://gowa-docs.mintlify.site/ar/examples/sending-messages.md)
- [تلقي الرسائل](https://gowa-docs.mintlify.site/ar/examples/receiving-messages.md)
- [نقطة نهاية Chatwoot للجهاز](https://gowa-docs.mintlify.site/ar/api-reference/chatwoot/نقطة-نهاية-chatwoot-للجهاز.md)


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