Skip to main content

contacts

#Contact

Introduction to Contact Webhook Events

This section describes webhook events specific to contact management in the Contact system. These events are crucial for synchronizing and updating contact information, allowing your application to respond to changes such as new contacts added, updates to existing contacts, or reconfiguration of contact data.

Events

contacts.set

Structure

This event is triggered to send the loaded contact list. It is useful for getting an overview of contacts at the start of a session.
{
"event": "contacts.upsert", // Event name
"instance": { // Instance details
"owner": "[email protected]", // Instance owner
"name": "codechat", // Instance name
"id": "d4a58666-9737-485d-988b-d18a43ce8c75" // Unique identifier of the instance
},
"data": [ // Contact list
{
"phoneNumber": "5531900000000", // Contact's phone number
"wuid": "[email protected]",// Contact's WhatsApp identifier
"profilePictureUrl": "https://pps.whatsapp.net/v/t61.24694-24/[...].jpg?[...]", // Profile photo URL
"instanceName": "codechat" // Associated instance name
},
...
]
}

contacts.upsert

Structure

This event is used to obtain the list of all contacts, including additional information. It is especially useful for synchronizing contacts and their relevant information.
{
"event": "contacts.set", // Event name
"instance": { // Instance details
"owner": "[email protected]",
"name": "codechat",
"id": "d4a58666-9737-485d-988b-d18a43ce8c75"
},
"data": [ // Contact list with detailed information
{
"contactName": "name", // Contact name
"phoneNumber": "123", // Phone number
"wuid": "[email protected]", // WhatsApp Identifier
"profilePictureUrl": "https://pps.whatsapp.net/v/t61.24694-24/[...].jpg?[...]", // Profile photo URL
"instanceName": "codechat" // Associated instance name
},
...
]
}

contacts.update

Structure

This event informs you about updates to a contact's details, such as a change to their name, phone number, or profile photo URL. It is essential to keep contact data up to date.
{
"event": "contacts.update", // Event name
"instance": { // Instance details
"owner": "[email protected]",
"name": "codechat",
"id": "d4a58666-9737-485d-988b-d18a43ce8c75"
},
"data": [ // Updated contact details
{
"contactName": "update name", // Updated contact name
"phoneNumber": "update number123", // Updated phone number
"wuid": "update [email protected]", // WhatsApp identifier updated
"profilePictureUrl": "update url", // Updated profile photo URL
"instanceName": "codechat" // Associated instance name
}
]
}