v1Resources/Custom Fields/postCreate a custom field definition
Create a custom field definition
Adds a new custom field to the schema for the given entity type. The field's key is derived from its label and is immutable afterward; select-type fields require at least one option.
post
custom-fields:write/api/v1/custom-fields/definitionsRequest body
entityTypestring (location | client)required
The entity type this field applies to: "location" or "client".
labelstringrequired
The custom field's display label.
typestring (text | number | date | single_select | multi_select)required
The field's value type: text, number, date, single_select, or multi_select.
requiredbooleanoptional
Whether the field should be marked required. Optional; defaults to false.
optionsarray of stringoptional
The field's selectable options. Required (at least one) for single_select and multi_select fields; ignored for other types.
Response
dataobjectoptional
definitionobjectoptional
idstringoptional
Unique identifier for the custom field definition.
entityTypestring (location | client)optional
The entity type this definition applies to: "location" or "client".
keystringoptional
Immutable slug identifying this field, derived from its label at creation. Use this to reference the field when setting values.
labelstringoptional
The custom field's display label.
typestring (text | number | date | single_select | multi_select)optional
The field's value type.
requiredbooleanoptional
Whether the field is marked required. This isn't enforced by the API — it's a UI hint only.
optionsarray of stringoptional
The field's selectable options, for single_select and multi_select fields. Null for other types.
createdBystringoptional
Who created this field definition: "user" or "agent".
ordernumberoptional
The field's display order relative to other definitions for the same entity type, lowest first.
Errors
400The request is missing a required parameter or is otherwise malformed.
401Missing, invalid, expired, or revoked API key.
403The key lacks the required scope, or isn't authorized for this client/location.
422The request is missing a required parameter or is otherwise malformed.
429Too many requests. Retry after the number of seconds in the Retry-After header.
post/api/v1/custom-fields/definitions
Your API key
Request body*
{
"data": {
"definition": {
"id": "cm_def_abc123",
"entityType": "location",
"key": "parking_notes",
"label": "Parking notes",
"type": "text",
"required": false,
"options": null,
"createdBy": "user",
"order": 0
}
}
}