Update a contact

SDK platic.clients.update()

Update a contact's profile by ID, phone number or email. Send only the fields you want to change.

Example

await platic.clients.update("5215512345678", { tags: ["vip"] });

Path parameters

ParameterTypeDescriptionRequired
idstringThe contact's ID, their phone number in E.164 format without +, or their email. If two contacts have that email, it answers 409 MULTIPLE_CONTACTS_MATCH: use the ID✓

Request body

FieldTypeRequiredDescription
namestring—Full name of the contact
firstnamestring—Contact's first name
lastnamestring—Contact's last name
emailstring—Contact's email
birthdatestring—Date of birth. Format: dd/mm/yyyy
genderenum—Gender: male or female
companystring—Company name
countryenum—Country of residence (ISO 3166-1 alpha-2 code)
statestring—State of residence
citystring—City of residence
addressstring—Full address
postalCodestring—Postal code
tagsarray—Array of tags
customFieldsobject—Custom fields
ownersarray—List of the emails of the responsible users
statusenum—Contact status: active or blocked. See Change the status
{
  "name": "Ana",
  "email": "ana@example.com",
  "tags": ["vip"],
  "customFields": {
    "plate": "ABC123",
    "reception_id": "REC001"
  }
}

Update behavior

  • owners: send a list of email addresses belonging to workspace users.
  • tags are merged with the existing tags without duplicates.
  • customFields are merged with the existing ones.
  • In customFields, for a field of type select send the id or the label of an active option (the id is stored); a value that matches no active option returns 400, and null or "" clears the value.
  • A phone number in the path is normalized and kept as the contact's identifier.
  • email is stored in lowercase.

Change the status

If you send status, contact moderation also applies: it updates the moderation history and open conversations. The response includes status and conversationsUpdated.

You can combine it with profile fields in the same call.

Response

{
  "status": "success",
  "message": "Client updated successfully",
  "data": {
    "id": "274fc73cb7d84a17955914fdc1a1f9d0"
  }
}

Errors

Statusdetails.codeWhen it happens
400INVALID_REQUESTA field is not valid, the body carries an unknown field, an owner email is not a user of the workspace, or a custom field is not defined or a select value matches no active option. details.issues says which
400INVALID_REQUESTThe credential covers several workspaces and ?workspace= is missing, or the supplied workspace is not authorized. details.available lists the available ones and details.requested shows the one you sent
400INVALID_PHONE_NUMBERThe phone number is not valid
401UNAUTHENTICATEDThe credential is missing or invalid
403FORBIDDENThe credential does not have the Contacts module (Missing contacts permission), or the user's role is read-only
403INSUFFICIENT_SCOPEAn OAuth token without the platica:write scope tried to write. details.requiredScope says which one is missing
404CLIENT_NOT_FOUNDNo contact in that workspace has that identifier, it was deleted, or it is outside the reach of the user's role
404WORKSPACE_NOT_FOUNDThe credential does not carry any workspace
409MULTIPLE_CONTACTS_MATCHTwo contacts have that email: use the ID. details.clientIds lists them
409CONFLICTThe contact's version was not available. Try again
502UPSTREAM_ERRORThe profile write could not be confirmed. Check the contact before retrying

The general error format is in Errors.

Notes