Instances

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.

POST
/paircode

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
AuthorizationBearer <token>

Per-user API token (UUID v4) sent as Authorization: Bearer <token>. Identifies the tenant and user.

In: header

Query Parameters

refresh?boolean

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"}