Contact fields

Update a custom contact field

Update a custom field's editable metadata, such as its display label or default_value. A changed default takes effect at once, for sends and for segment membership, because it is never stored on contacts. The key and type are immutable here — to change the key (and migrate every contact's stored value) use Rename a custom field's key instead. Requires the contacts:write capability.

patch/contact-fields/{id}

Request

  • Base URL: https://www.unitpost.com/api/v1
  • URL: https://www.unitpost.com/api/v1/contact-fields/{id}
  • Auth: HTTP bearer

Request body

labelstring
type'text' | 'number' | 'boolean' | 'date'
positioninteger
default_valuestring nullable

The value used for any contact that has none for this field (key missing or null): when an email is sent (merge tags) and when segments are evaluated. It's never written onto contacts, so changing it takes effect everywhere at once. Stored as a string and coerced to the field's type; null means no default. In segment filters, is_set / is_not_set check whether the contact itself has a value.

Response

The updated contact field.

object'contact_field' required
idstring required
keystring required
labelstring required
type'text' | 'number' | 'boolean' | 'date' required
default_valuestring nullable required

The value used for any contact that has none for this field (key missing or null): when an email is sent (merge tags) and when segments are evaluated. It's never written onto contacts, so changing it takes effect everywhere at once. Stored as a string and coerced to the field's type; null means no default. In segment filters, is_set / is_not_set check whether the contact itself has a value.

positionnumber required
created_atstring required
updated_atstring required

Changes

No recorded changes to this operation across all 1 revision of this API.