Skip to content

Add Comment to Existing Incident#

The incident comment endpoint provides a method to add comments to an incident by referencing its id and passing the comment as a JSON object.

Endpoint#

POST /v1/incident/{id}/comment

Parameters#

Parameter Type Required Description
comment string Yes The comment text to add to the incident. Must be a valid non-null string.
author string No Email address to attribute the comment to. When omitted, the returned history entry has no author field.

Warning

The comment field cannot be null. The comment must be a valid non-null string value. When supplied, author must be a valid email address; invalid values return 400.

Comment attribution

To attribute a comment to a specific individual, provide the author field. When author is omitted, the comment is treated as a general client comment rather than attributed to an individual user.

Request Example#

curl -X POST 'https://capi.phishfort.com/v1/incident/{id}/comment' \
  -H 'accept: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"comment": "This incident requires immediate attention", "author": "analyst@example.com"}'
import requests

incident_id = "abc123efd"
response = requests.post(
    f"https://capi.phishfort.com/v1/incident/{incident_id}/comment",
    headers={
        "accept": "application/json",
        "x-api-key": "YOUR_API_KEY",
    },
    json={
        "comment": "This incident requires immediate attention",
        "author": "analyst@example.com",
    },
)
print(response.json())
const incidentId = "abc123efd";
const response = await fetch(
  `https://capi.phishfort.com/v1/incident/${incidentId}/comment`,
  {
    method: "POST",
    headers: {
      accept: "application/json",
      "x-api-key": "YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      comment: "This incident requires immediate attention",
      author: "analyst@example.com",
    }),
  }
);
const data = await response.json();
console.log(data);

Where {id} is the ID of the incident you wish to add a comment to.

Response Example#

{
    "message": "You added a new comment on incidentId: abc123efd",
    "id": "abc123efd"
}