---
type: api
title: Delete a case template
description: Soft-deletes a case template (all versions). Existing cases keep their pinned template reference; the template stops appearing in the case creation flow and in find responses. 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.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-deletecasetemplatedefaultspace
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-deletecasetemplatedefaultspace
products:
  - Kibana
---

# Delete a case template

Availability: Preview

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

## Paths

- `DELETE` `/api/cases/templates/{template_id}`

#### Path parameters

- `template_id` (string · max length: 36) — required
  The identifier for the template.
  Example: `9da1ea2a-09f8-4d0e-bf9d-09bf8c9d0f42`

## Description

Soft-deletes a case template (all versions). Existing cases keep their pinned template reference; the template stops appearing in the case creation flow and in find responses. 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.

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Responses

#### `204`

The template 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 template was not found.

`application/json`

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

#### Console

```console
DELETE kbn:/api/cases/templates/9da1ea2a-09f8-4d0e-bf9d-09bf8c9d0f42
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/cases/templates/9da1ea2a-09f8-4d0e-bf9d-09bf8c9d0f42" \
  -H "Authorization: ApiKey ${API_KEY}"
```

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

