feat: Store WhatsApp user_id in Contacts and include it in Webhook payloads to prevent duplicate profiles #15273
ellorente
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
Currently, when a contact interacts via WhatsApp, Chatwoot only stores the
username. Because users can change their WhatsApp username at any time, this creates a major data integrity issue. If a user changes their username or hides their phone number, Chatwoot treats them as a completely new user, leading to duplicate contact profiles and fragmented conversation histories.Additionally, external automation tools (like n8n) connected via Chatwoot webhooks cannot reliably track users across username changes due to the lack of a permanent, unique identifier.
To fix this, Chatwoot needs to fetch, store, and transmit the unique, immutable WhatsApp
user_id.Desired Behavior
user_idduring webhook payload processing and save it to the Contact model.user_idas a primary lookup key alongside the phone number to match existing contacts before creating a new profile.user_idinside the standard Chatwoot Webhook payload (e.g., in contact created/updated events and message events).Urgency / Context
This is an urgent requirement for production environments. Duplicate contacts heavily impact customer support workflows, skew analytics, and break downstream automation pipelines in n8n.
All reactions