Skip to content

Upload an attachment to an incident

POST
/v1/incidents/{id}/attachments
curl --request POST \
--url https://api.adversarial.com/api/v1/incidents/INC-00001/attachments \
--header 'Content-Type: multipart/form-data' \
--form file=@file

Send the file as multipart form data in a single part named file.

id
required
string

The ID of the incident — INC-00001 (case-insensitive) or a bare number

Example
INC-00001
Media typemultipart/form-data

The multipart body of an attachment upload.

Exactly one part, named file, carrying the raw bytes and a filename; a missing filename is refused with 400. The part’s declared content type must be one of the types in allowed_content_types (PDF, DOCX, XLSX, PPTX, PNG, JPEG, CSV, plain text, Markdown, JSON), and the filename’s extension must match that type (.pdf, .docx, .xlsx, .pptx, .png, .jpg, .jpeg, .csv, .txt, .text, .md, .markdown or .json). PDF, image, and Office files must carry the expected leading signature. CSV, plain-text, Markdown, and JSON files must contain no NUL byte; this is a coarse binary-file guard and does not validate encoding, CSV structure, or JSON syntax. A failed content check is refused with 415. A CSV declared as application/vnd.ms-excel is stored as text/csv. The file’s own bytes must be at most 25 MiB, or the request is refused with 413.

object
file
required

The file to attach.

string format: binary

Attachment stored

Media typeapplication/json

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
byte_size

File size in bytes.

integer | null format: int64
content_type
required

MIME content type.

string
created_by

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.

string | null format: uuid
created_date
required

When the file was uploaded.

string format: date-time
id
required

The attachment’s id; download it with GET /v1/files/{id}.

string format: uuid
name
required

Original file name as uploaded.

string
status
required

The file’s upload status. Attachments are only listed once their upload has finished, so this is always ready.

string
Allowed values: pending ready failed
Example
{
"status": "pending"
}

Missing or malformed multipart upload

Missing incidents:write permission

Incident not found

Upload exceeds the maximum allowed size

Content type not permitted, or the file name’s extension or the file’s contents do not match it