PUT
/api/contacts
Creates or updates a contact in the session's address book.
Create or Update Contact
This endpoint allows you to manage contacts associated with the WhatsApp session. If you provide a jid
that does not exist in the session's contacts, a new contact will be created with the provided fullName
. If the jid
already exists, its name will be updated.
The optional saveOnPrimaryAddressbook
parameter can be used to sync the contact to the primary address book of the device running WhatsApp, though this behavior may vary by platform.
Parameters
Name | Type | Required | Description |
---|---|---|---|
jid | string | Yes | The JID of the contact to create or update (e.g., [email protected]). |
fullName | string | No | The full name to assign to the contact. |
saveOnPrimaryAddressbook | boolean | No | If set to true, it attempts to save the contact on the device's primary address book. Defaults to false. |
Code Examples
curl -X PUT "https://www.wasenderapi.com/api/contacts"
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"jid": "[email protected]",
"fullName": "John Doe",
"saveOnPrimaryAddressbook": true
}'
Response Examples
{
"success": true,
"data": {
"jid": "[email protected]",
"fullName": "John Doe"
}
}