Custom fields through the API

Available on ProOverviewOpen in DealJourney

Custom fields are the fields a workspace adds itself (see Add a custom field). Through the API they travel as one JSON object, custom_fields, keyed by each field's field_name.

Finding the keys

GET /api/v1/custom-fields/definitions?entity_type=customers lists the fields for one record type, with field_name, field_type, field_label and validation_rules. Record types are plural here: customers, contacts, leads, opportunities, activities, products, subscriptions. Needs custom_fields:read.

You can also send a field by its label as shown in the app, or that label's slug. It is saved under the real key and the response warns you (alias_resolved). A key that matches no field, or a label two fields share, is reported back in warnings rather than refused: read them.

Writing values

What you send is merged in. Fields you leave out keep their values. This holds for the record updates (PUT /api/v1/customers/{id}, contacts/{id}, leads/{id}, opportunities/{id} and activities/{id} with custom_fields) and for PUT /api/v1/custom-fields/values/{entity_type}/{id}. So to change one field, send just that field. The values endpoint needs custom_fields:write; the record endpoints need the record's own write scope.

Clearing one field. Send it as null:

``json { "custom_fields": { "region": null } } ``

  • On a record update, the field is removed from the record.
  • On the values endpoint, the field is kept with an empty value.

Either way it reads as empty in the app and in the API. Sending "custom_fields": null, or leaving it out, changes nothing. On the values endpoint the object must contain at least one key.

Creating a record with custom_fields stores what you send. On a new customer, lead or opportunity, fields marked required in the workspace must be present.

Value formats

| Field type | Send | | --- | --- | | text, textarea, email, phone, url | a string | | number, currency | a number | | date | "2026-11-14" | | datetime | an ISO 8601 timestamp | | boolean | true or false | | select | one option, exactly as spelled in validation_rules.options | | multiselect | an array of options: ["Sail", "Motor"] | | relation | the linked record's id, as a string |

The API does not check values against the field type or the option list. It stores what you send. A value outside the options does not show as one of the choices, and the app's own edit forms for customers, contacts and activities check the options when someone next saves that record. Validate on your side.

Creating a field definition

POST /api/v1/custom-fields/definitions with custom_fields:write:

``json { "entity_type": "customers", "field_name": "boat_type", "field_label": "Boat type", "field_type": "multiselect", "validation_rules": { "options": ["Sail", "Motor", "Other"] }, "is_required": false, "is_enabled": true, "description": "Kinds of boat the member owns" } ``

  • Required: entity_type (plural), field_name and field_label. field_type defaults to text.
  • field_name must start with a letter and use only letters, numbers and underscores, at most 64 characters, and be unique for that record type.
  • field_type is one of text, textarea, richtext, email, phone, url, number, currency, date, datetime, year, boolean, select, multiselect, user, entity, relation, file, image or log.
  • Options for select and multiselect go in validation_rules.options as a list of strings.
  • A field pointing at another record is a relation, with validation_rules such as { "target_entity_type": "contacts" }. Its value is that record's id.
  • Optional: field_order, default_value, description.

Changing or deleting definitions is PUT or DELETE on /api/v1/custom-fields/definitions/{id}. A key made by an administrator in settings can do this. A person acting through a connected app must be an administrator. Deleting a definition does not erase the values already stored on records.

Webhooks and the changes feed

A custom-field change raises that record's .updated webhook, whether it is sent with the record (PUT /api/v1/customers/{id}) or through the values endpoint, and it appears in the changes feed as an update to the record. See Receive webhooks from DealJourney and Keeping another system in step.

Was this helpful?

Related