Skip to main content

Set Contact Custom Field

Set a custom field value for a contact. Creates or updates the value (upsert behavior).

Request​

PUT /contacts/{contactUuid}/custom-fields/{fieldUuid}

Path Parameters​

ParameterTypeDescription
contactUuidstringContact's UUID
fieldUuidstringCustom field's UUID

Request Body​

ParameterTypeRequiredDescription
valuemixedYesThe value to set (type depends on field type)

Supported Field Types and Value Formats​

Field TypeExpected ValueExamples
textstring or numeric (max 255 characters)"Acme Inc", 123
numbernumeric42, 3.14, "100"
booleanbool, string, or inttrue, false, "yes", "no", 1, 0
datedate string"2025-01-15", "15/01/2025"
datetimedatetime string (no Z/offset)"2025-01-15T10:30:00", "2025-01-15 10:30:00"
selectstringMust match one of the predefined options
listarray of strings["Webinar X", "Webinar Y"] — replaces the whole list

For a list field, value must be an array. Each element is a non-empty string up to 255 characters, max 100 elements; elements are trimmed and de-duplicated, order is preserved. Sending [] clears the list.

Supported Date Formats (for date fields)​

A date value is stored as YYYY-MM-DD; any time component is dropped. Accepted input:

  • ISO 8601: Y-m-d\TH:i:sP, Y-m-d\TH:i:s
  • Standard: Y-m-d H:i:s, Y-m-d
  • European: d/m/Y, d-m-Y, d.m.Y (with optional time)
  • US: m/d/Y, m-d-Y (with optional time)

Supported DateTime Formats (for datetime fields)​

A datetime value accepts only the following formats — no timezone offset or Z suffix:

  • Y-m-d\TH:i:s — e.g. "2025-01-15T10:30:00"
  • Y-m-d H:i:s — e.g. "2025-01-15 10:30:00"
  • Y-m-d\TH:i — e.g. "2025-01-15T10:30"
  • Y-m-d H:i — e.g. "2025-01-15 10:30"

When read back via Get Contact Custom Fields, a datetime value is returned in ISO 8601 UTC form with a Z suffix (e.g. "2025-01-15T10:30:00Z").

Example Request (text)​

curl -X PUT "https://email.easy.tools/api/v1/contacts/daccf9ab-b134-4d18-835d-473fc11e6b24/custom-fields/431a5cd9-a69b-48c3-b25f-2031a2b5a582" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"value": "Acme Inc"
}'

Example Request (boolean)​

curl -X PUT "https://email.easy.tools/api/v1/contacts/daccf9ab-b134-4d18-835d-473fc11e6b24/custom-fields/3f07e9ca-e8b6-4822-b77b-dcb26b32ac8b" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"value": true
}'

Example Request (date)​

curl -X PUT "https://email.easy.tools/api/v1/contacts/daccf9ab-b134-4d18-835d-473fc11e6b24/custom-fields/f10b27ee-315f-4c3c-a780-5f550e3a9db9" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"value": "2025-01-15"
}'

Example Request (list)​

curl -X PUT "https://email.easy.tools/api/v1/contacts/daccf9ab-b134-4d18-835d-473fc11e6b24/custom-fields/7d6786eb-2e2f-4d14-9599-5a10bbb1714c" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"value": ["Webinar X", "Webinar Y"]
}'

Response​

Success Response (200 OK)​

{
"data": {
"field_key": "company",
"value": "Acme Inc"
}
}

For a list field, value is the normalized array that was stored:

{
"data": {
"field_key": "events-attended",
"value": ["Webinar X", "Webinar Y"]
}
}

Response Fields​

FieldTypeDescription
field_keystringThe field's unique key
valuemixedThe stored value

Error Responses​

Not Found Error (404 — Contact)​

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

Not Found Error (404 — Field)​

{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Custom field not found"
}
}

The value-validation errors below return details as an empty array.

Validation Error (422 — Invalid value type)​

The message names the field's type, e.g. number, boolean, date, datetime, text, select, or list.

{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid value for field type: number",
"details": []
}
}

Validation Error (422 — Invalid select option)​

{
"error": {
"code": "VALIDATION_ERROR",
"message": "Value 'invalid' is not a valid option. Allowed options: free, pro, enterprise",
"details": []
}
}

Validation Error (422 — Value too long)​

Returned when a text value, or any list element, exceeds the maximum length of 255 characters.

{
"error": {
"code": "VALIDATION_ERROR",
"message": "Value exceeds the maximum length of 255 characters",
"details": []
}
}

Validation Error (422 — Too many list elements)​

Returned when a list value contains more than 100 elements.

{
"error": {
"code": "VALIDATION_ERROR",
"message": "List exceeds the maximum of 100 elements",
"details": []
}
}