Add Contacts

Add contact to WhatsApp

To add a contact to your WhatsApp address book via API, use the following endpoint:

PUT https://gate.whapi.cloud/contacts

Before using this method, make sure that your WhatsApp application has permission to access and manage contacts on your device. You can read more about this in our article.

Required parameters:

  • phone — the phone number of the contact to be added (in international format, without the “+” sign)

  • name — the display name of the contact

Example request:

curl --request PUT \
     --url https://gate.whapi.cloud/contacts \
     --header 'accept: application/json' \
     --header 'authorization: Bearer YOUR_TOKEN' \
     --header 'content-type: application/json' \
     --data '
{
  "phone": "919984351847",
  "name": "Gerald"
}'

Notes:

  • If you want to add multiple contacts at once, simply loop this request for each contact.

  • To stay safe, we recommend adding short pauses between each request to avoid triggering WhatsApp’s anti-spam algorithms for mass activity.


If your WhatsApp account has not yet received the update that enables contact management, the request will fail with the following error:

{
  "error": {
    "code": 404,
    "message": "Internal Error"
  }
}

This means that your WhatsApp version does not currently support adding contacts directly through the API. Make sure that in the app settings, under Privacy -> Contacts, you really don't see permission to access contacts; there is no such item there at all.

This feature is not yet available

Last updated

Was this helpful?