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

# Login perangkat dengan kode pemasangan

> Mulai login dengan kode pemasangan untuk slot perangkat tertentu dan kembalikan kode untuk dimasukkan di ponsel. Setara dengan `GET /app/login-with-code` menggunakan `X-Device-Id: <device_id>`, dengan perangkat diambil dari path.



## OpenAPI

````yaml /id/openapi.yml post /devices/{device_id}/login/code
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/{device_id}/login/code:
    post:
      tags:
        - device
      summary: Login perangkat dengan kode pemasangan
      description: >-
        Mulai login dengan kode pemasangan untuk slot perangkat tertentu dan
        kembalikan kode untuk dimasukkan di ponsel. Setara dengan `GET
        /app/login-with-code` menggunakan `X-Device-Id: <device_id>`, dengan
        perangkat diambil dari path.
      operationId: loginDeviceWithCode
      parameters:
        - name: device_id
          in: path
          required: true
          schema:
            type: string
          description: ID perangkat
        - name: phone
          in: query
          required: true
          schema:
            type: string
          example: '628912344551'
          description: Nomor telepon yang akan dipasangkan
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceLoginWithCodeResponse'
        '404':
          description: Perangkat tidak ditemukan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
        '500':
          description: Kesalahan Internal Server
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInternalServer'
components:
  schemas:
    DeviceLoginWithCodeResponse:
      type: object
      properties:
        code:
          type: string
          example: SUCCESS
        message:
          type: string
          example: Login with code started
        status:
          type: integer
          example: 200
        results:
          type: object
          properties:
            device_id:
              type: string
              example: my-device-id
            pair_code:
              type: string
              example: ABCD-1234
    ErrorNotFound:
      type: object
      properties:
        code:
          type: string
          example: 404
          description: Kode Status HTTP
        message:
          type: string
          example: Chat not found
          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

- [Login dengan kode pemasangan](https://gowa-docs.mintlify.site/id/api-reference/app/login-dengan-kode-pemasangan.md)
- [Login perangkat dengan kode QR](https://gowa-docs.mintlify.site/id/api-reference/device/login-perangkat-dengan-kode-qr.md)
- [Konfirmasi kode pemasangan passkey](https://gowa-docs.mintlify.site/id/api-reference/app/konfirmasi-kode-pemasangan-passkey.md)
- [Metrik server](https://gowa-docs.mintlify.site/id/api-reference/metrics.md)
- [Mulai Cepat](https://gowa-docs.mintlify.site/id/quickstart.md)


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