id to identify a user, group, or bot. Phone numbers are separate, optional aliases.
id as your contact’s primary key. Update phoneNumber and username when
present; a changed or hidden alias does not create a new user.
Resolve an alias
These reads require thecontacts:read scope.
Resolve a phone number or username before creating a local contact:
"keyRequired": true contains no guessed identity. Repeat the lookup with
usernameKey=1234 after obtaining the key from the user.
You can also pass an existing id to read its known aliases.
Verify a user’s encryption identity
Request WhatsApp’s identity verification code with the stable user ID:numericCode with the code shown by the other user. To use qrCode,
base64-decode it and render the resulting bytes as the QR content for
comparison. A changed code means the account’s
identity or linked-device set changed and must be verified again. The endpoint
accepts only a pmfa_lid_ user ID; resolve phone numbers and usernames first.
Polymorfa returns WhatsApp’s display payload and never exposes the underlying
identity-key payload.
Hidden phone numbers
A missingphoneNumber does not mean the user is unresolved. Continue using
their id. To ask a contact without a known phone number to share their phone number, send a
consent request:
message.received webhook with type: "phone_number_shared"; the sender’s
id is unchanged and phoneNumber is added as an alias.
Upsert rule
For every contact, participant, sender, voter, presence source, and blocklist entry:- Upsert by
id. - Update
phoneNumberandusernameonly when they are present. - Never create a second record because an alias appeared, changed, or disappeared.
Linked devices
Device lookups return the user’sid or phoneNumber, plus a numeric device
value. Together, they identify a linked device: