# Insight API Add Comment

**URL:** <https://community.developer.atlassian.com/t/insight-api-add-comment/54461>\
**Category:** JSM Server\
**Tags:** insight, rest-api\
**Created:** [December 15, 2021, 10:37am UTC](https://community.developer.atlassian.com/t/insight-api-add-comment/54461 "2021-12-15T10:37:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveEllard](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/daveellard/32/44224_2.png) [@DaveEllard](https://community.developer.atlassian.com/u/DaveEllard)\
**Post date:** [December 15, 2021, 10:37am UTC](https://community.developer.atlassian.com/t/insight-api-add-comment/54461/1 "2021-12-15T10:37:04Z")

</div>

Please can anyone advise on how I can use the Insight REST API to add and retrieve comments stored against an object. We are using Insight version 8.9.1. Thanks in advance for any assistance.

---

<div class="post-metadata">

**Author:** ![DaveEllard](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/daveellard/32/44224_2.png) [@DaveEllard](https://community.developer.atlassian.com/u/DaveEllard)\
**Post date:** [December 15, 2021, 2:58pm UTC](https://community.developer.atlassian.com/t/insight-api-add-comment/54461/2 "2021-12-15T14:58:05Z")

</div>

Using developer tools I was able extract the API that the Insight GUI uses to add and retrieve comments.

- Add Comment  
POST Method  
https://{{URL}}/rest/insight-am/1/assets/{{KEY}}/comments

```json
{
  "comment": "<p>Hello World</p>"
}

```

- Get Comment  
GET Method  
https://{{URL}}/rest/insight-am/1/assets/{{KEY}}/comments

**Results**

```json
{
    "metadata": {
        "count": 1,
        "offset": 0,
        "limit": 25,
        "total": 1
    },
    "results": [
        {
            "id": 62,
            "author": {
                "key": "JIRAUSER11486",
                "username": "ELLARDDW",
                "displayName": "ELLARDDW",
                "avatarUrl": "https://{{URL}}/secure/useravatar?ownerId=JIRAUSER11486&avatarId=12200",
                "active": true
            },
            "role": "USERS",
            "comment": "<p>Hello World</p>"
            "createdAt": "2021-12-15T14:54:48",
            "updatedAt": "2021-12-15T14:54:48",
            "metadata": {
                "permissions": [
                    "VIEW",
                    "EDIT",
                    "DELETE"
                ]
            }
        }
    ]
}

```
