Create a contact
POST /v1/contacts
Adds a contact and sends contact.created.
Needs contacts:write.
phone string Required
The number with its country code, with or without +. Spaces, dashes,
dots and brackets are ignored, and a leading 00 counts as +.
name string
The name your business gives the contact. A new WhatsApp profile name never replaces it: whatsapp_name follows the customer.
Up to 255 characters.
attributes object
Your own fields on the contact. Names are 1 to 64 letters, digits or underscores, and can’t start with __. A string value is up to 1024 characters. A contact can have at most 50.
A map; each value is a string or number or boolean.
tags array of strings
The contact’s tags. New tags join your workspace’s tag list in grey.
Up to 50 items. Each 1 to 50 characters.
number_id string · uuid
The number to message the contact from, from GET /v1/numbers.
marketing_opt_out boolean
Set to true if the contact opted out of marketing messages.
Headers
Section titled “Headers”Idempotency-Key string
Send one so a retry doesn’t add the contact twice. See Retrying safely.
1 to 255 characters.
Bringing back a deleted contact
Section titled “Bringing back a deleted contact”If the number belongs to a contact you deleted, that contact is brought back with its history, and the fields you send are applied. That also returns 201.
Returns
Section titled “Returns”201 The contact object. The contact, new or brought back.
Errors
Section titled “Errors”Besides the ones every request can get:
invalid_fieldA field breaks a rule: for example an attribute name with a space, a tag that is too long, or a number_id that isn’t in your workspace.idempotency_mismatchThe Idempotency-Key was used before for a different request, or by another of your API keys.