---
type: api
title: Get all field definitions
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-getcasefielddefinitionsdefaultspace
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-getcasefielddefinitionsdefaultspace
products:
  - Kibana
---

# Get all field definitions

Availability:

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/cases/field_definitions`
- `GET` `/s/{space_id}/api/cases/field_definitions`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/authentication#apikeyauth)

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Returns a paginated list of field definitions (field library entries) for the given owner. Requires the Cases feature to be enabled in the space.

## Query String Parameters

- `owner` (union string | [] string)
  The application that owns the field definitions (for example `cases`, `observability`, or `securitySolution`). Required.
  One of: `string` or `string[]`
- `isGlobal` (boolean)
  When true, returns only global field definitions (rendered on every case). When false, returns all definitions. Omit to return all.
- `page` (integer · default: 1)
  The page number to return.
- `perPage` (integer · max: 100 · default: 20)
  The number of items to return. Limited to 100 items.
- `sortField` (enum)
  The field to sort by. When omitted, results are sorted by `fieldDefinitionId` ascending and `sortOrder` is ignored.
  Values: `name`, `owner`, `isGlobal`, `displayOrder`
- `sortOrder` (enum  · default: desc)
  Determines the sort order.
  Values: `asc`, `desc`
- `search` (string · max: 1000)
  A case-insensitive substring to match against each definition's `name` and `description` fields. Definitions where neither field contains the substring are excluded.

## Responses

#### `200`

Indicates a successful call.

`application/json`

- `fieldDefinitions` ([] object)
  - `definition` (string)
    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.
  - `description` (string)
    Optional human-readable description of the field's purpose.
  - `displayOrder` (integer · min: 0)
    Position of a global field in the case details view. Assigned by the server and changed via the Field Library reorder controls.
  - `fieldDefinitionId` (string · max: 36)
    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.
  - `isGlobal` (boolean)
    When true, this field is rendered in every case regardless of which template the case uses.
  - `name` (string)
    The field name. Must match the `name` property in the YAML definition and is unique per owner (case-insensitive). Immutable after creation.
  - `owner` (string · max: 50)
    The application that owns this field definition.
- `page` (integer · min: 1)
  The current page number.
- `perPage` (integer · min: 1 · max: 100)
  The number of items per page.
- `total` (integer · min: 0)
  The total number of field definitions matching the query (before pagination).
#### `400`

The request is invalid. For example, the `owner` query parameter is missing or `page`/`perPage` are not integers.

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (integer)
#### `401`

Authorization information is missing or invalid.

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (integer)
#### `403`

The user does not have permission to read field definitions for the owner.

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (integer)
## Code Examples

#### Console

```console
GET /api/cases/field_definitions?owner={owner}
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/cases/field_definitions?owner={owner}"
```

## Response Examples

#### A paginated list of reusable field definitions.

```json
{
  "fieldDefinitions": [
    {
      "definition": "name: priority\nlabel: Priority\ntype: keyword\ncontrol: SELECT_BASIC\nmetadata:\n  options: [low, medium, high]\n  default: medium\n",
      "description": "Ticket priority level.",
      "fieldDefinitionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "isGlobal": false,
      "name": "priority",
      "owner": "cases"
    }
  ],
  "page": 1,
  "perPage": 20,
  "total": 1
}
```

#### The request is invalid.

```json
{
  "error": "Bad Request",
  "message": "Template [invalid-template-id] not found for owner [cases]",
  "statusCode": 400
}
```

#### Authorization information is missing or invalid.

```json
{
  "error": "Unauthorized",
  "message": "Unable to authenticate with the provided credentials.",
  "statusCode": 401
}
```

#### The user does not have access to the requested resource.

```json
{
  "error": "Forbidden",
  "message": "Unauthorized to access cases",
  "statusCode": 403
}
```

