Get Contact Info
Get basic information about a specific contact.
Authentication Required
Login to swap the placeholders with your real Instance ID and Access Token.
Log InNo query parameters required
This endpoint doesn't expect data in the URL.
Who is this? Get Contact Details
The /v2/contacts/[chatId] endpoint retrieves the public metadata for any valid WhatsApp user. This is your primary tool for "enriching" user profiles in your application.
🧩 Understanding the Data Fields
When you fetch a contact, you receive several fields that might seem redundant but serve very different purposes.
1. id._serialized (The Key)
- Value:
15551234567@c.us - Usage: This is the immutable primary key. Always store this in your database. Do not try to parse the phone number manually; treat the whole string as the ID.
2. pushname (The Public Name)
- Value: "Alice"
- Source: This is the name the user set for themselves in WhatsApp Settings.
- Reliability: High. It is what the user wants to be called.
- Verification: This name is NOT verified. A user can set their pushname to "Bank of America Support" to scam people. Never use this for identity verification.
3. name (The Local Name)
- Value: "Alice from Gym"
- Source: This is the name you saved in your phone's address book for this number.
- Availability: If you haven't saved the number, this field will be
undefinedornull. - Priority: In a UI, you should usually display
name(if available) aliased overpushname(fallback), becausenameis your private note.
4. number (The Clean Phone)
- Value:
15551234567 - Usage: The raw MSISDN without the
@c.ussuffix. Useful if you need to pass the number to an SMS gateway.
🏢 Business & Enterprise Flags
The API returns two boolean flags that help you categorize users:
isBusiness
- True: The user is using the "WhatsApp Business App" (SMB).
- Implication: They might have automated greeting messages or "Away" messages. They likely have a catalog.
isEnterprise
- True: The user is using the "WhatsApp Business API" (Cloud API/BSP).
- Implication: This is likely a bot or a large company.
- Warning: Bots talking to bots can create infinite loops. If you detect
isEnterprise: true, tips: [ { type: 'info', title: 'Details', content: 'Fetches stored contact details like Name and Notify Name.' }, { type: 'info', title: 'Notify Name', content: 'This is the name the user set for themselves in WhatsApp.' } ], recommendations: [ "Use the 'Notify Name' if the contact is not saved in your address book.", "Update your local record if the contact's details change." ]
- Warning: Bots talking to bots can create infinite loops. If you detect
you might want to disable your own auto-responders for that chat to prevent a loop.
🔍 Privacy & "Ghost" Data
If you query a valid number but get limited data:
- Scenario: You fetch
12345@c.usand get an ID, butpushnameisundefined. - Cause: The user has strict privacy settings.
- Action: Nothing. The API cannot force the data to appear. You should render a default placeholder (e.g., "WhatsApp User").
⚙️ Usage Patterns
Pattern A: The "Welcome" Personalization
- User sends "Hi".
- Bot calls
GET /v2/contacts/[id]. - Bot retrieves
pushname: "Sarah". - Bot replies: "Hello Sarah! How can I help?"
- Effect: High perceived personalization.
Pattern B: The Block Check
- You suspect a user blocked you.
- You call this endpoint.
- If you can see their
pushnamebut cannot see theirprofilePicoraboutstatus (via other endpoints), and messages are single-ticking, it is a strong indicator of being blocked. (Note: The API does not have an explicitisBlockedByMeflag for privacy reasons).
⚠️ Notes on Caching
User profiles change rarely.
- Do Not: Call this endpoint every time you render a chat message.
- Do: Cache the result for 24-48 hours.
- Refresh: Only aggressive fetch if the user interacts with you after a long period of silence.
Request Parameters
Configure the parameters required to interact with this endpoint. All query and body arguments are listed below with their details.
URL Parameters
Passed in the URL query stringstring | Your unique WhatsApp Instance ID Example: | ||
string | Your API Access Token Example: | ||
string | The unique ID of the contact (e.g., 123456789@c.us) Example: |
Request Samples
Use these ready-to-go code snippets to integrate our API into your project quickly and efficiently. Choose your preferred language and library.
Expected Responses
Explore all possible responses and outcomes from the server. We have documented each status code with data examples to make success and error handling easier.
Example
{
"id": "123456789@c.us",
"name": "John Doe",
"pushname": "John",
"isBusiness": false,
"isEnterprise": false
}Command Palette
Search for a command to run...