---
type: api
title: List Comments
description: Retrieves all the comments for a given Resource, in reverse modified time order.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/v3/operation/operation-list-comment
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/v3/operation/operation-list-comment
products:
  - Elastic Cloud Enterprise
---

# List Comments

Authentication: required

## Paths

- `GET` `/comments/{resource_type}/{resource_id}`

#### Path parameters

- `resource_type` (string) — required
  The kind of Resource that a Comment belongs to. Should be one of [elasticsearch, kibana, apm, appsearch, enterprise_search, integrations_server, allocator, constructor, runner, proxy].
- `resource_id` (string) — required
  Id of the Resource that a Comment belongs to.

## Description

Retrieves all the comments for a given Resource, in reverse modified time order.

## Response

The Comments

`application/json`

- `values` (object[])
  The list of comments
  - `comment` (object)
    A persisted Comment
    - `id` (string)
      The id of this Comment
    - `user_id` (string)
      The user id of the user who wrote this Comment
    - `message` (string)
      The message content of this Comment
  - `metadata` (object)
    Metadata of an entity
    - `created_time` (string · format: date-time)
      Creation time
    - `modified_time` (string · format: date-time)
      Modification time
    - `version` (string)
      Version
## Code examples

#### curl

```curl
curl -X GET "${API_URL}/comments/${RESOURCE_TYPE}/${RESOURCE_ID}" \
  -u "${USERNAME}:${PASSWORD}"
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "values": [
    {
      "comment": {
        "id": "string",
        "user_id": "string",
        "message": "string"
      },
      "metadata": {
        "created_time": "string",
        "modified_time": "string",
        "version": "string"
      }
    }
  ]
}
```

