---
type: api
title: Delete a field definition
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-deletecasefielddefinitiondefaultspace
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-deletecasefielddefinitiondefaultspace
products:
  - Kibana
---

# Delete a field definition

Availability:

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

## Paths

- `DELETE` `/api/cases/field_definitions/{field_definition_id}`
- `DELETE` `/s/{space_id}/api/cases/field_definitions/{field_definition_id}`

- [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)

#### Path Parameters

- `field_definition_id` (string · max: 36)
  The identifier for the field definition.

## Description

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

Deletes a field definition. You must have the "Manage templates" sub-privilege for the Cases feature of the owning solution. A field definition cannot be deleted while it is referenced by an active template or linked to an active custom field in the Cases configuration. Requires the Cases feature to be enabled in the space.

## Responses

#### `204`

The field definition was deleted.

#### `401`

Authorization information is missing or invalid.

`application/json`

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

The user does not have the manage templates privilege for the owner.

`application/json`

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

The field definition was not found.

`application/json`

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

The field definition is referenced by one or more active templates, or is linked to an active custom field in the Cases configuration.

`application/json`

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

#### Console

```console
DELETE /api/cases/field_definitions/{field_definition_id}
```

#### curl

```curl
curl -X DELETE "https://{kibana_url}/api/cases/field_definitions/{field_definition_id}"
```

## Response Examples

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

#### A resource conflict occurred.

```json
{
  "error": "Conflict",
  "message": "Template name \u0022Security incident\u0022 already exists for owner \u0022cases\u0022",
  "statusCode": 409
}
```

