---
type: api
title: Get the fields applicable to a case
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-getapplicablefieldsdefaultspace
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-getapplicablefieldsdefaultspace
products:
  - Kibana
---

# Get the fields applicable to a case

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

## Paths

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

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

## Description

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

Returns the fields you can write to a case's `extended_fields` when creating a case for the given owner. Includes the owner's global (library-wide) fields and, when `templateId` is supplied, that template's fields. Migrated legacy custom fields appear as `global` fields. Requires the Cases feature to be enabled in the space.

## Query String Parameters

- `owner` (string · max: 30)
  The application that owns the cases (for example `cases`, `observability`, or `securitySolution`).
- `templateId` (string · max: 36)
  The identifier of a template to include the template's fields in the response.

## Responses

#### `200`

Indicates a successful call.

`application/json`

- `fields` ([] object)
  - `control` (string)
    The UI control for the field, such as `INPUT_TEXT`, `INPUT_NUMBER`, `SELECT_BASIC`, `TOGGLE`, or `MARKDOWN`.
  - `defaultValue` (string)
    The default value, as a string, when the field definition declares one.
  - `displayOnly` (boolean)
    When `true` the field is display-only (for example a `MARKDOWN` block): it is returned so the full form shape is visible, but it holds no value and its `key` cannot be written to `extended_fields`.
  - `isGlobal` (boolean)
    Whether the field is a global (library-wide) definition.
  - `key` (string)
    The storage key to write in the case `extended_fields` map. Follows the `<field_name>_as_<storage_type>` convention (for example `priority_as_keyword`).
  - `label` (string)
    The human-readable label. Falls back to `name` when no label is authored.
  - `name` (string)
    The field name as authored in the field definition.
  - `options` ([] string)
    The allowed values for `SELECT_BASIC`, `RADIO_GROUP`, and `CHECKBOX_GROUP` fields.
  - `type` (string)
    The storage type: `keyword`, `integer`, `long`, `boolean`, or `date`.
  - `required` (boolean)
    Whether a value must be supplied at write time.
  - `requiredOnClose` (boolean)
    Whether the field must be filled before the case can be closed.
  - `source` (enum)
    Where the field comes from: `global` for a library-wide (`isGlobal`) definition writable on any case, or `template` for a field contributed by the applied template.
    Values: `global`, `template`
#### `400`

The request is invalid, for example when the `templateId` does not exist for the owner or its definition is invalid.

`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 access to the requested owner.

`application/json`

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

#### Console

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

#### curl

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

## Response Examples

#### Fields applicable to a case

```json
{
  "fields": [
    {
      "control": "SELECT_BASIC",
      "defaultValue": "medium",
      "displayOnly": false,
      "isGlobal": true,
      "key": "priority_as_keyword",
      "label": "Priority",
      "name": "priority",
      "options": [
        "low",
        "medium",
        "high"
      ],
      "type": "keyword",
      "required": true,
      "requiredOnClose": false,
      "source": "global"
    },
    {
      "control": "TEXTAREA",
      "displayOnly": false,
      "isGlobal": false,
      "key": "rollout_notes_as_keyword",
      "label": "Rollout notes",
      "name": "rollout_notes",
      "type": "keyword",
      "required": false,
      "requiredOnClose": true,
      "source": "template"
    },
    {
      "control": "MARKDOWN",
      "displayOnly": true,
      "isGlobal": false,
      "key": "instructions_as_keyword",
      "label": "Instructions",
      "name": "instructions",
      "type": "keyword",
      "required": false,
      "requiredOnClose": false,
      "source": "template"
    }
  ]
}
```

#### 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
}
```

