Business Profile API
Get and update WhatsApp Business profile information including business details, contact information, description, and profile photo.
Official Documentation: WhatsApp Business Profiles API
Overview
The Business Profile API allows you to manage your WhatsApp Business presence:
- Get Profile: Retrieve current business profile information
- Update Profile: Modify business details and contact info
- Profile Photo: Upload and manage business profile pictures
- Business Vertical: Categorize your business type
Endpoints
GET /{PHONE_NUMBER_ID}/whatsapp_business_profile?fieldsPOST /{PHONE_NUMBER_ID}/whatsapp_business_profilePOST /app/uploads?file_length&file_type&file_namePOST /{UPLOAD_ID}GET /{UPLOAD_ID}Important Notes
Quick Start
import WhatsApp, { BusinessVerticalEnum } from 'meta-cloud-api';
const client = new WhatsApp({ accessToken: process.env.CLOUD_API_ACCESS_TOKEN!, phoneNumberId: Number(process.env.WA_PHONE_NUMBER_ID), businessAcctId: process.env.WA_BUSINESS_ACCOUNT_ID!,});
// Get current profileconst profile = await client.businessProfile.getBusinessProfile([ 'about', 'address', 'description', 'email', 'vertical', 'websites',]);
// Update profileawait client.businessProfile.updateBusinessProfile({ messaging_product: 'whatsapp', about: 'Your trusted partner for quality service', address: '123 Main Street, San Francisco, CA 94102', description: 'We provide excellent customer service 24/7', email: 'support@example.com', vertical: BusinessVerticalEnum.RETAIL, websites: ['https://example.com', 'https://shop.example.com'],});Get Business Profile
Retrieve current business profile information.
Get All Fields
const profile = await client.businessProfile.getBusinessProfile([ 'about', 'address', 'description', 'email', 'profile_picture_url', 'vertical', 'websites',]);
console.log(profile);// {// about: 'We are a leading retailer',// address: '123 Main St, SF, CA',// description: 'Quality products since 2020',// email: 'info@example.com',// vertical: 'RETAIL',// websites: ['https://example.com']// }Get Specific Fields
// Just contact infoconst contact = await client.businessProfile.getBusinessProfile([ 'email', 'websites',]);
// Just description fieldsconst info = await client.businessProfile.getBusinessProfile([ 'about', 'description', 'vertical',]);Update Business Profile
Modify business profile information.
Update Basic Information
await client.businessProfile.updateBusinessProfile({ messaging_product: 'whatsapp', about: 'Premium quality products and services', description: 'Your one-stop shop for all your needs',});Update Contact Information
await client.businessProfile.updateBusinessProfile({ messaging_product: 'whatsapp', email: 'contact@example.com', websites: ['https://www.example.com'], address: '456 Commerce Ave, New York, NY 10001',});Update Business Vertical
import { BusinessVerticalEnum } from 'meta-cloud-api/enums';
await client.businessProfile.updateBusinessProfile({ messaging_product: 'whatsapp', vertical: BusinessVerticalEnum.ECOMMERCE,});Complete Profile Update
import { BusinessVerticalEnum } from 'meta-cloud-api/enums';
await client.businessProfile.updateBusinessProfile({ messaging_product: 'whatsapp', about: 'Fast and reliable service since 2020', address: '789 Business Blvd, Suite 100, Austin, TX 78701', description: 'We specialize in providing top-tier customer service and quality products. Available 24/7 for your convenience.', email: 'hello@mybusiness.com', vertical: BusinessVerticalEnum.PROFESSIONAL_SERVICES, websites: [ 'https://mybusiness.com', 'https://shop.mybusiness.com', ],});Profile Photo Management
Upload and set a business profile picture.
Upload Profile Photo (3-Step Process)
import fs from 'fs';
// Read image fileconst imageBuffer = fs.readFileSync('/path/to/profile.jpg');const fileSize = imageBuffer.length;
// Step 1: Create upload sessionconst session = await client.businessProfile.createProfilePhotoUploadSession({ file_length: fileSize, file_type: 'image/jpeg', file_name: 'profile.jpg',});
// Step 2: Upload file bytesawait client.businessProfile.uploadProfilePhotoBytes( session.id, imageBuffer);
// Step 3: Get file handleconst upload = await client.businessProfile.getProfilePhotoUpload(session.id);
// Step 4: Update profile with new photoawait client.businessProfile.updateBusinessProfile({ messaging_product: 'whatsapp', profile_picture_handle: upload.h,});Complete Profile Photo Upload Helper
async function updateProfilePhoto(imagePath: string) { const imageBuffer = fs.readFileSync(imagePath); const mimeType = 'image/jpeg'; // or 'image/png'
// Create session const session = await client.businessProfile.createProfilePhotoUploadSession({ file_length: imageBuffer.length, file_type: mimeType, file_name: path.basename(imagePath), });
// Upload bytes await client.businessProfile.uploadProfilePhotoBytes( session.id, imageBuffer );
// Get handle const upload = await client.businessProfile.getProfilePhotoUpload(session.id);
// Set as profile photo await client.businessProfile.updateBusinessProfile({ messaging_product: 'whatsapp', profile_picture_handle: upload.h, });
console.log('Profile photo updated successfully');}Response Formats
Get Profile Response
{ about: 'We provide quality service', address: '123 Main St, San Francisco, CA', description: 'Leading provider since 2020', email: 'contact@example.com', profile_picture_url: 'https://...', vertical: 'RETAIL', websites: ['https://example.com']}Update Profile Response
{ success: true}Upload Session Response
{ id: 'UPLOAD_SESSION_ID'}Profile Photo Upload Response
{ h: 'FILE_HANDLE_STRING'}Business Verticals
Available business category options:
import { BusinessVerticalEnum } from 'meta-cloud-api/enums';
// Common verticalsBusinessVerticalEnum.ECOMMERCE // Online retailBusinessVerticalEnum.RETAIL // Physical retailBusinessVerticalEnum.FOOD // Food & beverageBusinessVerticalEnum.HEALTH // HealthcareBusinessVerticalEnum.EDUCATION // Education servicesBusinessVerticalEnum.ENTERTAINMENT // Entertainment & mediaBusinessVerticalEnum.TRAVEL // Travel & hospitalityBusinessVerticalEnum.AUTOMOTIVE // AutomotiveBusinessVerticalEnum.REAL_ESTATE // Real estateBusinessVerticalEnum.PROFESSIONAL_SERVICES // Professional servicesBusinessVerticalEnum.BEAUTY // Beauty & personal careBusinessVerticalEnum.NONPROFIT // Non-profit organizationsBusinessVerticalEnum.GOVERNMENT // Government servicesBusinessVerticalEnum.OTHER // Other categoriesError Handling
try { await client.businessProfile.updateBusinessProfile({ messaging_product: 'whatsapp', email: 'invalid-email', });} catch (error) { if (error.response) { const { code, message } = error.response.data.error;
switch (code) { case 100: console.error('Invalid parameter value'); break; case 131031: console.error('Profile photo too large'); break; default: console.error(`Error ${code}: ${message}`); } }}Best Practices
-
Provide Complete Information: Fill out all relevant fields
await client.businessProfile.updateBusinessProfile({messaging_product: 'whatsapp',about: 'Clear, concise description (256 chars max)',description: 'More detailed business information (512 chars max)',email: 'support@example.com',address: 'Full address with city, state, ZIP',vertical: BusinessVerticalEnum.RETAIL,websites: ['https://primary.com', 'https://shop.com'],}); -
Use High-Quality Profile Photos: Follow image guidelines
// ✅ Good// - Square image (minimum 192x192px)// - High resolution// - Professional appearance// - File size under 5MB// ❌ Avoid// - Low resolution images// - Stretched or distorted photos// - Generic stock images -
Choose Accurate Vertical: Select the best matching category
// ✅ Good - specific matchvertical: BusinessVerticalEnum.ECOMMERCE // For online stores// ❌ Less ideal - too genericvertical: BusinessVerticalEnum.OTHER -
Keep Information Current: Update regularly
// Update profile when details changeawait client.businessProfile.updateBusinessProfile({messaging_product: 'whatsapp',address: 'New store location',websites: ['https://new-domain.com'],}); -
Validate Email Format: Ensure proper email addresses
function isValidEmail(email: string): boolean {return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);}const email = 'contact@example.com';if (isValidEmail(email)) {await client.businessProfile.updateBusinessProfile({messaging_product: 'whatsapp',email,});} -
Use HTTPS for Websites: Only secure URLs
// ✅ Goodwebsites: ['https://example.com']// ❌ Bad - insecurewebsites: ['http://example.com']
Available Profile Fields
When calling getBusinessProfile(), you can request these fields:
about: Short business description (256 characters)address: Physical business addressdescription: Detailed business information (512 characters)email: Business email addressprofile_picture_url: Current profile photo URLvertical: Business category/industrywebsites: Array of website URLs (max 2)
Character Limits
- about: 256 characters
- description: 512 characters
- address: 256 characters
- email: 128 characters
Profile Photo Requirements
- Format: JPEG or PNG
- Size: 5 MB maximum
- Dimensions: Minimum 192x192 pixels (square recommended)
- Aspect Ratio: 1:1 (square) recommended
Related Documentation
- Phone Numbers API - Manage phone numbers
- Messages API - Send messages
- WABA API - Manage business accounts
- Business Profile Guidelines - Official guidelines
Source Code
View the source code on GitHub: BusinessProfileApi.ts