Upsert contact
Upsert Contact
Update or create a contact in your phone address book and WhatsApp.
POST
Upsert contact
Update contact on your phone address book (and in WhatsApp).
This endpoint allows you to:
- Create a new contact in your phone’s address book
- Update an existing contact’s information
- Sync contact details to WhatsApp
This is useful for managing your WhatsApp contacts programmatically and keeping your address book synchronized.
Use Cases
Contact Management
Automatically create or update contacts when new users register in your system.CRM Synchronization
Keep your WhatsApp contacts in sync with your CRM database.Bulk Contact Import
Import and update multiple contacts from external sources.Request Parameters
chat_id
The contact identifier can be in one of these formats:- Phone number:
12132132130 - Chat ID (regular):
[email protected] - Chat ID (lid):
1234567890@lid
- chat ID can end with “@c.us” or “@lid”, or can be just a phone number - 12132132130
first_name
The contact’s first name (required).last_name
The contact’s last name (optional).Response Examples
Successful Response
When the contact is upserted successfully:Best Practices
Multiple Requests
If the contact doesn’t appear in your address book immediately, try making 2-3 requests with a few seconds delay between them.Verification
After upserting a contact, you can use the Get Contact endpoint to verify the update was successful.Error Handling
Always implement proper error handling to catch validation errors or API failures.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
application/json
Example:
"application/json"
application/json
Example:
"application/json"
Path Parameters
Instance UUID copied from hypersender dashboard
Example:
"{{ instance_id }}"
Body
application/json
Phone number (123123123) or chat ID ([email protected] or 123123@lid)
Example:
The contact's first name
Example:
"John"
The contact's last name
Example:
"Doe"