Devices

Devices

Tambah dan kelola koneksi WhatsApp Anda.

Device adalah nomor WhatsApp yang terhubung ke akun WAPIZ Anda. Setiap device memiliki ID unik yang digunakan untuk semua operasi pengiriman pesan.

Batas device per paket:

PaketMaks device
Free / Lite1
Regular ke atas3

GET /api/devices

Ambil daftar semua device milik akun yang sedang login.

curl /api/devices -b "wa_token=<token>"

Response 200

[
  {
    "id": "uuid",
    "userId": "user-id",
    "deviceId": "device-uuid",
    "label": "Bot Marketing",
    "webhookUrl": null,
    "createdAt": "2024-01-01T00:00:00.000Z"
  }
]

POST /api/devices

Tambah device baru dan hubungkan ke akun.

Request body

FieldTypeRequiredDescription
labelstringNoNama device (default: "Device Baru")
curl -X POST /api/devices \
  -H "Content-Type: application/json" \
  -b "wa_token=<token>" \
  -d '{"label":"Bot Marketing"}'

Response 201

{
  "id": "uuid",
  "userId": "user-id",
  "deviceId": "device-uuid",
  "label": "Bot Marketing",
  "webhookUrl": null,
  "createdAt": "2024-01-01T00:00:00.000Z"
}

Errors

StatusPesan
401Unauthorized
403Paket Free maksimal 1 device

DELETE /api/devices/:id

Hapus device dan putuskan koneksi WhatsApp.

id adalah ID device dari response list devices (device.id).

curl -X DELETE /api/devices/<id> -b "wa_token=<token>"

Response 200

{ "ok": true }

GET /api/devices/:id/qr

Ambil QR code untuk menghubungkan nomor WhatsApp. Mengembalikan gambar PNG jika device belum terhubung, atau JSON jika sudah login.

curl /api/devices/<id>/qr \
  -b "wa_token=<token>" \
  --output qr.png

Buka qr.png lalu scan menggunakan WhatsApp di HP Anda (WhatsApp → Perangkat Tertaut → Tautkan Perangkat).

Poll endpoint ini hingga status device menjadi logged_in. QR code kedaluwarsa sekitar 20 detik.


GET /api/devices/:id/status

Cek status koneksi device.

curl /api/devices/<id>/status -b "wa_token=<token>"

Response 200

{
  "connected": true,
  "loggedIn": true,
  "status": "logged_in"
}
Nilai statusKeterangan
logged_inTerhubung dan siap digunakan
connectedTerhubung tapi belum login
disconnectedTidak terhubung

PATCH /api/devices/:id/webhook

Set atau hapus URL webhook untuk device. WAPIZ akan mengirimkan event pesan masuk ke URL ini secara real-time.

Request body

FieldTypeKeterangan
webhookUrlstring | nullURL tujuan webhook. Kirim null atau kosongkan untuk menghapus.
curl -X PATCH /api/devices/<id>/webhook \
  -H "Content-Type: application/json" \
  -b "wa_token=<token>" \
  -d '{"webhookUrl":"https://server-anda.com/webhook"}'

Response 200

{
  "ok": true,
  "webhookUrl": "https://server-anda.com/webhook"
}

© 2026 WAPIZ. Unofficial WhatsApp API.