Skip to main content
POST
Upsert contact
Update a contact in your phone address book using a phone number. 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 using the contact’s phone number
This endpoint is intended for phone-number-based contact management and address book synchronization.

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

Use the contact’s phone number only.
  • Phone number: 12132132130
Send the number with country code and without spaces or the + sign. Example: 12132132130
Do not use an @lid identifier with this endpoint.If the same person is handled once by phone number and again by LID, WhatsApp may treat them as two separate contacts. For upsert operations, always use the phone number only.

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:
Phone Address Book Update NoteIf you have multiple WhatsApp apps installed on your phone, the API might only work with one account. You may need to make a few API requests with the same parameters and wait a few seconds between requests to update your phone address book.

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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Accept
string

application/json

Example:

"application/json"

Content-Type
string

application/json

Example:

"application/json"

Path Parameters

instance
string
required

Instance UUID copied from hypersender dashboard

Example:

"{{ instance_id }}"

Body

application/json
chat_id
string
required

Phone number (123123123) or chat ID ([email protected] or 123123@lid)

first_name
string
required

The contact's first name

Example:

"John"

last_name
string

The contact's last name

Example:

"Doe"

Response

Contact upserted successfully

message
string
Example:

"Contact upserted successfully."

data
object