TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wppconnect-team/wa-js/llms.txt
Use this file to discover all available pages before exploring further.
WPP.contact module exposes WhatsApp Web’s internal contact store. Every function operates on a WhatsApp ID (WID) — a string in the format {phone}@c.us for individual contacts, {id}@lid for linked-device identifiers, or {id}@g.us for group IDs. All async functions return a Promise and should be awaited in the browser console or your injection script.
All contact IDs must include the full international phone number without the
+ prefix, followed by @c.us. For example, a US number +1 555 000 1234 becomes 15550001234@c.us.WPP.contact.get(contactId)
Returns the internal ContactModel for a given WID, or undefined if the contact is not found in the local store.
The WhatsApp ID of the contact. Accepts
@c.us, @lid, or @g.us formats.WPP.contact.list(options?)
Returns an array of all ContactModel objects currently in the local store, with optional filters.
Optional filtering options.
WPP.contact.getStatus(contactId)
Fetches the “About” text (status) set by the contact. Returns null if the contact does not exist or has no status.
The WhatsApp ID of the contact (
@c.us format).WPP.contact.getProfilePictureUrl(contactId, full?)
Returns the URL of the contact’s profile picture. Returns undefined if the contact has no profile picture or if privacy settings prevent access.
The WhatsApp ID of the contact.
When
true (default), returns the full-resolution image URL. When false, returns the thumbnail URL.WPP.contact.getBusinessProfile(contactId)
Returns the business profile for a WhatsApp Business account, including verified name, category, and description.
The WhatsApp ID of the business contact (
@c.us format).WPP.contact.getCommonGroups(contactId)
Returns the WIDs of all groups that you and the given contact share.
The WhatsApp ID of the contact (
@c.us format).WPP.contact.getPnLidEntry(contactId)
Resolves the mapping between a phone number (@c.us) and its linked-device identifier (@lid), plus any available contact metadata. Only works for @c.us and @lid WIDs — not groups.
A
@c.us or @lid WID to look up.When calling with a
@c.us WID and the LID is not cached locally, this function queries the WhatsApp server to retrieve it.WPP.contact.queryWidExists(contactId)
Checks whether a given WID (phone number or LID) is registered on WhatsApp. Results are cached — 5 minutes for hits, 15 seconds for misses.
The WID to look up. Accepts
@c.us or @lid.WPP.contact.queryUsernameExists(username, key?)
Checks whether a WhatsApp username (@username) exists. Some accounts protect their username with a PIN — in that case the function returns { keyRequired: true } instead of contact info.
The username to look up, without the
@ prefix.Numeric PIN to unlock a PIN-protected username.
WPP.contact.save(contactId, firstName, options?)
Creates a new contact or updates an existing one in the device address book.
The
@c.us WID of the contact to save.The contact’s first name.
WPP.contact.remove(contactId)
Removes a contact from the device address book. Throws if the contact is not found or is not in your contact list.
The
@c.us or @lid WID of the contact to remove.WPP.contact.reportContact(contactId, spamFlow?, msg?)
Reports a contact or chat to WhatsApp for spam or policy violations.
The WID of the contact to report.
The report context. Available values:
| Value | Description |
|---|---|
ChatInfoReport | Report from chat info screen (default) |
MessageMenu | Report from a specific message |
GroupInfoReport | Report from group info screen |
ChatFmxCardSafetyToolsReport | Report via safety tools |
ChatFmxCardSafetyToolsReportSuspicious | Report a suspicious contact |
GroupInfoLeaveReportUpsell | Report when leaving a group |
A specific message to include in the report. Requires
spamFlow: 'MessageMenu'.WPP.contact.subscribePresence(ids)
Subscribes to presence updates (online/offline/typing) for one or more contacts or groups.
A single WID or an array of WIDs to subscribe to. Accepts
@c.us and @g.us.WPP.contact.unsubscribePresence(ids)
Stops receiving presence updates for one or more contacts.
A single WID or an array of WIDs to unsubscribe.
WhatsApp ID format reference
Every function in this module accepts a WhatsApp ID (WID) string. The table below summarises the common formats.Individual contact — @c.us
Individual contact — @c.us
Format:
{e164_number}@c.us — the phone number in E.164 format without the +, followed by @c.us.Linked-device ID — @lid
Linked-device ID — @lid
Format:
{numeric_id}@lid — an internal WhatsApp identifier used in multi-device sessions. Use getPnLidEntry to translate between @c.us and @lid.Group — @g.us
Group — @g.us
Format:
{timestamp}-{random}@g.us. Accepted by get, getCommonGroups, and subscribePresence.