Skip to main content

Custom Fields API

Extend the contact schema with typed fields specific to your business — lifetime_value, plan_tier, last_login_at, account_manager, etc. Custom fields are referenced from segment rules, flow conditions, message personalization, and the inbox UI. Base path: /api/v1/custom-fields Authentication: API key (X-API-Key) or session JWT.

Definitions

A field’s key and type are immutable: they are fixed at creation and cannot be changed by PATCH (changing either would orphan the values already stored on contacts). To switch a field’s type, delete it and create a new one.

Deleting a field that is in use

DELETE is guarded so you don’t silently break the segments, campaigns, and flows that reference a field. If the field is still referenced by any segment, campaign, or flow — or has values stored on any contact — the request returns 409 Conflict with code CUSTOM_FIELD_IN_USE. The response details list every dependent so you can review or clean up first:
To delete anyway, pass ?force=true:
With force=true the delete proceeds: the field’s values are stripped from every contact, and each dependent is flagged so you can find it afterward. Dependent segments are set to status: "broken". Dependent campaigns keep running — an in-flight send is never interrupted — but are flagged with a broken_custom_fields marker in their metadata. Dependent flows are set to status: "broken" so the automation runner skips them. The reference to the deleted field is not stripped from the campaign or flow filter: the filter JSON is left intact and only flagged, so the stale field-leaf remains until you edit or rebuild the filter. A field that is not referenced anywhere deletes without needing force.

Values

Per-contact values are written via a single endpoint and read inline as part of the contact resource.

Example — define a lifetime-value field, then set it

See also