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

# إضافة جهاز جديد

> إنشاء فتحة جهاز جديد لإدارة أجهزة متعددة



## OpenAPI

````yaml /ar/openapi.yml post /devices
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:
  /devices:
    post:
      tags:
        - device
      summary: إضافة جهاز جديد
      description: إنشاء فتحة جهاز جديد لإدارة أجهزة متعددة
      operationId: addDevice
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: string
                  description: >-
                    رقم تعريف الجهاز المخصص اختياري. إذا لم يتم تقديم واحد سيتم
                    إنشاؤه.
                  example: my-custom-device-id
                webhook_url:
                  type: string
                  description: >-
                    رابط ويب هوك محدد للجهاز اختياري. إذا تم تعيينه، سيتم إرسال
                    الأحداث لهذا الجهاز إلى هنا بدلاً من الويبوك.
                  example: https://device-webhook.example.com/handler
                webhook_secret:
                  type: string
                  description: >-
                    السر الاختياري المستخدم لتسجيل حمولات webhook الخاصة بجهاز
                    محدد (HMAC).
                  example: super-secret-key
                webhook_events:
                  type: string
                  description: >-
                    قائمة اختيارية مفصولة بفواصل بأسماء الأحداث المراد إرسالها
                    إلى webhook. فارغة تعني جميع الأحداث.
                  example: message,message.ack
                webhook_insecure_skip_verify:
                  type: boolean
                  description: اختياري. تخطي التحقق من شهادة TLS عند التسليم إلى webhook.
                  example: false
      responses:
        '200':
          description: حسناً
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceAddResponse'
        '400':
          description: طلب خاطئ
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
        '500':
          description: خطأ خادم داخلي
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInternalServer'
components:
  schemas:
    DeviceAddResponse:
      type: object
      properties:
        code:
          type: string
          example: SUCCESS
        message:
          type: string
          example: Device added
        status:
          type: integer
          example: 200
        results:
          type: object
          properties:
            id:
              type: string
              example: my-device-id
            display_name:
              type: string
              example: John Doe
            state:
              type: string
              enum:
                - disconnected
                - connecting
                - connected
                - logged_in
              example: disconnected
            jid:
              type: string
              example: 628123456789@s.whatsapp.net
            created_at:
              type: string
              format: date-time
              example: '2024-01-01T00:00:00Z'
            webhook_url:
              type: string
              description: عنوان URL الخاص بجهاز ويب هوك عندما يتم تقديمه عند الإنشاء
              example: https://device-webhook.example.com/handler
            webhook_secret:
              type: string
              description: تردد سر webhook الخاص بالجهاز عندما يتم تقديمه عند الإنشاء
              example: super-secret-key
            webhook_events:
              type: string
              description: >-
                قائمة الأحداث البيضاء الخاصة بالجهاز عندما يتم توفيرها عند
                الإنشاء
              example: message,message.ack
            webhook_insecure_skip_verify:
              type: boolean
              description: إعدادات التحقق TLS الخاصة بجهاز محدد عندما يتم توفيرها عند إنشاء
              example: false
    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: بيانات إضافية
    ErrorInternalServer:
      type: object
      properties:
        code:
          type: string
          example: INTERNAL_SERVER_ERROR
          description: SYSTEM_CODE_ERROR
        message:
          type: string
          example: you are not loggin
          description: تفاصيل رسالة الخطأ
        results:
          type: object
          example: null
          description: بيانات إضافية
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

## Related topics

- [إضافة المزيد من المشاركين إلى المجموعة](https://gowa-docs.mintlify.site/ar/api-reference/group/إضافة-المزيد-من-المشاركين-إلى-المجموعة.md)
- [إزالة جهاز](https://gowa-docs.mintlify.site/ar/api-reference/device/إزالة-جهاز.md)
- [اختيار الأجهزة المتعددة و الأجهزة](https://gowa-docs.mintlify.site/ar/concepts/multidevice.md)
- [الوب](https://gowa-docs.mintlify.site/ar/concepts/webhooks.md)
- [إرسال مجدول](https://gowa-docs.mintlify.site/ar/examples/scheduled-sends.md)


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