---
type: api
title: "Delete a case comment or alert"
description: "Deletes a comment or alert from a case. If it is a file attachment, its file is also deleted. 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."
url: https://www.elastic.co/elastic/docs-builder/docs/4904/api/kibana/operation/operation-deletecasecommentdefaultspace
resource: https://www.elastic.co/elastic/docs-builder/docs/4904/api/kibana/operation/operation-deletecasecommentdefaultspace
products:
  - Kibana
---

# Delete a case comment or alert

Authentication: required

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

## Paths

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

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
- `caseId` (string) — required
  The identifier for the case. To retrieve case IDs, use the search cases (`_find)` API. All non-ASCII characters must be URL encoded.
  Example: `9c235210-6834-11ea-a78c-6ffb38a34414`
- `commentId` (string) — required
  The identifier for the comment. To retrieve comment IDs, use the get case or search cases (`_find`) APIs.
  Example: `71ec1870-725b-11ea-a0b2-c51ea50a58e2`

## Description

Deletes a comment or alert from a case. If it is a file attachment, its file is also deleted. 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.

## Header parameters

- `kbn-xsrf` (string) — required
  Cross-site request forgery protection

## 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/71ec1870-725b-11ea-a0b2-c51ea50a58e2
```

#### curl

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

## Response examples

#### Authorization information is missing or invalid.

`application/json`

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

