Create comment

Namespace: microsoft.graph

Create a comment for an existing incident based on the specified incident id property.


One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) SecurityIncident.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application SecurityIncident.ReadWrite.All

HTTP request

POST /security/incidents/{incidentId}/comments

Request headers

Name Description
Authorization Bearer {token}. Required.
Content-Type application/json. Required.

Request body

In the request body, use @odata.type to specify the parameter type of alertComment, and provide a JSON object for the parameter, comment. See an example.

Parameter Type Description
comment String The comment to be added.


If successful, this method returns a 200 OK response code and an updated list of all alertComment resources of the incident.



The following is an example of a request.

Content-Type: application/json

    "@odata.type": "",
    "comment": "Demo for docs"


The following is an example of the response

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json

    "@odata.context": "$metadata#security/alerts_v2('da637865765418431569_-773071023')/comments",
    "value": [
            "comment": "test",
            "createdByDisplayName": "",
            "createdDateTime": "2022-10-13T07:08:45.4626766Z"
            "comment": "Demo for docs",
            "createdByDisplayName": "",
            "createdDateTime": "2022-10-13T07:08:50.5821324Z"