Skip to main content

Store Field Setup

POST 

/fieldsetup-srv/fields

This API call stores a field setup (creates new or updates existing).

Validation Rules

Required Fields

  • fieldKey: Unique identifier (cannot be changed after creation)
  • dataType: Must be a valid dataType (TEXT, EMAIL, SELECT, etc.)
  • fieldType: Must be CUSTOM or SYSTEM (only CUSTOM can be created)
  • baseDataType: Underlying storage type (automatically derived from dataType)
  • localeTexts: Required - array of localized field texts. At least one localeText entry is required
  • fieldDefinition: Required for field validation rules

Restrictions

  • System Fields: Cannot create fields with fieldType: SYSTEM
  • Field Type: Cannot change fieldType on update
  • System Field DataType: Cannot change dataType for SYSTEM fields
  • Order: Must be >= 0
  • Parent Group: parent_group_id cannot equal fieldKey

TEXT Field Validation

  • For TEXT fields, you can use either regex or minLength/maxLength, but not both
  • If regex is provided, it must be valid Go regex syntax
  • If min/max length is provided, the system automatically converts to regex internally
  • consent_refs can only be set when dataType is CONSENT

Field Definition Validation

  • Date fields: minDate must be before maxDate
  • SELECT/RADIO/MULTISELECT: attributesKeys must be provided
  • NUMBER: minLength/maxLength are treated as numeric range constraints

Request

Responses

OK