Mon-Fri 10am - 6pm
Create Contact
Base URL for your account: https://cpaas.studio
POST
/api/whatsapp/v1/contacts
Add a contact with its opt-in record. consent_source and consent_evidence are required — Meta requires businesses to hold an opt-in for every number they message.
Parameters
| Param | Type | Required | Notes |
|---|---|---|---|
channel |
string | if the key is not restricted | |
phone |
string | yes | |
name |
string | no | |
attributes |
object | no | Template variables: {"city": "Kochi"}. |
groups |
string[] | no | Group uids. |
consent_source |
string | yes | website_form, checkout, in_store, paper_form, phone_call, existing_customer, other. |
consent_evidence |
string, 10–500 | yes | Where and how the person opted in. |
Request example
curl -X POST "https://cpaas.studio/api/whatsapp/v1/contacts" \
-H "X-API-KEY: cpk_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"channel":"WCH54DZ7M7M5V","phone":"+919876543210","name":"Asha","attributes":{"city":"Kochi"},"groups":["WGR4K7Q2M9X"],"consent_source":"website_form","consent_evidence":"Ticked the WhatsApp updates box at checkout"}'
Success response (data)
{
"contact": {
"phone": "+919876543210",
"channel": "WCH54DZ7M7M5V",
"username": null,
"name": "Asha",
"profile_name": "Asha K",
"attributes": {
"city": "Kochi"
},
"optout": null,
"inactive": false,
"consent_source": "website_form",
"consent_at": "2026-10-09T10:00:00+00:00",
"created_via": "api",
"created_at": "2026-10-09T10:00:00+00:00"
}
}
Errors
| Code | Status | When |
|---|---|---|
REQ_VALIDATION_FAILED |
422 | Invalid phone, missing consent, or the number is already a contact on this number. |
Need more context? See Getting started for authentication, the response envelope, and the full error-code reference.