Skip to main content

Update Contact

Partially update a contact. Only provided fields will be updated.

Request

PATCH /contacts/{uuid}

Path Parameters

ParameterTypeDescription
uuidstringContact's UUID

Request Body

All fields are optional. Only include fields you want to update.

ParameterTypeDescription
first_namestring|nullContact's first name (max 255 characters). Send null or empty string to clear.
last_namestring|nullContact's last name (max 255 characters). Send null or empty string to clear.
phonestring|nullContact's phone number (max 32 characters). Send null or empty string to clear.
external_idstring|nullExternal identifier (max 255 characters). Must be unique within your account. Send null or empty string to clear.
languagestring|nullISO 639-1 language code (2 characters). Send null or empty string to clear.
country_codestring|nullISO 3166-1 alpha-2 country code (2 characters). Send null or empty string to clear.
timezone_uuidstring|nullUUID of the timezone to assign to the contact, from List Timezones. Send null to clear. An unknown UUID returns 404.
contact_listsarray of stringsUUIDs of lists to add the contact to. Additive — listed lists are added; existing memberships are never removed by this endpoint. Each UUID must reference an existing list.
custom_fieldsarrayArray of custom field values to set (see Custom Fields section below)

Note: The email field cannot be updated.

Note: For contacts managed by the easycart integration, first_name and last_name updates are silently ignored. Other fields, including phone, external_id, language, country_code, and custom_fields, are still applied.

Note: contact_lists never removes memberships — to take a contact off a list, use Remove Contact from List. A contact that previously unsubscribed from a listed list is not re-added, and an unknown list UUID makes the whole request fail with 404.

Example Request

curl -X PATCH "https://email.easy.tools/api/v1/contacts/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"first_name": "Jane",
"language": "pl"
}'

Custom Fields

You can update custom field values by including the custom_fields array in your request.

Custom Field Object

FieldTypeRequiredDescription
field_keystringYesThe unique key of the custom field
valuemixedYes (key must be present)The value to set (type depends on field type). The value key must be present on each entry; send null or "" to delete the value.

Supported Field Types and Value Formats

Custom field values accept the same types and formats as on Create Contact — see Supported Field Types and Value Formats.

Example Request with Custom Fields

curl -X PATCH "https://email.easy.tools/api/v1/contacts/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"first_name": "Jane",
"custom_fields": [
{"field_key": "company", "value": "Acme Inc"},
{"field_key": "plan", "value": "enterprise"},
{"field_key": "is_vip", "value": true},
{"field_key": "signup_date", "value": "2025-01-15"},
{"field_key": "events-attended", "value": ["Webinar X", "Webinar Y"]},
{"field_key": "old_field", "value": null}
]
}'

Deleting Custom Field Values

To remove a custom field value from a contact, send null or an empty string "" as the value:

{
"custom_fields": [
{"field_key": "company", "value": null}
]
}

Response

Success Response (200 OK)

{
"data": {
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"email": "john@example.com",
"first_name": "Jane",
"last_name": "Doe",
"phone": "+48123456789",
"external_id": "customer_123",
"language": "pl",
"country_code": "US",
"lists": [
{
"uuid": "a3f1c5d2-7e84-4b9f-8c63-1d0e2f3a4b5c",
"name": "Newsletter"
}
],
"custom_fields": [
{
"field_key": "company",
"value": "Acme Inc"
}
],
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-16T14:00:00Z"
}
}

Error Responses

Not Found Error (404)

{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Contact with uuid '550e8400-e29b-41d4-a716-446655440000' not found"
}
}

Not Found Error (404) — Timezone

Returned when timezone_uuid does not match a timezone from List Timezones. The contact is not updated in this case.

{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Timezone not found"
}
}

Duplicate Contact Error (409 Conflict)

Returned when the external_id you sent is already used by another contact. Each external_id must be unique within your account. The contact is not updated in this case.

{
"error": {
"code": "DUPLICATE_RESOURCE",
"message": "Contact with external id 'customer_123' already exists"
}
}

Custom Field Validation Error (422 Unprocessable Entity)

{
"error": {
"code": "VALIDATION_ERROR",
"message": "Custom field validation failed",
"details": {
"custom_fields": ["Custom field 'invalid_key' not found"]
}
}
}

Invalid Select Option Error (422)

{
"error": {
"code": "VALIDATION_ERROR",
"message": "Custom field validation failed",
"details": {
"custom_fields": ["Custom field 'plan' value 'invalid_option' is not a valid option. Allowed options: free, pro, enterprise"]
}
}
}

Value Too Long Error (422)

Returned when a text custom field value exceeds the maximum length of 255 characters.

{
"error": {
"code": "VALIDATION_ERROR",
"message": "Custom field validation failed",
"details": {
"custom_fields": ["Custom field 'company' value exceeds the maximum length of 255 characters"]
}
}
}