Custom Fields
Define and manage the custom-field schema for locations and clients in your agency, and read or write the values stored against a specific entity. The field schema itself is agency-wide; per-entity values are still restricted to the clients a scoped key is authorized for.
Returns the custom-field schema defined for the given entity type (location or client), ordered the way they display in the UI.
List custom field definitions
/api/v1/custom-fields/definitions{
"data": [
{
"id": "cm_def_abc123",
"entityType": "location",
"key": "parking_notes",
"label": "Parking notes",
"type": "text",
"required": false,
"options": null,
"createdBy": "user",
"order": 0
}
]
}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.
Create a custom field definition
/api/v1/custom-fields/definitions{
"data": {
"definition": {
"id": "cm_def_abc123",
"entityType": "location",
"key": "parking_notes",
"label": "Parking notes",
"type": "text",
"required": false,
"options": null,
"createdBy": "user",
"order": 0
}
}
}Edits a custom field definition's label, required flag, options, or display order. The field's type and key can't be changed after creation.
Update a custom field definition
/api/v1/custom-fields/definitions{
"data": {
"definition": {
"id": "cm_def_abc123",
"entityType": "location",
"key": "parking_notes",
"label": "Parking notes",
"type": "text",
"required": true,
"options": null,
"createdBy": "user",
"order": 0
}
}
}Archives a custom field definition so it no longer appears in the schema or accepts new values. Values already stored under its key are left untouched. An unknown or already-archived definitionId is a no-op, not an error.
Archive a custom field definition
/api/v1/custom-fields/definitions{
"data": {
"archived": true
}
}Returns the custom-field values stored on one location or client, keyed by field key.
Get an entity's custom field values
/api/v1/custom-fields/values{
"data": {
"values": {
"parking_notes": "Free lot behind the building."
}
}
}Sets one custom-field value on a location or client. Pass null (or an empty value) to clear the field. The value is validated against the field's definition — for example, a select field's value must be one of its defined options.
Set a custom field value
/api/v1/custom-fields/values{
"data": {
"values": {
"parking_notes": "Free lot behind the building."
}
}
}