Request body for creating a new field definition. Name and FieldType are required; all other properties are optional and fall back to repository defaults when omitted.

interface ICreateFieldDefinitionRequest {
    autoExtract?: boolean;
    constraint?: string;
    constraintError?: string;
    currency?: string;
    defaultValue?: string;
    description?: string;
    fieldType: LfRepositoryClientV2.FieldType;
    format?: LfRepositoryClientV2.FieldFormat;
    formatPattern?: string;
    hideListValues?: boolean;
    isIndexed?: boolean;
    isIndexedForReporting?: boolean;
    isMultiValue?: boolean;
    isRequired?: boolean;
    length?: number;
    listValues?: string[];
    name: string;
    properties?: { [key: string]: string };
    warnIfBlank?: boolean;
}

Implemented by

Properties

autoExtract?: boolean

Whether values for this field can be automatically extracted by AI/OCR services.

constraint?: string

A validation constraint expression for values stored in this field.

constraintError?: string

The error message returned when the constraint is violated.

currency?: string

The currency for numeric fields when Format is Currency.

defaultValue?: string

The default value applied to entries assigned to a template containing this field.

description?: string

The description of the field.

The type of the field. Required. Cannot be changed via UpdateFieldDefinition; use the ChangeFieldType endpoint to convert between types.

The display format for the field. Defaults to None when omitted.

formatPattern?: string

The custom format pattern. Only meaningful when Format is set to a value that supports custom patterns.

hideListValues?: boolean

Whether list values should be hidden in the UI. Applies only to list-backed fields.

isIndexed?: boolean

Whether the field is indexed for searching.

isIndexedForReporting?: boolean

Whether the field is indexed for reporting.

isMultiValue?: boolean

Whether the field supports multiple values.

isRequired?: boolean

Whether the field is required on entries assigned to a template containing it.

length?: number

The maximum length of the field for variable-length data types.

listValues?: string[]

Initial list values to populate. Applies only when FieldType is List. Order is preserved. Use the dedicated ListValues endpoints to manage list values after creation.

name: string

The name of the field. Required. Must be unique within the repository.

properties?: { [key: string]: string }

Initial custom properties to persist atomically with the field. The bag is an opaque application-defined string → string map scoped to the field definition; use it to attach integration metadata or application-specific configuration that should be created together with the field — for example to encode list-field display preferences such as sort order, or to record an external system's identifier for the field. Keys are application-defined; recommend namespaced keys (e.g. myapp.kind, com.acme.field.source) to avoid collisions. Manage after creation via the dedicated /FieldDefinitions/{id}/Properties endpoints. Constraints: empty keys, null values, and control characters are rejected with 400. Maximum 500 entries, 256 chars per key, 1000 chars per value.

warnIfBlank?: boolean

Whether the user should be warned when leaving the field blank.