Request a WhatsApp phone number without forcing disclosure
Use the native number-request and own-number sharing methods, with the recipient keeping control of their response.
OpenWA 5.5 exposes WhatsApp's native phone-number request for direct LID chats. The recipient chooses whether to share. Sending the request doesn't reveal a hidden number or force disclosure.
Choose SDK or Easy API
Use the tabs below to choose an embedded Node.js SDK or an HTTP client. SDK examples assume a ready client. For Easy API, start the server, scan its QR, and use the printed address. Set these variables in the shell that runs your examples:
export OPENWA_API_URL='http://127.0.0.1:8080'export WA_API_KEY='REPLACE_WITH_YOUR_API_KEY'npx @open-wa/wa-automate@5.5.1 \ --host 127.0.0.1 --port 8080 --api-key "$WA_API_KEY"Python examples use requests: install it with python -m pip install requests. JavaScript examples use Node.js 22.21.1 or later and its built-in fetch. Keep the API key on your application server. Method responses contain { success: true, data }; the examples read data. The API explorer at /api-docs/ lists your server's routes and inputs.
const requestId = await client.requestPhoneNumber('447700900123@c.us');sharePhoneNumber(destination) is a different action: it shares the signed-in account's own number and updates per-contact sharing metadata. It doesn't accept an arbitrary number to disclose. Call it only when your application intends that disclosure.
For Easy API, the separate sharing action is POST /api/contacts/sharePhoneNumber with { "to": "DESTINATION_CHAT_ID" } and the same API-key header. It shares the signed-in account's number.
Both methods return submitted message IDs, and ACKs describe later delivery. The recipient's decision and successful response are separate outcomes. Requests rendered on our test phones, but accepting them produced failed share replies on those devices. That makes the native request a demonstrated result; a completed number-sharing round trip remains unconfirmed.
Account and receiver support can affect this flow. Inspect the conversation before retrying an uncertain submission. Read the phone-number sharing guide for the exact API and direct-chat boundary.