Skip to main content

Create Contact

Create a new contact. If a contact with the same phone number already exists, the request will return an error.

POST /api/v1/contacts/

Request body

FieldTypeRequiredDescription
phone_numberstringYesPhone number with country code, without + (e.g., 911234567890)
first_namestringYesFirst name
last_namestringNoLast name
emailstringNoEmail address
companystringNoCompany name
tagsarrayNoList of tag strings (e.g., ["vip", "newsletter"])
waba_phone_idstringNoWhatsApp Business Account phone ID

Example request

curl -X POST https://server.waplify.io/api/v1/contacts/ \
-H "Authorization: Bearer wapl_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "911234567890",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane@example.com",
"company": "Acme Corp",
"tags": ["vip", "newsletter"]
}'

Success response (201 Created)

{
"status": "success",
"message": "Contact created successfully",
"contact": {
"id": "507f1f77bcf86cd799439012",
"first_name": "Jane",
"last_name": "Smith",
"phone_number": "911234567890",
"email": "jane@example.com",
"company": "Acme Corp",
"tags": ["vip", "newsletter"],
"opted_in": true,
"source": "api",
"created_at": "2024-06-15T10:00:00Z"
}
}
info

Contacts created via the API have their source field set to api automatically.