v1

latestOpenAPI 3.1.02026-07-1413113265.9 KB
contact

[BETA] add and update contact

Creates a new contact or updates an existing one in the address book. The contact will be synchronized to the device's address book if syncToAddressbook is true. Note: This endpoint is currently in beta and may change without notice.

post/instances/{id}/client/action/upsert-contact

Path parameters

idinteger required

Instance ID

Request body

phoneNumberstring required

The phone number of the contact

firstNamestring required

The first name of the contact

lastNamestring required

The last name of the contact

syncToAddressbookboolean

Whether to sync the contact to the device's address book

Example request

{
  "phoneNumber": "50664083362",
  "firstName": "John",
  "lastName": "Doe",
  "syncToAddressbook": true
}

Response

Contact saved or updated successfully

instanceIdstring
status'success' | 'error'

Example response

{
  "instanceId": "1111",
  "data": {
    "chatId": {
      "server": "c.us",
      "user": "1122563896",
      "_serialized": "1122563896@c.us"
    }
  },
  "links": {
    "self": "https://waapi.app/api/v1/instances/1/client/action/upsert-contact"
  },
  "status": "success"
}