Create a field definition
https://{kibana_url}
- POST /api/cases/field_definitions
- POST /s/{space_id}/api/cases/field_definitions
Refer to Spaces for more information.
Creates a field definition in the field library. You must have the "Manage templates" sub-privilege for the Cases feature of the owning solution. Requires the Cases feature to be enabled in the space. Use dry_run=true to validate the request without writing anything.
Query Parameters
-
dry_runboolean · default: false When true, runs authorization, body, and name-uniqueness validation without creating the field definition. Returns
{ "valid": true }on success.
Request
-
definitionstring · max: 30000required -
The field definition as a YAML string describing a single field (type, label, control, metadata).
-
descriptionstring · max: 1000 -
Optional human-readable description of the field's purpose.
-
isGlobalboolean -
When true, this field is rendered in every case for this owner, regardless of the template used. Global fields cannot be demoted (set to false) while they are linked to an active custom field in the Cases configuration.
-
namestring · min: 1 · max: 50 -
The field name, unique per owner (case-insensitive). Must match the
namekey inside the YAML definition. When omitted, the name is extracted from the definition YAML automatically. Immutable after creation. -
ownerstring · min: 1 · max: 30required -
The application that owns this field definition.
Responses
Indicates a successful call. Returns the created field definition, or { "valid": true } when dry_run=true.
A field definition from the field library. The legacyKey attribute, which is a server-managed link to a migrated custom field, is not included in the public API response.
-
definitionstringrequired -
The field definition as a YAML string. New definitions are limited to 30 000 characters, but existing definitions created via internal tooling may be longer.
-
descriptionstring -
Optional human-readable description of the field's purpose.
-
displayOrderinteger · min: 0 -
Position of a global field in the case details view. Assigned by the server and changed via the Field Library reorder controls.
-
fieldDefinitionIdstring · max: 36required -
Unique server-assigned identifier for the field definition (UUID). May be UUIDv4 for definitions created through the public API, or UUIDv5 for definitions created by internal migration processes.
-
isGlobalboolean -
When true, this field is rendered in every case regardless of which template the case uses.
-
namestringrequired -
The field name. Must match the
nameproperty in the YAML definition and is unique per owner (case-insensitive). Immutable after creation. -
ownerstring · max: 50required -
The application that owns this field definition.
-
validbooleanrequired
The request body is invalid, the YAML definition is malformed, the name does not match the YAML definition's name, or the owner already has 200 field definitions.
-
errorstring -
messagestring -
statusCodeinteger
Authorization information is missing or invalid.
-
errorstring -
messagestring -
statusCodeinteger
The user does not have the manage templates privilege for the owner.
-
errorstring -
messagestring -
statusCodeinteger
A field definition with the same name already exists for the owner.
-
errorstring -
messagestring -
statusCodeinteger