Get comments APIedit

Gets a comment or all comments for a case.

For the most up-to-date API details, refer to the open API specification. For a preview, check out Case APIs.

Requestedit

GET <kibana host>:<port>/api/cases/<case ID>/comments/<comment ID>

GET <kibana host>:<port>/s/<space_id>/api/cases/<case ID>/comments/<comment ID>

GET <kibana host>:<port>/api/cases/<case_id>/comments [8.1.0] Deprecated in 8.1.0.

GET <kibana host>:<port>/s/<space_id>/api/cases/<case_id>/comments [8.1.0] Deprecated in 8.1.0.

Prerequisitesedit

You must have read privileges for the Cases feature in the Management, Observability, or Security section of the Kibana feature privileges, depending on the owner of the cases with the comments you’re seeking.

Path parametersedit

<case_id>
(Required, string) The identifier for the case. To retrieve case IDs, use Find cases.
<comment_id>

(Optional, string) The identifier for the comment. To retrieve comment IDs, use Get case.

If it is not specified, all comments are retrieved. [8.1.0] Deprecated in 8.1.0. The comment identifier will no longer be optional.

<space_id>
(Optional, string) An identifier for the space. If it is not specified, the default space is used.

Response codesedit

200
Indicates a successful call.

Examplesedit

Retrieves comment ID 8048b460-fe2b-11ec-b15d-779a7c8bbcc3 from case ID ecbf8a20-fe2a-11ec-b15d-779a7c8bbcc3:

GET api/cases/ecbf8a20-fe2a-11ec-b15d-779a7c8bbcc3/comments/8048b460-fe2b-11ec-b15d-779a7c8bbcc3

The API returns the requested comment JSON object. For example:

{
  "id":"8048b460-fe2b-11ec-b15d-779a7c8bbcc3",
  "version":"WzIzLDFd",
  "type":"user",
  "owner":"cases",
  "comment":"A new comment",
  "created_at":"2022-07-07T19:32:13.104Z",
  "created_by":{
    "email":null,
    "full_name":null,
    "username":"elastic"
  },
  "pushed_at":null,
  "pushed_by":null,
  "updated_at":null,
  "updated_by":null
}