How to manage the contact list in the phone book of a connected phone?#
In this article, you'll learn what WhatsApp contacts are and how they differ from your phone's contacts.
The GREEN-API provides methods for managing WhatsApp contacts and the main device's phone book (phone):
- AddContact - for adding a contact
- EditContact - for editing a contact
- DeleteContact - for deleting a contact
WhatsApp continues to work on WhatsApp contacts functionality.
We recommend keeping WhatsApp updated on your primary device and staying up to date with our news on our channel and blog.
- How to enable or disable WhatsApp contacts
- How WhatsApp works with contacts enabled
- How WhatsApp works with contacts disabled
- How to delete a contact from the main device's phone book
WhatsApp currently has its own contact manager, which is not linked to the primary device's phonebook by default. This is done to enhance privacy and to make it easier to transfer WhatsApp contacts across different devices: Android, iOS, Windows, and the web. By default, contact synchronization between the primary device's phonebook and WhatsApp may be disabled, so you need to enable contact syncing in the API and, sometimes, on your primary device.
How to enable or disable WhatsApp contacts#
Open your WhatsApp app.
For iPhone:
Go to Settings > Privacy > Contacts > toggle WhatsApp Contacts on or off.
For Android:
Go to Settings > Privacy > Contacts > toggle WhatsApp Contacts on or off.
How WhatsApp works with contacts enabled#
-
You decide which contacts to sync with the primary device's phonebook and which not. For this purpose, the AddContact and EditContact methods have an optional
saveInAddressbookfield for saving the contact to the primary device's phonebook. -
You can create contacts that will be assigned to a specific WhatsApp account if you use multiple WhatsApp accounts on the primary device.
-
All contacts will be automatically restored to the primary device or by reinstalling WhatsApp.
How does WhatsApp work when contacts are disabled?#
-
You can only edit and create WhatsApp contacts using your phone's address book.
-
You can't choose which contacts to sync with your primary device and which can be saved only in WhatsApp.
-
Contacts won't be automatically restored if you change phones or reinstall WhatsApp.
How to delete a contact from the primary device's phonebook#
- To delete a contact from the primary device's phonebook, make sure WhatsApp Contacts is enabled on the primary device.
- Use the EditContact method with the optional
saveInAddressbookfield enabled so WhatsApp can work with the contact in the primary device's phonebook. - Use the DeleteContact method to delete the contact from both WhatsApp contacts and the primary device's phonebook.
If you have disabled WhatsApp syncing with your primary device's phonebook for saving or subsequent editing, the DeleteContact method will only delete the number from your WhatsApp contacts.