---
title: "Working with alert comments using the API"
canonical: "https://docs.devo.com/space/latest/128057390/Working%20with%20alert%20comments%20using%20the%20API"
format: markdown
---
> Macro (toc)

## Overview

Check the list of available endpoints and methods to work with <u>alert comments</u> using the Alerts API:

| **Endpoints and methods** | **Description** |
| --- | --- |
| [POST]`/comments/add`<sup>[see below](#path1)</sup> | Add a comment to a triggered alert. |
| [POST]`/comments/bulk/add`<sup>[see below](#path2)</sup> | Add a comment to a set of triggered alerts. |
| [POST]`/comments/list`<sup>[see below](#path3)</sup> | Get all the comments of the indicated alerts. |
| [PUT] `/comments/update`<sup>[see below](#path4)</sup> | Update an alert comment. |
| [PUT] `/comments/bulk/update`<sup>[see below](#path5)</sup> | Update a set of comments with the same content. |
| [DELETE]`/comments/delete`<sup>[see below](#path6)</sup> | Delete alert comments. |

## Endpoints and methods

### > Macro (anchor)

<span style="color: #36b37e">**POST**</span><span style="color: #ff991f"> </span>`/comments/add`

Add a comment to a triggered alert.

 

### Request

#### Request body

The request JSON body must include the following parameters:

| **Parameter** | **Type** | **Definition** |
| --- | --- | --- |
| `elementId` <sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the ID of the alert to which you want to add the comment.<br>> ⚠️ **How can I get the ID of a triggered alert?**
> ⚠️ 
> ⚠️ Triggered alert IDs are displayed in the **Alerts** area of the Devo platform. You can find them in the **Alerts history** table at the bottom of the **Alerts dashboard** tab. Learn more about this in [Managing triggered alerts](https://docs.devo.com/space/latest/95127716).
> ⚠️ 
> ⚠️ You will also get the IDs of the triggered alerts in a domain using <span style="color: #ff991f">**GET**</span>`/v1/alerts/list` |
| `commentType`<span style="color: #ff5630"> </span><sup><span style="color: #ff5630">required</span></sup> | `string` | Indicate the comment type. Must be one of the following:<br>- `ALERT` - Add a new comment to an alert.
- `REPLY` - Reply to an existing comment. |
| `commentTitle` <sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the title of the comment. |
| `commentMsg`<span style="color: #ff5630"> </span><sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the message of the comment. |

#### Example

Find below a request example in cURL language. In this case, we are adding a new comment to the triggered alert with ID `123456`. Learn how to authorize your request [in this article](https://docs.devo.com/space/latest/233242664).

```
curl --location -g 'https://api-us.devo.com/alerts/v1/comments/add' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
    "elementId": "123456",
    "commentMsg": "From alerts API, comment for alert 123456",
    "commentTitle": "This is a comment for alert 123456",
    "commentType": "ALERT"
}'
```

 

### Response

Check the list of available responses:

| **Code** | **Description** |
| --- | --- |
| 200 | Successful response. comment created.<br>```
true
``` |
| 400 | Error in request |
| 401 | Unauthorized error. |
| 403 | Forbidden request. |
| 404 | Not found. |
| 405 | Method not allowed. |
| 500 | Server error and Java exception. |

### > Macro (anchor)

<span style="color: #36b37e">**POST**</span><span style="color: #ff991f"> </span>`/comments/bulk/add`

Add a comment to a set of triggered alerts.

 

### Request

#### Request body

The request JSON body must include the following parameters:

| **Parameter** | **Type** | **Definition** |
| --- | --- | --- |
| `elementIds` <sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the IDs of all the triggered alerts to which you want to add the comment, following this format:<br>```
"elementIds": ["string", "string", "string"]
```<br>> ⚠️ **How can I get the ID of a triggered alert?**
> ⚠️ 
> ⚠️ Triggered alert IDs are displayed in the **Alerts** area of the Devo platform. You can find them in the **Alerts history** table at the bottom of the **Alerts dashboard** tab. Learn more about this in [Managing triggered alerts](https://docs.devo.com/space/latest/95127716).
> ⚠️ 
> ⚠️ You will also get the IDs of the triggered alerts in a domain using <span style="color: #ff991f">**GET**</span>`/v1/alerts/list` |
| `commentType` <sup><span style="color: #ff5630">required</span></sup> | `string` | Indicate the comment type. Must be one of the following:<br>- `ALERT` - Add a new comment to an alert.
- `REPLY` - Reply to an existing comment. |
| `commentTitle` <sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the title of the comment. |
| `commentMsg`<span style="color: #ff5630"> </span><sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the message of the comment. |

#### Example

Find below a request example in cURL language. In this case, we are adding a new comment to the triggered alerts with IDs `123456` and `789012`. Learn how to authorize your request [in this article](https://docs.devo.com/space/latest/233242664).

```
curl --location -g 'https://api-us.devo.com/alerts/v1/comments/bulk/add' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
    "elementIds": ["123456", "789012"],
    "commentMsg": "From alerts API, comment for alerts 123456 and 789012",
    "commentTitle": "This is a comment for alerts 123456 and 789012",
    "commentType": "ALERT"
}'
```

 

### Response

Check the list of available responses:

| **Code** | **Description** |
| --- | --- |
| 200 | Successful response. comments created.<br>```
{
    "123456": true,
    "789012": true,
}
``` |
| 400 | Error in request |
| 401 | Unauthorized error. |
| 403 | Forbidden request. |
| 404 | Not found. |
| 405 | Method not allowed. |
| 500 | Server error and Java exception. |

### > Macro (anchor)

<span style="color: #36b37e">**POST**</span><span style="color: #ff991f"> </span>`/comments/list`

Get all comments of the indicated alerts.

 

### Request

#### Request body

The request JSON body must include the IDs of all the alerts from which you want to retrieve the comments, following this format:

```
["string", "string", "string"]
```

#### Example

Find below a request example in cURL language. In this case, we want to retrieve details about the comments added to the triggered alerts with IDs `123456` and `789012`. Learn how to authorize your request [in this article](https://docs.devo.com/space/latest/233242664).

```
curl --location --request POST 'https://api-us.devo.com/alerts/v1/comments/list' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '["123456", "789012"]'
```

 

### Response

Check the list of available responses:

| **Code** | **Description** |
| --- | --- |
| 200 | Successful response. List of comments for the indicated alerts retrieved.<br>```
[
  {
    "idAlert": 123456,
    "comments": [
      {
        "id": 709964,
        "author": {
          "id": 4076,
          "user": {
            "id": "*****",
            "email": "user@devo.com",
            "username": "Firewall Investigator",
            "telephone": "",
            "pwd": "**************",
            "status": 0,
            "validation_token": "**************",
            "defaultDomain": null,
            "updateDate": 1680613381000,
            "creationDate": 1679407982000,
            "otpSecret": "**************",
            "loginAttempts": 0,
            "recoveryAttempts": 0
          },
          "domain": {
            "id": "******",
            "name": "demo",
            "status": 0,
            "type": 12,
            "updateDate": 1651960466000,
            "creationDate": 1469195237000,
            "subscribed": 1,
            "daysLeft": 0,
            "showLanding": false,
            "reseller": null,
            "groupId": null,
            "alertsLastReseted": 1651960466000,
            "authRestrictions": false
          },
          "lastTimeLogged": 1680613391000,
          "status": 0,
          "creationDate": 1558079345000,
          "updateDate": 1680618378000,
          "pwd": "**************",
          "validationToken": "**************",
          "roleCustom": 118,
          "rolesCustom": null,
          "externalId": null,
          "owner": false,
          "alertsLastVisited": 1680618378000
        },
        "msg": "From alerts API, comment for alert 123456",
        "ack": "{\"ackUserList\":[\"4b1583b9-38e7-40b8-8364-86792d91f6bf\"]}",
        "creationDate": 1680617937000,
        "updateDate": 1680617937000,
        "elementType": "alert",
        "elementId": "133456",
        "domain": {
          "id": "1048ae29-8cae-4ae5-af29-e7d76c7de5d1",
          "name": "demo",
          "status": 0,
          "type": 12,
          "updateDate": 1651960466000,
          "creationDate": 1469195237000,
          "subscribed": 1,
          "daysLeft": 0,
          "showLanding": false,
          "reseller": null,
          "groupId": null,
          "alertsLastReseted": 1651960466000,
          "authRestrictions": false
        },
        "title": "This is a comment for alert 123456",
        "status": null,
        "task": false
      }
    ]
  },
  {
    "idAlert": 789012,
    "comments": [
      {
        "id": 709965,
        "author": {
          "id": 4076,
          "user": {
            "id": "******",
            "email": "user@devo.com",
            "username": "Firewall Investigator",
            "telephone": "",
            "pwd": "**************",
            "status": 0,
            "validation_token": "**************",
            "defaultDomain": null,
            "updateDate": 1680613381000,
            "creationDate": 1679407982000,
            "otpSecret": "**************",
            "loginAttempts": 0,
            "recoveryAttempts": 0
          },
          "domain": {
            "id": "******",
            "name": "demo",
            "status": 0,
            "type": 12,
            "updateDate": 1651960466000,
            "creationDate": 1469195237000,
            "subscribed": 1,
            "daysLeft": 0,
            "showLanding": false,
            "reseller": null,
            "groupId": null,
            "alertsLastReseted": 1651960466000,
            "authRestrictions": false
          },
          "lastTimeLogged": 1680613391000,
          "status": 0,
          "creationDate": 1558079345000,
          "updateDate": 1680618378000,
          "pwd": "**************",
          "validationToken": "**************",
          "roleCustom": 118,
          "rolesCustom": null,
          "externalId": null,
          "owner": false,
          "alertsLastVisited": 1680618378000
        },
        "msg": "From alerts API, comment for alert 789012",
        "ack": "{\"ackUserList\":[\"4b1583b9-38e7-40b8-8364-86792d91f6bf\"]}",
        "creationDate": 1680617937000,
        "updateDate": 1680617937000,
        "elementType": "alert",
        "elementId": "789012",
        "domain": {
          "id": "1048ae29-8cae-4ae5-af29-e7d76c7de5d1",
          "name": "demo",
          "status": 0,
          "type": 12,
          "updateDate": 1651960466000,
          "creationDate": 1469195237000,
          "subscribed": 1,
          "daysLeft": 0,
          "showLanding": false,
          "reseller": null,
          "groupId": null,
          "alertsLastReseted": 1651960466000,
          "authRestrictions": false
        },
        "title": "This is a comment for alert 789012",
        "status": null,
        "task": false
      }
    ]
  }
]
``` |
| 400 | Error in request |
| 401 | Unauthorized error. |
| 403 | Forbidden request. |
| 404 | Not found. |
| 405 | Method not allowed. |
| 500 | Server error and Java exception. |

### > Macro (anchor)

<span style="color: #00b8d9">**PUT**</span><span style="color: #ff991f"> </span>`/comments/update`

Update an alert comment.

 

### Request

#### Query string parameters

Query string parameters are optionally added after the path parameters, preceded by a question mark (`?`) and separated by an ampersand ()

| **Parameter** | **Type** | **Definition** |
| --- | --- | --- |
| `commentId` <sup><span style="color: #ff5630">required</span></sup> | `string` | ID of the comment to be updated.<br>> ⚠️ **How can I get the ID of an comment?**
> ⚠️ 
> ⚠️ comment IDs are not displayed in the Devo platform, so you should get them using <span style="color: #36b37e">**POST**</span><span style="color: #ff991f">** **</span>`/v1/comments/list` to get details of a set of comments in the domain. IDs are included in the response. |

#### Request body

The request JSON body must include the following parameters:

| **Parameter** | **Type** | **Definition** |
| --- | --- | --- |
| `elementId` <sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the ID of the alert that has the comment you want to update.<br>> ⚠️ **How can I get the ID of a triggered alert?**
> ⚠️ 
> ⚠️ Triggered alert IDs are displayed in the **Alerts** area of the Devo platform. You can find them in the **Alerts history** table at the bottom of the **Alerts dashboard** tab. Learn more about this in [Managing triggered alerts](https://docs.devo.com/space/latest/95127716).
> ⚠️ 
> ⚠️ You will also get the IDs of the triggered alerts in a domain using <span style="color: #ff991f">**GET**</span>`/v1/alerts/list` |
| `commentType`<span style="color: #ff5630"> </span><sup><span style="color: #ff5630">required</span></sup> | `string` | Indicate the comment type. Must be one of the following:<br>- `ALERT` - Add a new comment to an alert.
- `REPLY` - Reply to an existing comment. |
| `commentMsg`<span style="color: #ff5630"> </span><sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the new message of the comment. |
| `commentTitle` <sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the new title of the comment. |

#### Example

Find below a request example in cURL language. In this case, we want to update the comment with ID `010101` added to the triggered alert with ID `123456`. Learn how to authorize your request [in this article](https://docs.devo.com/space/latest/233242664).

```
curl --location --request PUT 'https://api-us.devo.com/alerts/v1/comments/update?commentId=010101' --header 'standAloneToken:YOUR_TOKEN' --header 'Content-Type: application/json' --data '{
    "elementId": ["123456"],
    "commentMsg": "Updated message",
    "commentTitle": "Updated title",
    "commentType": "ALERT"
}'
```

 

### Response

Check the list of available responses:

| **Code** | **Description** |
| --- | --- |
| 200 | Successful response. comment updated.<br>```
true
``` |
| 400 | Error in request |
| 401 | Unauthorized error. |
| 403 | Forbidden request. |
| 404 | Not found. |
| 405 | Method not allowed. |
| 500 | Server error and Java exception. |

### > Macro (anchor)

<span style="color: #00b8d9">**PUT**</span><span style="color: #ff991f"> </span>`/comments/bulk/update`

Update a set of alert comments with the same content.

 

### Request

#### Request body

The request JSON body must include the following parameters:

| **Parameter** | **Type** | **Definition** |
| --- | --- | --- |
| `idMap` <sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the IDs of the comments you want to update following this format:<br>```
{
    "additionalProp1": [
      0
    ],
    "additionalProp2": [
      0
    ],
    "additionalProp3": [
      0
    ]
  },
``` |
| `commentType`<span style="color: #ff5630"> </span><sup><span style="color: #ff5630">required</span></sup> | `string` | Indicate the comment type. Must be one of the following:<br>- `ALERT` - Add a new comment to an alert.
- `REPLY` - Reply to an existing comment. |
| `commentMsg`<span style="color: #ff5630"> </span><sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the new message of the comment. |
| `commentTitle` <sup><span style="color: #ff5630">required</span></sup> | `string` | Enter the new title of the comment. |

 

### Response

Check the list of available responses:

| **Code** | **Description** |
| --- | --- |
| 200 | Successful response. comments updated. |
| 400 | Unsuccessful response. Invalid parameters |

### > Macro (anchor)

<span style="color: #ff5630">**DELETE**</span><span style="color: #00b8d9"> </span>`/comments/delete`

Delete the specified alert comments.

 

### Request

#### Request body

The request JSON body must include the IDs of all the alerts whose comments you want to delete, following this format:

```
["string", "string", "string"]
```

Find below a request example:

```
https://api-us.devo.com/alerts/v1/comments/delete
```

```
["1660947", "1660948", "1660950"]
```

 

### Response

Check the list of available responses:

| **Code** | **Description** |
| --- | --- |
| 200 | Successful response. comments deleted.<br>```
true
``` |
| 400 | Unsuccessful response. Invalid parameters |