waha icon indicating copy to clipboard operation
waha copied to clipboard

Question about c.us, lid and s.whatsapp.net

Open diego-goncalves-teixeira opened this issue 1 year ago • 10 comments

Hello everyone

I have a question about @c.us, @lid, @s.whatsapp.net

In a private conversation, who is the correct chat ID to send a message to? Which of the three?

Is the lid a fixed identifier? Or can it change? Why do messages from a contact in a private conversation sometimes come from @lid and sometimes from @c.us?

Could you explain to me better how these elements work?

patron:PLUS

You may notice various identifiers in the from, to, and participant fields. Here’s what they mean:

  • [email protected] Phone numbers accounts - international phone number without + at the start and add @c.us at the end. For phone number 12132132131 the chatId is [email protected]
  • [email protected] can also appear in internal data for NOWEB/GOWS. Just convert it to @c.us to work with that properly. Kindly don’t use it in chatId when sending messages.
  • 123123123@lid - is a hidden user ID, each user has a regular ID along with a hidden one. WhatsApp added that type of ID along with communities functionality.

https://waha.devlike.pro/docs/how-to/receive-messages/#chatid-from-to-participant


who is the correct chat ID to send a message to?

@c.us if you have it, or @lid

Is the lid a fixed identifier? Or can it change?

We don't know. Right now it maps lid => phone number and back in the 1-1 relationship across all devices, users and groups, But whatsapp might change that logic in the future.

Why do messages from a contact in a private conversation sometimes come from @lid and sometimes from @c.us?

WhatsApp is migrating "id system" from regular c.us to lid to enable "account using only email" feature and other (likely some facebook id)

patron:PRO

devlikepro avatar Aug 14 '25 08:08 devlikepro

Thank you for the answers, I understood most of them, but I had a problem yesterday. When the contact had @lid, I was sending messages to them using the @lid as the chatId. However, the system indicated that the message had been delivered, but it didn’t appear either on my device or on the recipient’s device. This happened with one specific contact. So now I’m always sending to @c.us. Was this behavior expected?

patron:PLUS

Yes, if you have @c.us - use it, it should work

patron:PRO

devlikepro avatar Aug 18 '25 11:08 devlikepro

I’m facing an issue when trying to send messages to the chatId [email protected]. On the user’s device, WhatsApp shows a notification saying that the message could not be delivered.

For this specific user, the messages don’t reach their device. However, on my own phone, the messages sent through WAHA appear normally. On my phone, I can see the messages I sent via WAHA without any issues. But on the client’s phone, they only see a system message saying that the message could not be delivered.

In the WAHA logs, I only see the status that the message was delivered to the SERVER — I never see a log indicating it was delivered to the DEVICE. Still, if I try to chat with this client directly from my own phone (without WAHA), the conversation works normally.

patron:PLUS

the conversation works normally.

Does the message there have c.us also? LIke if you connect via WAHA and start listening message.any on Dashboard and send a message from the app (not waha) - does the payload have the same jid?

patron:PRO

devlikepro avatar Aug 20 '25 10:08 devlikepro

I have similar question, usually i almost receive the number with @c.us in the payload from, in a 1 on 1 direct chat.

but suddenly i received @lid , and This inconsistency causes downstream issues because my system logic depends on the @c.us format where is store the number directly into my database. but suddenly i received the @lid which is not a phone number.

yskchr21 avatar Sep 28 '25 13:09 yskchr21

#1418

yskchr21 avatar Sep 28 '25 13:09 yskchr21

@lid and @c.us#

WhatsApp finalized its LID (Local Identifier) update (which it started in 2023).

This LID system assures the anonymity of users in large groups, allowing the WhatsApp client to show a masked value (for example +43.......21) instead of a full phone number. This is done to ensure the privacy of users.

WhatsApp is also adding a username system (@username); relying solely on a phone number to identify a user can be cumbersome or even impossible in some contexts. Thus, WhatsApp now assigns a LID to each user on its platform.

This LID is unique to each user, similar to a JID (phone number–based). You can message anyone using either their LID or their PN.

👉 Use the API - Lids to map between a Phone Number (@c.us) and a LID (@lid) in both directions.

patron:PRO

devlikepro avatar Sep 29 '25 05:09 devlikepro

Is it possible that a @lid be changed to @c.us after some time? So let's say I saved an incoming @lid from a user, is there a case where that same user from the same number be changed to @c.us?

slothislazy avatar Jan 06 '26 04:01 slothislazy

@slothislazy in my experiencia using this plugin, yes, like, every contact have lid and c.us, but sometimes the c.us its not available because of reasons, and there are webhooks that will use c.us and others one that will use lid, so in my app i manage both c.us and lid, it is kinda confusing but thats the way it works.

patron:PLUS