Skip to main content

Documentation 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.

The WPP.profile module exposes functions for reading and writing the connected account’s own profile data. You can retrieve or change the display name, the “about” text, and the profile picture, as well as check whether the account is a WhatsApp Business account and edit Business-specific fields such as description, address, business hours, and categories.

Functions

getMyProfileName()

Returns the current display name (push name) of the connected account. This is a synchronous call. Signature
getMyProfileName(): string
Returnsstring — the account’s current display name. Example
const name = WPP.profile.getMyProfileName();
console.log(name); // "Alice"

setMyProfileName(name)

Updates the display name of the connected account. Signature
setMyProfileName(name: string): Promise<boolean>
name
string
required
The new display name to set on the account.
ReturnsPromise<boolean> — resolves to true on success. Example
await WPP.profile.setMyProfileName('Alice Smith');

getMyStatus()

Retrieves the current “about” text of the connected account (the short bio shown on your profile page, distinct from WhatsApp Status posts). Signature
getMyStatus(): Promise<string>
ReturnsPromise<string> — the current about text. Example
const about = await WPP.profile.getMyStatus();
console.log(about); // "Available"

setMyStatus(statusText)

Updates the “about” text of the connected account. Signature
setMyStatus(statusText: string): Promise<boolean>
statusText
string
required
The new about text. WhatsApp enforces a maximum length of 139 characters.
ReturnsPromise<boolean> — resolves to true on success. Example
await WPP.profile.setMyStatus('Working from home');

getMyProfilePicture()

Retrieves the current profile picture model for the connected account. The returned object contains the image URL and metadata. Signature
getMyProfilePicture(): Promise<ProfilePicThumbModel>
ReturnsPromise<ProfilePicThumbModel> — a WhatsApp internal model containing the profile picture URL (eurl) and related metadata. Example
const pic = await WPP.profile.getMyProfilePicture();
console.log(pic.eurl); // CDN URL of the current profile picture

setMyProfilePicture(content)

Uploads a new profile picture for the connected account. The image is automatically resized to both thumbnail (96×96) and full size (640×640) before upload. Signature
setMyProfilePicture(content: string): Promise<{
  eurl: string;
  status: number;
  tag: string;
  token: string;
  _duplicate: boolean;
}>
content
string
required
A base64-encoded data URI of the image, e.g. data:image/jpeg;base64,.... JPEG and PNG are supported.
ReturnsPromise<object> — the server response containing the new picture URL and status.
The image is always resized and re-encoded to JPEG before upload. You do not need to pre-process the image yourself.
Example
// Read a file as a base64 data URI (browser context)
const toBase64 = (file) =>
  new Promise((resolve) => {
    const reader = new FileReader();
    reader.onload = () => resolve(reader.result);
    reader.readAsDataURL(file);
  });

const input = document.querySelector('input[type="file"]');
const dataUri = await toBase64(input.files[0]);

const result = await WPP.profile.setMyProfilePicture(dataUri);
console.log('New picture URL:', result.eurl);

removeMyProfilePicture()

Removes the profile picture from the connected account. Signature
removeMyProfilePicture(): Promise<boolean>
ReturnsPromise<boolean> — resolves to true if the server returned HTTP 200. Example
const removed = await WPP.profile.removeMyProfilePicture();
console.log(removed); // true

isBusiness()

Returns whether the connected account is a WhatsApp Business account. This is a synchronous call. Signature
isBusiness(): boolean | undefined
Returnsboolean | undefinedtrue for Business accounts, false for personal accounts, or undefined if the connection state is not yet resolved. Example
if (WPP.profile.isBusiness()) {
  console.log('This is a Business account');
}

editBusinessProfile(params)

Updates fields on the WhatsApp Business profile. Only the fields you include in params are changed; omitted fields are left unchanged.
This function throws a WPPError with code NOT_BUSINESS_PROFILE if the connected account is not a WhatsApp Business account. Always call isBusiness() first to guard against this error.
Signature
editBusinessProfile(params: BusinessProfileModel): Promise<BusinessProfileModel>
params
object
required
An object containing the Business profile fields to update. All fields are optional — include only those you want to change.
ReturnsPromise<BusinessProfileModel> — the updated Business profile model fetched from the server after the edit. Examples
await WPP.profile.editBusinessProfile({
  description: 'Premium coffee roasters since 2010',
  email: 'hello@example.com',
});
await WPP.profile.editBusinessProfile({
  address: '42 Main Street, New York, NY 10001',
});
await WPP.profile.editBusinessProfile({
  website: ['https://www.example.com', 'https://shop.example.com'],
});
await WPP.profile.editBusinessProfile({
  categories: [
    {
      id: '133436743388217',
      localized_display_name: 'Arts & Entertainment',
      not_a_biz: false,
    },
  ],
});
await WPP.profile.editBusinessProfile({
  businessHours: {
    mon: { mode: 'specific_hours', hours: [[480, 1080]] },
    tue: { mode: 'specific_hours', hours: [[480, 1080]] },
    wed: { mode: 'specific_hours', hours: [[480, 1080]] },
    thu: { mode: 'specific_hours', hours: [[480, 1080]] },
    fri: { mode: 'specific_hours', hours: [[480, 1080]] },
    sat: { mode: 'specific_hours', hours: [[660, 1020]] },
    sun: { mode: 'appointment_only' },
  },
  timezone: 'America/New_York',
});
Hours are expressed as minutes since midnight. 480 = 08:00, 1080 = 18:00.
await WPP.profile.editBusinessProfile({
  businessHours: {
    mon: { mode: 'open_24h' },
    tue: { mode: 'open_24h' },
    wed: { mode: 'open_24h' },
    thu: { mode: 'open_24h' },
    fri: { mode: 'open_24h' },
    sat: { mode: 'open_24h' },
    sun: { mode: 'open_24h' },
  },
  timezone: 'America/New_York',
});

Complete profile update workflow

The following example shows a full profile refresh — updating name, about text, and picture in sequence:
// 1. Read current values
const currentName = WPP.profile.getMyProfileName();
const currentAbout = await WPP.profile.getMyStatus();
console.log('Current name:', currentName);
console.log('Current about:', currentAbout);

// 2. Update display name
await WPP.profile.setMyProfileName('Acme Support Bot');

// 3. Update about text
await WPP.profile.setMyStatus('Automated support — replies within 5 min');

// 4. Upload a new profile picture from a URL
const response = await fetch('https://example.com/avatar.jpg');
const blob = await response.blob();
const dataUri = await new Promise((resolve) => {
  const reader = new FileReader();
  reader.onload = () => resolve(reader.result);
  reader.readAsDataURL(blob);
});
await WPP.profile.setMyProfilePicture(dataUri);

console.log('Profile updated successfully');
For WhatsApp Business accounts, combine editBusinessProfile() with the personal profile calls above to keep both the personal and business-facing profile information in sync.

Build docs developers (and LLMs) love