Ask for a code
curl -X POST https://www.chatrail.dev/v1/connections/shop/pair \
-H "Authorization: Bearer $CHATRAIL_API_KEY" -H "Content-Type: application/json" \
-d '{ "method": "code", "phone": "+447700900123" }'phone is the number being linked — WhatsApp sends the prompt to that phone. The response is a grant, not the code: fetch it once with GET /v1/connections/shop/qr/{grant_id}, which returns it with encoding: "pairing-code". Like a QR, the code is a pairing credential — whoever enters it links their device — so it is handed out once and never logged by ChatRail.
Enter it on the phone
WhatsApp → Linked devices → Link a device → Link with phone number instead, then type the code. The connection moves to connected and connection.connected is sent. The dashboard's pair dialog offers the same flow under Link with phone number instead. Requests are rate limited, since each code makes WhatsApp notify the phone.