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

Request

  • Base URL: https://waapi.app/api/v1
  • URL: https://waapi.app/api/v1/instances/{id}/client/action/upsert-contact
  • Auth: HTTP bearer

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

Request reached the instance. data.status reports whether the action was carried out; on error data carries message and explanation. Payload: Contact saved or updated successfully.

status'success' | 'error'

Whether the request reached the instance. success here does not mean the action was carried out — that is reported by data.status, which is the authoritative one. A malformed input arrives as status: success with data.status: error.

Example response

{
  "data": {
    "status": "success",
    "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"
}

Changes

No recorded changes to this operation across all 1 revision of this API.