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

# Get the fields applicable to an existing case

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

## Paths

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

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

#### Path Parameters

- `caseId` (string)
  The identifier for the case. To retrieve case IDs, use the search cases (`_find)` API. All non-ASCII characters must be URL encoded.

## Description

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

Returns the fields you can write to the case's `extended_fields`. The case determines the owner and any applied template. The response includes the owner's global fields (library-wide) and, if the case has a template, that template's fields. Requires the Cases feature to be enabled in the space.

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

Authorization information is missing or invalid.

`application/json`

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

The user does not have access to the case.

`application/json`

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

The case was not found.

`application/json`

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

#### Console

```console
GET /api/cases/{caseId}/fields
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/cases/{caseId}/fields"
```

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

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

#### The requested resource was not found.

```json
{
  "error": "Not Found",
  "message": "Saved object [cases-template/9da1ea2a-09f8-4d0e-bf9d-09bf8c9d0f42] not found",
  "statusCode": 404
}
```

