Contact fields

Create a custom contact field

Define a new typed custom field that can then be set on any contact and used as a template variable (e.g. plan, signup_date). An optional default_value is the value used for any contact that has none: 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. The key and type are fixed once created — rename the key later with Rename a custom field's key, or change the label with Update a custom contact field. See existing fields via List custom contact fields. Requires the contacts:write capability.

post/contact-fields

Request

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

Request body

keystring required
labelstring required
type'text' | 'number' | 'boolean' | 'date'
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

Created.

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.