[[cases-api-delete-comments]]
== Delete comments from case API
++++
Delete comments
++++
Deletes one or all comments and alerts from a case.
[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification].
====
=== {api-request-title}
`DELETE :/api/cases//comments`
`DELETE :/api/cases//comments/`
`DELETE :/s//api/cases//comments`
`DELETE :/s//api/cases//comments/`
=== {api-prereq-title}
You must have `read` or `all` privileges and the `delete` sub-feature privilege
for the *Cases* feature in the *Management*, *{observability}*, or *Security*
section of the <>, depending
on the `owner` of the cases you're updating.
=== {api-path-parms-title}
``::
(Required, string) The identifier for the case. To retrieve case IDs, use
<>.
``::
(Optional, string) The identifier for the comment. To retrieve comment IDs, use
<> or <>. If it is not specified, all
comments are deleted.
::
(Optional, string) An identifier for the space. If it is not specified, the
default space is used.
=== {api-response-codes-title}
`204`::
Indicates a successful call.
=== {api-examples-title}
Delete all comments from case ID `9c235210-6834-11ea-a78c-6ffb38a34414`:
[source,console]
--------------------------------------------------
DELETE api/cases/a18b38a0-71b0-11ea-a0b2-c51ea50a58e2/comments
--------------------------------------------------
// KIBANA
Delete comment ID `71ec1870-725b-11ea-a0b2-c51ea50a58e2` from case ID
`a18b38a0-71b0-11ea-a0b2-c51ea50a58e2`:
[source,sh]
--------------------------------------------------
DELETE api/cases/a18b38a0-71b0-11ea-a0b2-c51ea50a58e2/comments/71ec1870-725b-11ea-a0b2-c51ea50a58e2
--------------------------------------------------
// KIBANA