<Intro>

<EndpointHeader />

<Description>

Updates a contact. Supplied fields are changed and omitted fields are left unchanged; set `first_name`, `last_name`, or `external_id` to null to clear them. Custom values in `data` are merged: keys you supply are set, keys set to null are removed, and keys you omit are unchanged.

Changing the email address or `external_id` to a value already used by another contact returns a conflict error.

</Description>

</Intro>

<Parameters in="path">

<Parameter name="contact_id" type="string">

<Description>

ID of the contact to update (`con_`-prefixed).

</Description>

</Parameter>

</Parameters>

<Payload kind="request">

<Field name="email" type="string">

<Description>

New email address for the contact. Trimmed and lowercased before it is stored and checked for uniqueness. Must not be in use by another contact in the workspace. Omit to keep the current address; a contact's email cannot be removed.

</Description>

</Field>

<Field name="first_name" type="nullable string">

<Description>

The contact's first name. Set to null to clear.

</Description>

</Field>

<Field name="last_name" type="nullable string">

<Description>

The contact's last name. Set to null to clear.

</Description>

</Field>

<Field name="external_id" type="nullable string">

<Description>

Your own identifier for this contact. Unique within the workspace when set. Set to null to clear.

</Description>

</Field>

<Field name="data" type="object">

<Description>

Custom property values to change, merged into the contact's existing data. Keys you supply are set, keys set to null are removed, and keys you omit are left unchanged. Each key must be a property created via the contact properties API, and each value must be a string, number, or boolean matching the property's declared type (strings up to 500 characters); writing an unregistered or archived key returns a validation error. The merged result is capped at 2 KB serialized.

</Description>

</Field>

</Payload>

<Payload kind="response">

<Field name="id" type="string" required>

<Description>

ID of the contact (`con_`-prefixed), accepted by every operation that takes a `contact_id`.

</Description>

</Field>

<Field name="email" type="string" required>

<Description>

The contact's email address, stored trimmed and lowercased. Unique within the workspace.

</Description>

</Field>

<Field name="first_name" type="nullable string">

<Description>

The contact's first name. Available in broadcast templates as the `contact.first_name` variable.

</Description>

</Field>

<Field name="last_name" type="nullable string">

<Description>

The contact's last name. Available in broadcast templates as the `contact.last_name` variable.

</Description>

</Field>

<Field name="external_id" type="nullable string">

<Description>

Your own identifier for this contact, such as a user ID in your system. Unique within the workspace when set.

</Description>

</Field>

<Field name="data" type="object">

<Description>

Custom property values for this contact, available as template variables in broadcasts. Each key is a property created via the contact properties API, and each value is a string, number, or boolean matching the property's declared type (strings up to 500 characters). Total size is capped at 2 KB serialized. Values stored under a property that was later archived remain readable here.

</Description>

</Field>

<Field name="channels" type="array of string">

<Description>

Channels this contact can be reached on, derived from the identifiers it has. A contact with an email address includes `email`. More values are added as a contact gains identifiers for other channels.

</Description>

</Field>

<Field name="created_at" type="string" required />

<Field name="updated_at" type="string" required />

</Payload>