Skip to main content
GET
/
{instance}
/
contacts
/
profile-picture
Get profile picture
curl --request GET \
  --url https://app.hypersender.com/api/whatsapp/v2/{instance}/contacts/profile-picture \
  --header 'Authorization: Bearer <token>'
{
  "message": "Profile picture retrieved successfully.",
  "data": {
    "profilePictureURL": "https://pps.whatsapp.net/v/t61.24694-24/374498176_337577482181161_7091117586184162691_n.jpg?ccb=11-4&oh=01_Q5Aa3gEERUGD4fegyplSv2MnHmt_UIA9JnpjREhSJMNVWZC-RA&oe=6970FAAA&_nc_sid=5e03e0&_nc_cat=104"
  }
}
Get the profile picture URL for any contact in your WhatsApp instance. This endpoint allows you to:
  • Retrieve profile picture URLs for contacts
  • Display contact avatars in your application
  • Verify contact identity visually
The returned URL is a direct link to the WhatsApp CDN where the profile picture is hosted.

Use Cases

Display Contact Avatars

Show contact profile pictures in your application’s UI for better user experience.

Contact Identity Verification

Visually verify contact identity before sending sensitive information.

CRM Integration

Sync contact profile pictures to your CRM system for better contact management.

Chat Interface

Build a chat interface that displays profile pictures alongside messages.

Request Parameters

chat_id

The contact identifier can be in one of these formats:

Response Examples

Successful Response

When the profile picture is found:
{
  "message": "Profile picture retrieved successfully.",
  "data": {
    "profilePictureURL": "https://pps.whatsapp.net/v/t61.24694-24/374498176_337577482181161_7091117586184162691_n.jpg?ccb=11-4&oh=01_Q5Aa3gEERUGD4fegyplSv2MnHmt_UIA9JnpjREhSJMNVWZC-RA&oe=6970FAAA&_nc_sid=5e03e0&_nc_cat=104"
  }
}

No Profile Picture

When the contact has no profile picture:
{
  "message": "Profile picture not available.",
  "data": {
    "profilePictureURL": null
  }
}

Best Practices

Cache the profile picture URLs to reduce API calls. Profile pictures don’t change frequently.
The profile picture URLs are temporary and may expire. Always fetch a fresh URL if you encounter a broken image.
Some users may have privacy settings that prevent you from viewing their profile picture. In such cases, the URL will be null or point to a default image.

Integration Example

Displaying Profile Pictures in Your App

// Fetch profile picture
const response = await fetch(
  `https://app.hypersender.com/api/whatsapp/v2/${instance}/contacts/profile-picture?chat_id=${chatId}`,
  {
    headers: {
      'Authorization': `Bearer ${apiKey}`,
      'Content-Type': 'application/json'
    }
  }
);

const data = await response.json();

// Use the URL in your UI
if (data.data.profilePictureURL) {
  document.getElementById('avatar').src = data.data.profilePictureURL;
} else {
  // Use a default avatar
  document.getElementById('avatar').src = '/default-avatar.png';
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Accept
string

application/json

Example:

"application/json"

Content-Type
string

application/json

Example:

"application/json"

Path Parameters

instance
string
required

Instance UUID copied from hypersender dashboard

Example:

"{{ instance_id }}"

Query Parameters

chat_id
string
required

Phone number (123123123) or chat ID ([email protected] or 123123@lid)

Example:

"100875997589545@lid"

Response

Profile picture retrieved successfully

message
string
Example:

"Profile picture retrieved successfully."

data
object