Generate phone pairing code
Generates an 8-character WhatsApp pairing code so the WUTS device can be linked by entering it on the phone instead of scanning a QR. Returns a cached code while it is still valid unless a refresh is requested.
Generates an 8-character WhatsApp pairing code so the WUTS device can be linked by entering it on the phone instead of scanning a QR. Returns a cached code while it is still valid unless a refresh is requested.
Authorization
bearerAuth Per-user API token (UUID v4) sent as Authorization: Bearer <token>. Identifies the tenant and user.
In: header
Query Parameters
When true, forces a new pair code and ignores the cache. Aliases: force_refresh, force_new.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/paircode" \ -H "Content-Type: application/json" \ -d '{ "phone": "5511999999999", "device_id": "wuts-device-001", "reuse_cache": false }'{ "success": true, "data": { "code": "ABCD-1234", "phone": "5511999999999", "expires_in": 300, "cached": false, "instructions": "Digite este código no WhatsApp: Configurações > Aparelhos conectados > Conectar um aparelho > Conectar com número de telefone" }}{ "success": false, "error": "invalid phone number format"}{ "success": false, "error": "unauthorized"}{ "success": false, "error": "failed to generate pair code: timeout waiting for WhatsApp QR event"}Disconnect device session POST
Disconnects the WUTS device from WhatsApp and fires the device-disconnected webhook. The stored credentials are preserved, so the device can later reconnect via POST /connect without re-pairing.
Generate pairing QR code GET
Generates a WhatsApp pairing QR code so the WUTS device can be linked by scanning. Returns a freshly cached QR by default; pass refresh flags to force regeneration. Refuses devices that are already paired or connected.