Usernames and BSUIDs
Users who enable WhatsApp usernames may not share a phone number. Meta then identifies them by a business-scoped user ID (BSUID, for example US.13491208655302741918) and may omit wa_id, from or recipient_id. wa_id, from and recipient_id are typed as string for backward compatibility but may be absent in webhooks for username-based users, so do not assume they are always present; check them at runtime.
Webhook types expose these optional fields:
| Where | Fields |
|---|---|
value.contacts[] |
user_id, parent_user_id, profile.username |
| Incoming messages | from_user_id, from_parent_user_id, group_id |
| Statuses | recipient_user_id, recipient_parent_user_id |
system messages |
system.user_id, parent_user_id, previous_user_id, previous_parent_user_id |
To send to a BSUID, pass { bsuid } instead of a phone number to any sender. The SDK sends it as recipient and omits to.
await client.messages.sendText({ bsuid: 'US.13491208655302741918' }, 'Hello');Details are in Meta’s business-scoped user ID documentation. When a send goes to a BSUID, contacts[].wa_id in the response can be absent; read contacts[].user_id.
Independent open-source project. Not affiliated with, endorsed by or sponsored by Meta or WhatsApp. Released under the MIT licence. Source on GitHub.