Create a new comment for an incident
const url = 'https://api.adversarial.com/api/v1/incidents/INC-00001/comments';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"attachment_file_ids":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"value":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.adversarial.com/api/v1/incidents/INC-00001/comments \ --header 'Content-Type: application/json' \ --data '{ "attachment_file_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "value": "example" }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The ID of the incident to create a comment for — INC-00001 (case-insensitive) or a bare number
Example
INC-00001Request Bodyrequired
Section titled “Request Bodyrequired”object
Ids of files to attach to the comment. Each must already be attached to the risk or incident the comment is posted on; if any is not, the request is refused with 400 and no comment is created. Repeated ids are attached once. At most 20.
Examplegenerated
{ "attachment_file_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "value": "example"}Responses
Section titled “Responses”Comment created
object
Files attached to this comment. A file is uploaded to the parent risk or incident first and referenced here when the comment is created; the set is fixed at creation and is not changed by editing the comment.
A file attached to a risk, an incident, or a comment on either.
Embedded in the attachments list of the record it is attached to, and
returned when a file is uploaded to a risk or incident.
object
File size in bytes.
MIME content type.
The user who uploaded the file, if known. On a comment’s attachments this can differ from the comment’s author: a comment may reference a file someone else uploaded to the same record.
When the file was uploaded.
The attachment’s id; download it with GET /v1/files/{id}.
Original file name as uploaded.
The file’s upload status. Attachments are only listed once their upload
has finished, so this is always ready.
A User as returned by the API.
Profile images are not embedded — clients fetch them from
GET /api/v1/{icon} when icon is Some.
object
Relative path to the user’s avatar endpoint, e.g.
"users/{id}/avatar?v={hash}". None when the user has no avatar.
Example
{ "attachments": [ { "status": "pending" } ]}Incident not found