Introduction
The@lid (Linked ID) is a unique and private identifier created by WhatsApp to represent contacts without directly exposing their phone number.
This change is part of WhatsApp’s privacy updates, allowing users to hide their number in certain contexts.
In some cases, WhatsApp is sending the @lid as the primary user identifier, even if the user hasn’t enabled any option to hide their number.
Difference between @lid and phone
WhatsApp can return contact identifiers in different ways, depending on the type of conversation, group, or privacy settings:
-
phone: Can contain the real number ("554499999999") or the@liditself ("999999999999999@lid"). -
chatLid: Is the most stable unique identifier.
Webhook Example
In Z-API webhooks, WhatsApp can return the contact identifier in different ways, depending on the type of interaction and the user’s privacy settings.Example – Full return with number and @lid:
Example – Return with @lid only:
Sending messages using @lid
You can send messages directly to an @lid, replacing the phone number in the request body:
@lid is already supported by the Z-API in most endpoints.
Implementation best practices
- Prioritize using
@lidto identify contacts — this attribute tends to be the most stable. - Avoid relying solely on
phone, as it may contain the number or the@liditself. - Store and relate the
@lidin your database to maintain consistency.
Converting @lid to phone number
It is not possible to convert an @lid to a phone number.
This limitation exists for privacy reasons defined by WhatsApp.
Allowing this conversion would invalidate the purpose of the number-hiding feature.
Converting phone number to @lid
On the other hand, it is possible to obtain the @lid corresponding to a phone number using the “Is on WhatsApp?” method.
Important
- This change is native to WhatsApp, and Z-API only passes along the information as received.
- The return behavior (
@lidorphone) may vary. - The
chatLidattribute is already implemented in Z-API webhooks and can be used both to identify contacts and to send messages. - The
@lidis being gradually implemented by WhatsApp itself, so behavior may be inconsistent.