Contacts & Profile
Manage your WhatsApp contact list and business profile
Contacts
Manage your WhatsApp contact list for broadcasts and messaging. Store phone numbers, tags, opt-in status, and custom fields for each contact.
Create a Contact
Create a WhatsApp contact with their phone number. The phone number links the contact to your WABA for messaging:
const { data } = await zernio.contacts.createContact({
body: {
profileId: 'YOUR_PROFILE_ID',
name: 'John Doe',
email: 'john@example.com',
tags: ['vip', 'newsletter'],
// Link this contact to your WhatsApp number
accountId: 'YOUR_WHATSAPP_ACCOUNT_ID',
platform: 'whatsapp',
platformIdentifier: '+1234567890'
}
});
console.log('Contact created:', data.contact.id);response = client.contacts.create_contact(
profile_id='YOUR_PROFILE_ID',
name='John Doe',
email='john@example.com',
tags=['vip', 'newsletter'],
# Link this contact to your WhatsApp number
account_id='YOUR_WHATSAPP_ACCOUNT_ID',
platform='whatsapp',
platform_identifier='+1234567890'
)
print(f"Contact created: {response.contact.id}")curl -X POST https://zernio.com/api/v1/contacts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"profileId": "YOUR_PROFILE_ID",
"name": "John Doe",
"email": "john@example.com",
"tags": ["vip", "newsletter"],
"accountId": "YOUR_WHATSAPP_ACCOUNT_ID",
"platform": "whatsapp",
"platformIdentifier": "+1234567890"
}'Bulk Import
Import up to 1,000 WhatsApp contacts at once with phone numbers and tags. Duplicates are automatically skipped:
const { data } = await zernio.contacts.bulkCreateContacts({
body: {
profileId: 'YOUR_PROFILE_ID',
accountId: 'YOUR_WHATSAPP_ACCOUNT_ID',
platform: 'whatsapp',
contacts: [
{ name: 'John Doe', platformIdentifier: '+1234567890', tags: ['vip'] },
{ name: 'Jane Smith', platformIdentifier: '+0987654321', tags: ['newsletter'] }
]
}
});
console.log(`Created: ${data.created}, Skipped: ${data.skipped}`);response = client.contacts.bulk_create_contacts(
profile_id='YOUR_PROFILE_ID',
account_id='YOUR_WHATSAPP_ACCOUNT_ID',
platform='whatsapp',
contacts=[
{'name': 'John Doe', 'platform_identifier': '+1234567890', 'tags': ['vip']},
{'name': 'Jane Smith', 'platform_identifier': '+0987654321', 'tags': ['newsletter']}
]
)
print(f"Created: {response.created}, Skipped: {response.skipped}")curl -X POST https://zernio.com/api/v1/contacts/bulk \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"profileId": "YOUR_PROFILE_ID",
"accountId": "YOUR_WHATSAPP_ACCOUNT_ID",
"platform": "whatsapp",
"contacts": [
{"name": "John Doe", "platformIdentifier": "+1234567890", "tags": ["vip"]},
{"name": "Jane Smith", "platformIdentifier": "+0987654321", "tags": ["newsletter"]}
]
}'Update a Contact
Update a WhatsApp contact's tags, opt-in status, or other fields:
const { data } = await zernio.contacts.updateContact({
path: { contactId: 'CONTACT_ID' },
body: {
tags: ['vip', 'promo-march'],
isSubscribed: true
}
});
console.log('Updated:', data.contact.id);response = client.contacts.update_contact(
contact_id='CONTACT_ID',
tags=['vip', 'promo-march'],
is_subscribed=True
)
print(f"Updated: {response.contact.id}")curl -X PATCH "https://zernio.com/api/v1/contacts/CONTACT_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tags": ["vip", "promo-march"], "isSubscribed": true}'Business Profile
// Get business profile
const { data } = await zernio.whatsapp.getWhatsAppBusinessProfile({
query: { accountId: 'YOUR_ACCOUNT_ID' }
});
console.log(data.businessProfile);
// Update business profile
await zernio.whatsapp.updateWhatsAppBusinessProfile({
body: {
accountId: 'YOUR_ACCOUNT_ID',
about: 'Your go-to store for widgets',
description: 'We sell the best widgets in town.',
email: 'hello@example.com',
websites: ['https://example.com']
}
});# Get business profile
response = client.whatsapp.get_whats_app_business_profile(
account_id='YOUR_ACCOUNT_ID'
)
print(response.business_profile)
# Update business profile
client.whatsapp.update_whats_app_business_profile(
account_id='YOUR_ACCOUNT_ID',
about='Your go-to store for widgets',
description='We sell the best widgets in town.',
email='hello@example.com',
websites=['https://example.com']
)# Get business profile
curl "https://zernio.com/api/v1/whatsapp/business-profile?accountId=YOUR_ACCOUNT_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
# Update business profile
curl -X POST https://zernio.com/api/v1/whatsapp/business-profile \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountId": "YOUR_ACCOUNT_ID",
"about": "Your go-to store for widgets",
"description": "We sell the best widgets in town.",
"email": "hello@example.com",
"websites": ["https://example.com"]
}'