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 beCUSTOMorSYSTEM(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 requiredfieldDefinition: Required for field validation rules
Restrictions
- System Fields: Cannot create fields with
fieldType: SYSTEM - Field Type: Cannot change
fieldTypeon update - System Field DataType: Cannot change
dataTypefor SYSTEM fields - Order: Must be >= 0
- Parent Group:
parent_group_idcannot equalfieldKey
TEXT Field Validation
- For TEXT fields, you can use either
regexorminLength/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 Fields
consent_refscan only be set whendataTypeisCONSENT
Field Definition Validation
- Date fields:
minDatemust be beforemaxDate - SELECT/RADIO/MULTISELECT:
attributesKeysmust be provided - NUMBER:
minLength/maxLengthare treated as numeric range constraints
Request
Responses
- 200
- 201
- 400
- 401
- 409
- 417
OK
Created
Bad Request - Validation Error
Unauthorized
Conflict - Field Key Already Exists
Expectation Failed - Invalid Field Definition