---
type: api
title: Delete all case comments and alerts
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-deletecasecommentsdefaultspace
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-deletecasecommentsdefaultspace
products:
  - Kibana
---

# Delete all case comments and alerts

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

## Paths

- `DELETE` `/api/cases/{caseId}/comments`
- `DELETE` `/s/{space_id}/api/cases/{caseId}/comments`

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

Deletes all comments and alerts from a case. You must have `all` privileges for the **Cases** feature in the **Management**, **Observability**, or **Security** section of the Kibana feature privileges, depending on the owner of the cases you're deleting.

## Responses

#### `204`

Indicates a successful call.

#### `401`

Authorization information is missing or invalid.

`application/json`

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

#### Console

```console
DELETE kbn:/api/cases/9c235210-6834-11ea-a78c-6ffb38a34414/comments
```

#### curl

```curl
curl \
  --request DELETE 'https://localhost:5601/api/cases/9c235210-6834-11ea-a78c-6ffb38a34414/comments' \
  --header "Authorization: $API_KEY" \
  --header "kbn-xsrf: true"
```

## Response Examples

#### Authorization information is missing or invalid.

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

