{"id":11072,"date":"2026-09-28T08:00:00","date_gmt":"2026-09-28T11:00:00","guid":{"rendered":"https:\/\/z-api.io\/blog\/?p=11072"},"modified":"2026-09-25T17:31:48","modified_gmt":"2026-09-25T20:31:48","slug":"lid-on-whatsapp-what-it-is-how-it-works-and-what-changes-in-z-api-integrations","status":"publish","type":"post","link":"https:\/\/z-api.io\/blog\/en\/lid-on-whatsapp-what-it-is-how-it-works-and-what-changes-in-z-api-integrations\/","title":{"rendered":"LID on WhatsApp: what it is, how it works, and what changes in Z-API integrations"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">For a long time, the phone number was treated as the primary identity of a contact on WhatsApp. To find a conversation, register a customer, create a ticket, or send a message, all you needed to store was a numeric string such as <strong>5511999999999<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That model is changing. In certain situations, WhatsApp may return an identifier in the <strong>@lid<\/strong> format instead of directly exposing the phone number. For teams using <strong>APIs, webhooks, CRMs, or automations<\/strong>, this change requires an important review of how contacts are stored, queried, and messaged.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>LID, an acronym associated with Local Identifier, is a private identifier used to represent a user without necessarily exposing their real phone number.<\/strong> It allows an integration to continue recognizing the contact and routing messages while reducing phone number exposure in payloads, logs, and technical databases.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This does not mean phone numbers no longer exist or that every workflow will now operate exclusively with LIDs. The phone number may still appear in certain events and remain necessary for specific processes. The main change is that the phone number should no longer be treated as the only possible key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, you will learn:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>what LID is and why WhatsApp uses this identifier;<\/li>\n\n\n\n<li>the difference between <code>phone<\/code>, <code>lid<\/code>, <code>@lid<\/code>, and <code>chatLid<\/code>;<\/li>\n\n\n\n<li>how to interpret webhook responses;<\/li>\n\n\n\n<li>how to send messages using a LID;<\/li>\n\n\n\n<li>when to use a LID or a phone number;<\/li>\n\n\n\n<li>how to adapt your CRM, database, and automations;<\/li>\n\n\n\n<li>why <code>chatLid: null<\/code> can be a normal response;<\/li>\n\n\n\n<li>which conversions are possible or limited;<\/li>\n\n\n\n<li>how Z-API helps keep integrations stable.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What is LID on WhatsApp?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">LID is an identifier associated with a user in a particular WhatsApp interaction. It works as a technical reference that allows systems to recognize a contact without depending on the exposure of their phone number.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A response may contain a value such as:<\/p><div class=\"advads-blog-ads-no-post advads-entity-placement\" style=\"text-align: center;\" id=\"advads-1063368824\"><div id=\"advads-641522919\"><a href=\"https:\/\/hubs.li\/Q04pCy0Y0\" target=\"_blank\" aria-label=\"Banner_006\"><img src=\"https:\/\/z-api.io\/blog\/wp-content\/uploads\/2026\/06\/Banner_006.jpg\" alt=\"\"  srcset=\"https:\/\/z-api.io\/blog\/wp-content\/uploads\/2026\/06\/Banner_006.jpg 1200w, https:\/\/z-api.io\/blog\/wp-content\/uploads\/2026\/06\/Banner_006-300x88.jpg 300w, https:\/\/z-api.io\/blog\/wp-content\/uploads\/2026\/06\/Banner_006-1024x299.jpg 1024w, https:\/\/z-api.io\/blog\/wp-content\/uploads\/2026\/06\/Banner_006-768x224.jpg 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" width=\"1200\" height=\"350\"   \/><\/a><\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5511999999999<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or, in another scenario:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>g1ff3a2d@lid<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The second value should not be validated as if it were a phone number. It is an identifier that needs to be stored and used according to the integration rules.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The adoption of this model is connected to a broader move toward privacy. By reducing the circulation of phone numbers across integrations, the platform makes it harder to copy phone databases indiscriminately and reduces the exposure of personal data in logs, queues, and third-party systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For developers, the consequence is straightforward: <strong>parsers, databases, and sending rules need to support more than one identity format.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A LID is not a masked phone number that can be freely converted. It is an operational identifier that can preserve conversation continuity without exposing the phone number.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Does LID replace the phone number?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Not in every context. LID replaces the exclusive dependency on phone numbers in certain events, but the number may still be available in other workflows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In an integration, you may encounter situations such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>phone<\/code> containing a traditional phone number;<\/li>\n\n\n\n<li><code>phone<\/code> containing a value ending in <code>@lid<\/code>;<\/li>\n\n\n\n<li>a separate <code>lid<\/code> field being populated;<\/li>\n\n\n\n<li><code>chatLid<\/code> being available to identify a conversation;<\/li>\n\n\n\n<li><code>chatLid<\/code> returning <code>null<\/code>;<\/li>\n\n\n\n<li>phone number and LID being available in the same event.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">That is why it is not safe to write a rule that accepts digits only. A validation like this may break when WhatsApp returns a LID:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if (!\/^\\d+$\/.test(phone)) {\n  throw new Error('Invalid phone number');\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The application needs to recognize both scenarios and route each value to the appropriate field.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A more suitable validation approach would be to separate the identifier from the contact type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function identify(value) {\n  if (!value) return { type: 'unknown', value: null };\n  if (value.endsWith('@lid')) return { type: 'lid', value };\n  if (\/^\\d+$\/.test(value)) return { type: 'phone', value };\n  return { type: 'other', value };\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This example is conceptual. The exact fields depend on the payload received and the endpoint being used, but the principle is the same: <strong>do not confuse a phone number with a private identifier.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may also want to read: <strong><a href=\"https:\/\/z-api.io\/blog\/en\/whatsapp-coexistence-how-to-use-the-app-and-api-with-the-same-number\/\" target=\"_blank\" rel=\"noreferrer noopener\">WhatsApp Coexistence: learn how to use the app and API with the same number.<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Difference between phone, lid, and chatLid<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Correctly interpreting these fields helps prevent lookup errors, duplicate contacts, and messages being sent to the wrong destination.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Field<\/th><th>What it represents<\/th><th>How to handle it<\/th><\/tr><tr><td><code>phone<\/code><\/td><td>The user\u2019s phone number when available; in some responses it may contain a LID<\/td><td>Do not assume it will always contain digits only<\/td><\/tr><tr><td><code>lid<\/code> or <code>@lid<\/code><\/td><td>The user\u2019s private identifier<\/td><td>Store it in a dedicated field and use it as a contact identifier<\/td><\/tr><tr><td><code>chatLid<\/code><\/td><td>An identifier related to the chat or conversation<\/td><td>Treat it as optional and allow <code>null<\/code><\/td><\/tr><tr><td><code>from<\/code><\/td><td>The event origin or sender, depending on the payload<\/td><td>Analyze it together with the other identity fields<\/td><\/tr><tr><td><code>messageId<\/code><\/td><td>The message identifier<\/td><td>Use it for tracking, idempotency, and auditing<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">What is phone?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>phone<\/code> field usually represents the contact\u2019s phone number when WhatsApp makes it available. However, in some versions or events, it may return an identifier in the <code>@lid<\/code> format.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore, the field name alone is not enough to determine the type of value. The content itself needs to be analyzed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is lid?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>lid<\/code> field represents the user through a private identifier. It may be the most appropriate value for finding and maintaining the technical relationship with a contact when the phone number is not available.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not use a LID as if it were a phone number in reports, SMS integrations, or validations that require country and area codes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is chatLid?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>chatLid<\/code> is related to identifying the chat or conversation. It should not be confused with the individual user identifier.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some events may include a populated <code>chatLid<\/code>, while others may return it as <code>null<\/code>. This should not automatically break the flow. The application needs to understand whether it is processing a one-to-one message, a group, a conversation that has not yet been persisted, or an event that does not have a chat associated with it at that moment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why can chatLid return null?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code><strong>chatLid: null<\/strong><\/code> <strong>does not necessarily mean the webhook is invalid.<\/strong> The field may not be available for every event type or at every stage of a conversation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Treat a null value as a valid possibility:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const chatId = payload.chatLid || null;\nconst contactId = payload.contact?.lid || payload.from || null;\n\nif (!contactId) {\n  \/\/ Send the event to an analysis queue or log the failure.\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The practical rule is:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>use the contact LID when the task is to identify the user;<\/li>\n\n\n\n<li>use <code>chatLid<\/code> when the operation needs to identify the conversation;<\/li>\n\n\n\n<li>accept <code>null<\/code> when conversation data is not available in the event;<\/li>\n\n\n\n<li>use <code>messageId<\/code> to track the message;<\/li>\n\n\n\n<li>do not automatically discard the entire webhook just because <code>chatLid<\/code> is empty.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">See also: <strong><a href=\"https:\/\/z-api.io\/blog\/en\/whatsapp-tests-calls-for-users-without-an-account-understand-the-impact\/\" target=\"_blank\" rel=\"noreferrer noopener\">WhatsApp tests calls for users without an account: understand the potential impact.<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How does Z-API handle LID in webhooks?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Z-API works with responses that may contain a phone number, a LID, and chat-related information. Instead of building an integration that depends on one single format, your application should inspect the contact fields available in the payload and preserve the identifier that was received.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Conceptual event examples:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"from\": \"5511999999999\",\n  \"messageId\": \"ABCD1234\",\n  \"contact\": {\n    \"phone\": \"5511999999999\",\n    \"lid\": null\n  }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In another event:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"from\": \"g1ff3a2d@lid\",\n  \"messageId\": \"EFGH5678\",\n  \"chatLid\": null,\n  \"contact\": {\n    \"phone\": \"g1ff3a2d@lid\",\n    \"lid\": \"g1ff3a2d@lid\"\n  }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Exact field names and payload composition may vary depending on the endpoint and message type. The key point is that the system should look for the private identifier in the contact object and preserve the value received.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When a webhook arrives, a recommended routine is:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>validate the origin and structure of the event;<\/li>\n\n\n\n<li>extract <code>messageId<\/code>, <code>from<\/code>, <code>phone<\/code>, <code>lid<\/code>, and <code>chatLid<\/code>;<\/li>\n\n\n\n<li>identify whether each value is a phone number, LID, or null;<\/li>\n\n\n\n<li>look up the contact by LID when available;<\/li>\n\n\n\n<li>update the phone number only when it is present;<\/li>\n\n\n\n<li>record the source and date of the information;<\/li>\n\n\n\n<li>process the message only once;<\/li>\n\n\n\n<li>reply using the identifier accepted by the endpoint.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Can I send messages using a LID?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. When the endpoint being used accepts the identifier, you can use the LID in the <code>to<\/code> field instead of sending the phone number.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Conceptual example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"to\": \"g1ff3a2d@lid\",\n  \"message\": \"Hello! How can we help?\"\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The value should be exactly the identifier received and stored by the integration. Do not try to create a LID manually from the phone number, and do not modify its characters to \u201cstandardize\u201d it as if it were a number.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The recommended flow is:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th><strong>Webhook received<\/strong><br><strong>\u2193<\/strong><br><br><strong>Save contact.lid<\/strong><br><strong>\u2193<\/strong><br><br><strong>Associate it with the internal contact<\/strong><br><strong>\u2193<\/strong><br><br><strong>Retrieve the LID when sending<\/strong><br><strong>\u2193<\/strong><br><br><strong>Send it to the Z-API endpoint<\/strong><br><strong>\u2193<\/strong><br><br><strong>Store messageId and status<\/strong><\/th><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If an error occurs and the phone number is available, the application may apply a fallback rule according to the endpoint, the cause of the failure, and the company\u2019s operational policy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fallback should not be applied automatically to every error because validation, authorization, or invalid-recipient failures will not necessarily be solved simply by switching the identifier.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">When should you use LID and when should you use phone?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The decision depends on the purpose of the operation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prefer LID for contact identification<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use the LID as the preferred identifier when it is available in the webhook and stored in your system. This reduces dependency on the phone number and keeps the integration ready for events where the number is not included.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">LID is especially useful for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>finding the contact in the CRM;<\/li>\n\n\n\n<li>associating messages with the same user;<\/li>\n\n\n\n<li>replying to a conversation started by the customer;<\/li>\n\n\n\n<li>preventing the system from discarding events without phone numbers;<\/li>\n\n\n\n<li>keeping the operation aligned with WhatsApp\u2019s privacy model.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Use the phone number when the use case requires it<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A phone number may still be needed to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>display the contact in an administrative interface;<\/li>\n\n\n\n<li>send SMS messages or make calls outside WhatsApp;<\/li>\n\n\n\n<li>validate an external registration;<\/li>\n\n\n\n<li>integrate with systems that do not yet support LID;<\/li>\n\n\n\n<li>complete an authentication step that depends on the number.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The recommendation is not to delete phone numbers. It is to separate identity from purpose. The phone number can remain as supplementary data, while the LID acts as the preferred relationship key inside WhatsApp.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How should you model the database?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Avoid defining <code>phone<\/code> as the contact\u2019s only primary key. Create your own internal identifier and store WhatsApp values in separate fields.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A possible model would be:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>contacts<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>id<\/code> \u2014 internal identifier<\/li>\n\n\n\n<li><code>lid<\/code> \u2014 private WhatsApp identifier<\/li>\n\n\n\n<li><code>phone<\/code> \u2014 phone number, when available<\/li>\n\n\n\n<li><code>chat_lid<\/code> \u2014 chat identifier, when available<\/li>\n\n\n\n<li><code>phone_verified_at<\/code> \u2014 phone verification date<\/li>\n\n\n\n<li><code>lid_collected_at<\/code> \u2014 date the LID was collected<\/li>\n\n\n\n<li><code>source<\/code> \u2014 identifier source<\/li>\n\n\n\n<li><code>last_message_id<\/code> \u2014 last processed message<\/li>\n\n\n\n<li><code>created_at<\/code><\/li>\n\n\n\n<li><code>updated_at<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Important recommendations:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>create an index for <code>lid<\/code>;<\/li>\n\n\n\n<li>treat LID as text;<\/li>\n\n\n\n<li>do not use <code>chatLid<\/code> as the user identity;<\/li>\n\n\n\n<li>allow <code>null<\/code> for phone and <code>chatLid<\/code>;<\/li>\n\n\n\n<li>record the source of the data;<\/li>\n\n\n\n<li>preserve a history of relevant changes;<\/li>\n\n\n\n<li>enforce uniqueness within the correct scope;<\/li>\n\n\n\n<li>avoid logs containing unnecessary personal data.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">How should lookups work?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A possible lookup order is:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. search by LID within the instance context;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. if not found, search by the available phone number;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. validate the association and source;<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. create a contact only after those attempts.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not deduplicate contacts based only on profile name. The same name may belong to multiple people.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also, do not automatically associate a LID with a phone number simply because the events occurred close together in time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">LID and CRM: what changes for software companies?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Systems designed to work with phone numbers only may fail in several places:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>validations that reject non-numeric characters;<\/li>\n\n\n\n<li>phone masks being applied to a LID;<\/li>\n\n\n\n<li>reports that can no longer group events correctly;<\/li>\n\n\n\n<li>foreign keys based only on <code>phone<\/code>;<\/li>\n\n\n\n<li>SMS integrations receiving the wrong identifier;<\/li>\n\n\n\n<li>country and area-code filters being applied to a LID;<\/li>\n\n\n\n<li>deduplication creating a new customer for every webhook;<\/li>\n\n\n\n<li>dashboards no longer counting contacts without phone numbers.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Create an inventory of every place where the phone number is used. Then classify each use:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Phone number use<\/th><th>Can it migrate to LID?<\/th><th>Recommended action<\/th><\/tr><tr><td>Identify a contact on WhatsApp<\/td><td>Yes<\/td><td>Prefer LID when available<\/td><\/tr><tr><td>Send a WhatsApp message<\/td><td>In many workflows<\/td><td>Use the identifier accepted by the endpoint<\/td><\/tr><tr><td>Send SMS<\/td><td>No<\/td><td>Keep a validated phone number<\/td><\/tr><tr><td>Display in an admin interface<\/td><td>Not necessarily<\/td><td>Show the phone number when available and the LID as a technical reference<\/td><\/tr><tr><td>Contact deduplication<\/td><td>Partially<\/td><td>Use LID, phone number, and association rules<\/td><\/tr><tr><td>Conversation reports<\/td><td>Yes<\/td><td>Group by internal ID and store the identifiers<\/td><\/tr><tr><td>External authentication<\/td><td>Depends<\/td><td>Follow the external system requirements<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This separation prevents a privacy change in one channel from breaking processes that genuinely depend on a phone number.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Can I convert a LID into a phone number?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Do not rely on a direct LID-to-phone-number conversion through a public API.<\/strong> The purpose of the identifier is precisely to reduce exposure of the number, so the application should not assume reverse access will be available.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In some authorized scenarios, a phone-to-LID lookup may exist. This depends on the endpoint, permissions, data availability, and integration model.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not build your architecture on the assumption that this conversion will always be available.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The safest approach is to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>store the LID when it arrives through a webhook;<\/li>\n\n\n\n<li>store the phone number only when it is legitimately provided;<\/li>\n\n\n\n<li>keep the relationship between both when the association is confirmed;<\/li>\n\n\n\n<li>accept that some records will contain only a LID;<\/li>\n\n\n\n<li>do not attempt to discover the phone number through unauthorized methods;<\/li>\n\n\n\n<li>do not expose the LID in public URLs or logs unless necessary.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Privacy and security best practices<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Although a LID does not directly reveal the phone number, it is still an identifier associated with a person and should be protected.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Minimize data in logs<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Record only what is required for debugging. Mask values in production logs and restrict access to complete payloads.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Protect webhooks<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Validate the event source, signature, authentication, and structure. An exposed webhook may allow message injection or unauthorized contact updates.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Separate technical identifiers from display data<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An agent may need to see the contact\u2019s name and phone number when available. The system does not need to display the LID on every screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Show the identifier only where it is needed for support or auditing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Control access to mappings<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The relationship between a LID and a phone number may be sensitive. Restrict queries, log access, and maintain a retention policy that matches the purpose of the system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What changes in the Z-API API integration?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The main adaptation involves data modeling and <strong><a href=\"https:\/\/medium.com\/@old.noisy.speaker\/introduction-to-payloads-in-cybersecurity-dd014fdff760\" target=\"_blank\" rel=\"noreferrer noopener\">payload<\/a><\/strong> handling.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You do not need to rewrite your entire application, but you do need to remove the assumption that every contact will be represented by digits.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The most important changes are:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>add a dedicated field for LID;<\/li>\n\n\n\n<li>accept <code>@lid<\/code> in validations and parsers;<\/li>\n\n\n\n<li>save <code>contact.lid<\/code> when it is received;<\/li>\n\n\n\n<li>treat <code>chatLid<\/code> as optional;<\/li>\n\n\n\n<li>update lookups to prefer LID;<\/li>\n\n\n\n<li>keep the phone number as supplementary information;<\/li>\n\n\n\n<li>store <code>messageId<\/code> for idempotency;<\/li>\n\n\n\n<li>adapt reports and administrative screens;<\/li>\n\n\n\n<li>review integrations that require phone numbers;<\/li>\n\n\n\n<li>test message sending with both phone numbers and LIDs.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Z-API provides an integration layer for connecting your system to WhatsApp and working with <strong>webhooks<\/strong>, messages, and identifiers returned by the operation.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The client application remains responsible for storing the data, validating workflows, and choosing the appropriate fallback rule.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before deploying the change to production, review the documentation for the endpoint you are using and test it with real payloads from your instance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See also:<strong><a href=\"https:\/\/z-api.io\/blog\/en\/how-to-use-whatsapp-webhooks-to-build-real-time-automations-with-z-api\/\" target=\"_blank\" rel=\"noreferrer noopener\"> How to use WhatsApp webhooks to build real-time automations with Z-API<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Recommended migration plan<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A gradual migration reduces the risk of disrupting customer service.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: inventory<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">List the tables, endpoints, workers, dashboards, and integrations that use <code>phone<\/code> as a key.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: extend the data model<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Add <code>lid<\/code>, <code>chatLid<\/code>, and metadata without removing the existing phone number. Create indexes and update read routines.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: capture<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Start storing the LID in every webhook where it appears. Record the date, source, and associated message.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: prefer LID for lookups<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Update lookups to search by LID first, using the phone number as a fallback when it is available and appropriate.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: controlled sending<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Test messages to contacts identified by phone number and by LID. Record status, error, latency, and response.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: reconciliation<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create a routine to identify duplicate contacts, incomplete associations, and events without a usable key.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: observability<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Monitor parsing failures, messages without recipients, null <code>chatLid<\/code> values, sending errors, and increases in duplicate contact records.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 8: rollout<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Release the new logic gradually and keep the option to return to the previous behavior for workflows where the phone number is still required.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Quick checklist<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a <code>lid<\/code> field in the contacts table.<\/li>\n\n\n\n<li>Create an optional field for <code>chatLid<\/code>.<\/li>\n\n\n\n<li>Index the LID as text.<\/li>\n\n\n\n<li>Accept values ending in <code>@lid<\/code>.<\/li>\n\n\n\n<li>Save <code>contact.lid<\/code> received through webhooks.<\/li>\n\n\n\n<li>Treat <code>chatLid: null<\/code> as a valid response.<\/li>\n\n\n\n<li>Do not use <code>phone<\/code> as the only primary key.<\/li>\n\n\n\n<li>Update lookups to prefer LID.<\/li>\n\n\n\n<li>Keep the phone number as supplementary data.<\/li>\n\n\n\n<li>Implement idempotency using <code>messageId<\/code>.<\/li>\n\n\n\n<li>Test sending with phone numbers and LIDs.<\/li>\n\n\n\n<li>Create fallback rules only where they make sense.<\/li>\n\n\n\n<li>Review logs, masks, and permissions.<\/li>\n\n\n\n<li>Update dashboards and reports.<\/li>\n\n\n\n<li>Document the new workflow for support and development teams.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>LID represents an important change in the way systems identify contacts on WhatsApp.<\/strong> The platform can continue operating even when the phone number is not available, but only if the integration is prepared to work with private identifiers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The main mistake is treating a LID as simply a phone number in another format. It has its own purpose, rules, and limitations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Store it in a dedicated field, use it to find the contact, treat<\/strong> <code><strong>chatLid<\/strong><\/code> <strong>as optional, and keep the phone number only where it is genuinely needed.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The migration does not have to be disruptive. Start with the data model, update webhooks, adapt validations, test sending, and monitor scenarios where the phone number is not present.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With Z-API, your company can work with webhooks and integrations that preserve contact continuity even when identifiers vary between phone number, LID, and chat identifier.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The application is responsible for maintaining a flexible, secure data model that remains consistent with the information received.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Received a LID in a webhook? Do not discard the event. Save the identifier, associate it with the internal contact, and adapt the sending workflow to use the correct value.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">What is LID on WhatsApp?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It is a private identifier used to represent a user without relying on direct exposure of the phone number in certain events and integrations.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is LID the same as a phone number?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. LID is a technical identifier and should be stored in its own field. Do not apply phone masks, area-code validations, or SMS rules to it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What should I do when phone returns a value ending in @lid?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Identify the value type, save it as a LID, and do not try to treat it as a numeric phone number.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Inspect the other fields in the payload to find any additional contact information.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does chatLid return null?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The field may not be available in certain events or conversation types.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Treat <code>null<\/code> as a valid response and use the contact LID or another available identifier to process the message.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I send a message to a LID?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the endpoint being used accepts the format, yes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the exact LID received in the webhook and follow the integration documentation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I convert a LID into a phone number?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Do not assume this conversion is available through a public API.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">LID exists precisely to reduce exposure of phone numbers. Store the phone number only when it is legitimately and authoritatively provided.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Do I need to remove phone numbers from my database?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. Phone numbers may still be required for SMS, authentication, customer service, or external integrations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The recommendation is simply not to use the phone number as the only key for WhatsApp relationships.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What changes in my Z-API integration?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You should adapt webhook handling, store LIDs, accept <code>@lid<\/code>, treat <code>chatLid<\/code> as optional, review lookup logic, and test sending to the identifiers available in each workflow.<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;11072&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;1&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Avalie este post&quot;,&quot;legend&quot;:&quot;5\\\/5 - (1 vote)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;LID on WhatsApp: what it is, how it works, and what changes in Z-API integrations&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 142.5px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            5\/5 - (1 vote)    <\/div>\n    <\/div>\n<div class=\"advads-banner-cta advads-entity-placement\" id=\"advads-2387464383\"><div id=\"advads-2990633473\"><a href=\"https:\/\/hubs.li\/Q04pCy0Y0\" target=\"_blank\" aria-label=\"Banner_005\"><img src=\"https:\/\/z-api.io\/blog\/wp-content\/uploads\/2026\/06\/Banner_005.jpg\" alt=\"\"  srcset=\"https:\/\/z-api.io\/blog\/wp-content\/uploads\/2026\/06\/Banner_005.jpg 1200w, https:\/\/z-api.io\/blog\/wp-content\/uploads\/2026\/06\/Banner_005-300x88.jpg 300w, https:\/\/z-api.io\/blog\/wp-content\/uploads\/2026\/06\/Banner_005-1024x299.jpg 1024w, https:\/\/z-api.io\/blog\/wp-content\/uploads\/2026\/06\/Banner_005-768x224.jpg 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" width=\"1200\" height=\"350\"   \/><\/a><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Understand what is LID on WhatsApp and see the impacts on contact identification, integrations, automations, and API-based operations.<\/p>\n","protected":false},"author":16,"featured_media":11073,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[229,208],"tags":[256,255],"class_list":["post-11072","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-whats-new","category-whatsapp-api-en-us","tag-lid","tag-lid-no-whatsapp"],"_links":{"self":[{"href":"https:\/\/z-api.io\/blog\/en\/wp-json\/wp\/v2\/posts\/11072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/z-api.io\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/z-api.io\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/z-api.io\/blog\/en\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/z-api.io\/blog\/en\/wp-json\/wp\/v2\/comments?post=11072"}],"version-history":[{"count":1,"href":"https:\/\/z-api.io\/blog\/en\/wp-json\/wp\/v2\/posts\/11072\/revisions"}],"predecessor-version":[{"id":11074,"href":"https:\/\/z-api.io\/blog\/en\/wp-json\/wp\/v2\/posts\/11072\/revisions\/11074"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/z-api.io\/blog\/en\/wp-json\/wp\/v2\/media\/11073"}],"wp:attachment":[{"href":"https:\/\/z-api.io\/blog\/en\/wp-json\/wp\/v2\/media?parent=11072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/z-api.io\/blog\/en\/wp-json\/wp\/v2\/categories?post=11072"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/z-api.io\/blog\/en\/wp-json\/wp\/v2\/tags?post=11072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}