Skip to main content
Contact types represent WhatsApp user information including profile details and identifiers.

Contact

Represents a WhatsApp contact with their profile information.
string
required
Contact ID in either LID or JID format (preferred)Examples:
  • "1234567890@s.whatsapp.net" (JID format)
  • "1234567890@lid" (LID format)
string
Contact ID in LID format onlyExample: "1234567890@lid"
string
Contact ID in phone number formatExample: "1234567890@s.whatsapp.net"
string
Name of the contact as you have saved it on your WhatsAppThis is the name you manually set for this contact in your phone’s contacts.
string
Name that the contact has set for themselves on WhatsAppThis is their WhatsApp display name, set by them in their profile.
string
Verified business name (for business accounts)Only present for verified business accounts.
string | null
URL of the contact’s profile pictureBaileys-specific addition. Possible values:
  • "changed" - Profile picture has been updated
  • null - No profile picture set (using default)
  • string - URL to the profile picture
This field is populated by Baileys and may not always be present or up-to-date.
string
Contact’s WhatsApp status messageBaileys-specific addition. Contains the “About” text from the contact’s profile.

Usage Examples

Basic Contact Information

Handling LID and Phone Number Formats

Profile Picture Status

Business Account Detection

Events Emitting Contacts

Contacts are emitted in these events:

contacts.upsert

New contacts added to your contact list:

contacts.update

Existing contacts updated:

messaging-history.set

Contacts synced from history:

Fetching Contact Information

Use socket methods to fetch contact information:

Best Practices

Always prefer the LID format when available:
LID (Local Identifier) is more stable than phone number-based JIDs.
Show names in this order of preference:
  1. contact.name (your saved name) - most personal
  2. contact.notify (their display name) - their choice
  3. contact.verifiedName (business name) - official name
  4. Phone number extracted from contact.id
Profile picture URLs can expire. Cache them but implement refresh logic:
Store contacts in your database for offline access:
  • Chat - Chat information
  • Message - Message types
  • Events - Event types including contact events