# 알러트 댓글

## 개요

다음 API 작업을 사용하여 상호작용하세요 [알러트 댓글](https://docs.panther.com/ko/alerts/alert-management#adding-comments-to-alerts) Panther에서.

API를 호출하려면, [Panther REST API 사용 방법](https://docs.panther.com/ko/panther/api/rest/..#how-to-use-the-panther-rest-api) 지침을 참조하세요— [이 문서 페이지에서 직접 호출하는 방법에 대한 지침을 포함합니다](https://docs.panther.com/ko/panther/api/rest/..#step-3-invoke-the-panther-rest-api).

## 필요 권한

* 에 대해 `GET` 작업의 경우, API 토큰에는 `알러트 읽기` 권한이 있어야 합니다.
* 에 대해 `POST` 작업의 경우, API 토큰에는 `알러트 관리` 권한이 있어야 합니다.

## 작업

## POST /alert-comments

> Create a comment for an alert

```json
{"openapi":"3.0.3","info":{"title":"Panther REST API","version":"1.0"},"tags":[{"name":"comment","description":"The comment api handles all operations for alerts comments"}],"servers":[{"url":"https://{api_host}","variables":{"api_host":{"default":"your-api-host"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"CommentAPI.ModifyCommentReq":{"type":"object","properties":{"alertId":{"type":"string","description":"The alert ID the comment is associated with"},"body":{"type":"string","description":"The body of the comment"},"format":{"type":"string","description":"The format of the comment","enum":["PLAIN_TEXT","HTML"]}},"required":["alertId","body","format"]},"CommentAPI.Comment":{"type":"object","properties":{"alertId":{"type":"string","description":"The alert ID the comment is associated with"},"body":{"description":"The body of the comment"},"createdAt":{"type":"string","description":"The date the comment was created"},"createdBy":{"type":"object","properties":{"id":{"type":"string","enum":["user","api-token","system"]},"type":{"type":"string"}},"description":"The actor who created the comment"},"format":{"type":"string","description":"The format of the comment","enum":["PLAIN_TEXT","HTML"]},"id":{"type":"string","description":"The comment ID"},"updatedAt":{"type":"string","description":"The date the comment was updated"},"updatedBy":{"type":"object","properties":{"id":{"type":"string","enum":["user","api-token","system"]},"type":{"type":"string"}},"description":"The actor who updated the comment"}}},"CommentAPI.BadRequestError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"CommentAPI.NotFoundError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"paths":{"/alert-comments":{"post":{"tags":["comment"],"summary":"Create a comment for an alert","operationId":"comment#create","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.ModifyCommentReq"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.Comment"}}}},"400":{"description":"bad_request: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.BadRequestError"}}}},"404":{"description":"not_found: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.NotFoundError"}}}}}}}}}
```

## GET /alert-comments/{id}

> Get a comment for an alert

```json
{"openapi":"3.0.3","info":{"title":"Panther REST API","version":"1.0"},"tags":[{"name":"comment","description":"The comment api handles all operations for alerts comments"}],"servers":[{"url":"https://{api_host}","variables":{"api_host":{"default":"your-api-host"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"CommentAPI.Comment":{"type":"object","properties":{"alertId":{"type":"string","description":"The alert ID the comment is associated with"},"body":{"description":"The body of the comment"},"createdAt":{"type":"string","description":"The date the comment was created"},"createdBy":{"type":"object","properties":{"id":{"type":"string","enum":["user","api-token","system"]},"type":{"type":"string"}},"description":"The actor who created the comment"},"format":{"type":"string","description":"The format of the comment","enum":["PLAIN_TEXT","HTML"]},"id":{"type":"string","description":"The comment ID"},"updatedAt":{"type":"string","description":"The date the comment was updated"},"updatedBy":{"type":"object","properties":{"id":{"type":"string","enum":["user","api-token","system"]},"type":{"type":"string"}},"description":"The actor who updated the comment"}}},"CommentAPI.BadRequestError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"CommentAPI.NotFoundError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"paths":{"/alert-comments/{id}":{"get":{"tags":["comment"],"summary":"Get a comment for an alert","operationId":"comment#get","parameters":[{"name":"id","in":"path","description":"ID of the comment","required":true,"schema":{"type":"string","description":"ID of the comment"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.Comment"}}}},"400":{"description":"bad_request: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.BadRequestError"}}}},"404":{"description":"not_found: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.NotFoundError"}}}}}}}}}
```

## POST /alert-comments/{id}

> Update a comment for an alert

```json
{"openapi":"3.0.3","info":{"title":"Panther REST API","version":"1.0"},"tags":[{"name":"comment","description":"The comment api handles all operations for alerts comments"}],"servers":[{"url":"https://{api_host}","variables":{"api_host":{"default":"your-api-host"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"CommentAPI.ModifyCommentReq":{"type":"object","properties":{"alertId":{"type":"string","description":"The alert ID the comment is associated with"},"body":{"type":"string","description":"The body of the comment"},"format":{"type":"string","description":"The format of the comment","enum":["PLAIN_TEXT","HTML"]}},"required":["alertId","body","format"]},"CommentAPI.Comment":{"type":"object","properties":{"alertId":{"type":"string","description":"The alert ID the comment is associated with"},"body":{"description":"The body of the comment"},"createdAt":{"type":"string","description":"The date the comment was created"},"createdBy":{"type":"object","properties":{"id":{"type":"string","enum":["user","api-token","system"]},"type":{"type":"string"}},"description":"The actor who created the comment"},"format":{"type":"string","description":"The format of the comment","enum":["PLAIN_TEXT","HTML"]},"id":{"type":"string","description":"The comment ID"},"updatedAt":{"type":"string","description":"The date the comment was updated"},"updatedBy":{"type":"object","properties":{"id":{"type":"string","enum":["user","api-token","system"]},"type":{"type":"string"}},"description":"The actor who updated the comment"}}},"CommentAPI.BadRequestError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"CommentAPI.NotFoundError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"paths":{"/alert-comments/{id}":{"post":{"tags":["comment"],"summary":"Update a comment for an alert","operationId":"comment#update","parameters":[{"name":"id","in":"path","description":"ID of the comment","required":true,"schema":{"type":"string","description":"ID of the comment"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.ModifyCommentReq"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.Comment"}}}},"400":{"description":"bad_request: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.BadRequestError"}}}},"404":{"description":"not_found: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.NotFoundError"}}}}}}}}}
```

## GET /alert-comments

> List alert comments

```json
{"openapi":"3.0.3","info":{"title":"Panther REST API","version":"1.0"},"tags":[{"name":"comment","description":"The comment api handles all operations for alerts comments"}],"servers":[{"url":"https://{api_host}","variables":{"api_host":{"default":"your-api-host"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"CommentAPI.ListResp":{"type":"object","properties":{"next":{"type":"string","description":"Pagination token for the next page of results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/CommentAPI.Comment"}}},"required":["results"]},"CommentAPI.Comment":{"type":"object","properties":{"alertId":{"type":"string","description":"The alert ID the comment is associated with"},"body":{"description":"The body of the comment"},"createdAt":{"type":"string","description":"The date the comment was created"},"createdBy":{"type":"object","properties":{"id":{"type":"string","enum":["user","api-token","system"]},"type":{"type":"string"}},"description":"The actor who created the comment"},"format":{"type":"string","description":"The format of the comment","enum":["PLAIN_TEXT","HTML"]},"id":{"type":"string","description":"The comment ID"},"updatedAt":{"type":"string","description":"The date the comment was updated"},"updatedBy":{"type":"object","properties":{"id":{"type":"string","enum":["user","api-token","system"]},"type":{"type":"string"}},"description":"The actor who updated the comment"}}},"CommentAPI.BadRequestError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"paths":{"/alert-comments":{"get":{"tags":["comment"],"summary":"List alert comments","operationId":"comment#list","parameters":[{"name":"alert-id","in":"query","description":"The alert ID the comments are associated with","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"The alert ID the comments are associated with"}},{"name":"cursor","in":"query","description":"the pagination token","allowEmptyValue":true,"schema":{"type":"string","description":"the pagination token"}},{"name":"limit","in":"query","description":"the maximum results to return","allowEmptyValue":true,"schema":{"type":"integer","description":"the maximum results to return","default":25,"format":"int64","maximum":50}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.ListResp"}}}},"400":{"description":"bad_request: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentAPI.BadRequestError"}}}}}}}}}
```
