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

# Tambah perangkat baru

> Buat slot perangkat baru untuk pengelolaan multi-perangkat



## OpenAPI

````yaml /id/openapi.yml post /devices
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:
  /devices:
    post:
      tags:
        - device
      summary: Tambah perangkat baru
      description: Buat slot perangkat baru untuk pengelolaan multi-perangkat
      operationId: addDevice
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: string
                  description: >-
                    ID perangkat kustom opsional. Jika tidak diberikan, ID akan
                    dibuat secara otomatis.
                  example: my-custom-device-id
                webhook_url:
                  type: string
                  description: >-
                    URL webhook khusus perangkat yang opsional. Jika disetel,
                    event untuk perangkat ini akan dikirim ke sini sebagai
                    pengganti webhook global.
                  example: https://device-webhook.example.com/handler
                webhook_secret:
                  type: string
                  description: >-
                    Secret opsional yang digunakan untuk menandatangani payload
                    webhook khusus perangkat (HMAC).
                  example: super-secret-key
                webhook_events:
                  type: string
                  description: >-
                    Daftar nama event opsional yang dipisahkan koma untuk
                    diteruskan ke webhook khusus perangkat. Kosong berarti semua
                    event.
                  example: message,message.ack
                webhook_insecure_skip_verify:
                  type: boolean
                  description: >-
                    Opsional. Lewati verifikasi sertifikat TLS saat mengirim ke
                    webhook khusus perangkat.
                  example: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceAddResponse'
        '400':
          description: Permintaan Tidak Valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
        '500':
          description: Kesalahan Internal Server
          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 webhook khusus perangkat yang dikembalikan jika diberikan
                saat pembuatan
              example: https://device-webhook.example.com/handler
            webhook_secret:
              type: string
              description: >-
                Rahasia webhook khusus perangkat yang dikembalikan jika
                diberikan saat pembuatan
              example: super-secret-key
            webhook_events:
              type: string
              description: >-
                Daftar event yang diizinkan khusus perangkat yang dikembalikan
                jika diberikan saat pembuatan
              example: message,message.ack
            webhook_insecure_skip_verify:
              type: boolean
              description: >-
                Pengaturan verifikasi TLS khusus perangkat yang dikembalikan
                jika diberikan saat pembuatan
              example: false
    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
    ErrorInternalServer:
      type: object
      properties:
        code:
          type: string
          example: INTERNAL_SERVER_ERROR
          description: SYSTEM_CODE_ERROR
        message:
          type: string
          example: you are not loggin
          description: Pesan kesalahan terperinci
        results:
          type: object
          example: null
          description: data tambahan
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

## Related topics

- [Multi-Perangkat & Pemilihan Perangkat](https://gowa-docs.mintlify.site/id/concepts/multidevice.md)
- [Buat grup dan tambahkan peserta](https://gowa-docs.mintlify.site/id/api-reference/group/buat-grup-dan-tambahkan-peserta.md)
- [Tambahkan lebih banyak peserta ke grup](https://gowa-docs.mintlify.site/id/api-reference/group/tambahkan-lebih-banyak-peserta-ke-grup.md)
- [Mulai Cepat](https://gowa-docs.mintlify.site/id/quickstart.md)
- [Autentikasi](https://gowa-docs.mintlify.site/id/authentication.md)


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