Webhook Event: device.qr
Pairing StreamJSON payload schema dispatched in real-time with updated pairing QR code strings and Base64 images for custom client-side authentication screens.
Headless WhatsApp Pairing
Use this event if you are building your own white-labeled dashboard or custom frontend. As soon as a user starts pairing, Wahide streams the raw QR code and Base64 image directly to your webhook so you can render it on your screen in real time.
HTTP Endpoint
Authentication
| Header Key | Value | Required |
|---|---|---|
| Content-Type | application/json | Required |
| X-Wahide-Secret | whsec_live_... | Required |
Request Parameters
The request body must be formatted as JSON with the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
event | string | Required | Event identifier. Value is always 'device.qr'. example: device.qr |
device_id | string | Required | Unique WhatsApp device slot ID being paired. example: 01JPLAN0000000000000000001 |
timestamp | integer | Required | Unix epoch timestamp in seconds when the QR code frame was generated. example: 1725845000 |
data | object | Required | Container object holding raw QR string and image URI. |
data.qr_code | string | Required | Raw WhatsApp pairing string payload suitable for rendering with qrcode.js / react-qr-code. example: 2@XYZ123ABC456...==,DEF789...==,GHI012...== |
data.qr_image_url | string | Required | Base64 encoded Data URI image (data:image/png;base64,...) ready for direct <img src=...> rendering. example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA... |
data.attempt | integer | Required | Pairing QR regeneration attempt count (1 to 5). example: 1 |
data.expires_in | integer | Required | Validity lifetime of this QR code in seconds before a refresh frame is dispatched (typically 20 seconds). example: 20 |
Code Examples
curl -X POST https://api.your-business.com/webhook \
-H "Content-Type: application/json" \
-H "X-Wahide-Secret: whsec_live_9f8e7d6c5b4a3210fedcba9876543210" \
-d '{
"event": "device.qr",
"device_id": "01JPLAN0000000000000000001",
"timestamp": 1725845000,
"data": {
"qr_code": "2@XYZ123ABC456...==,DEF789...==,GHI012...==",
"qr_image_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"attempt": 1,
"expires_in": 20
}
}'Response Formats
Acknowledgment response confirming receipt of the QR stream frame.