Skip to navigation

Create or update a contact by phone number

Updates the contact that has the phone number, or creates one if the account has none. The API changes only the fields that you send. custom_attributes and additional_attributes merge into the stored values. Each value in notes adds a note. The API does the whole request as 1 unit: if a field is not valid, it changes nothing.

Authentication

api_access_tokenstring

An API key that an administrator creates in Settings > Developer. The personal access token of a user does not work. A key reaches every inbox, conversation, and contact in the account that created it, and nothing in other accounts.

Path parameters

account_idintegerRequired

The id of your account. It is the number after /accounts/ in the dashboard URL.

Request

This endpoint expects an object.
phone_numberstringRequiredformat: "^\+[1-9]\d{1,14}$"
The phone number in E.164 format. It identifies the contact.
namestringOptional
emailstringOptionalformat: "email"
identifierstringOptional
blockedbooleanOptional
avatar_urlstringOptional
The URL of an image. The API downloads it in the background as the avatar.
noteslist of stringsOptional
Each value adds a note to the contact. A blank value is not valid.
custom_attributesmap from strings to anyOptional
additional_attributesmap from strings to anyOptional

Response

The API updated a contact. created is false.

payloadobjectOptional

A contact, without contact_inboxes, with its 10 newest notes.

createdbooleanOptional

true if the API created the contact.

Errors

401
Unauthorized Error
422
Unprocessable Entity Error