Skip to content

Parse an uploaded narrative document into proposed incidents (preview only).

POST
/v1/incidents/import/ai/parse
curl --request POST \
--url https://api.adversarial.com/api/v1/incidents/import/ai/parse \
--header 'Content-Type: multipart/form-data' \
--form file=@file

No incident is created yet: the reviewer edits the returned proposals and posts the accepted set to /v1/incidents/import/ai/commit. The document itself is kept, unattached, so the commit can attach it to the incidents it creates.

Media typemultipart/form-data
object
file
required

The narrative document to parse: plain text, Markdown, PDF, or Word (.docx).

string format: binary

Proposed incidents parsed from the document

Media typeapplication/json

Response from the incident AI parse (preview) step. No incident is created yet: the client renders these for review/editing and posts the final set to commit.

object
document_text
required

The document text extracted server-side (from PDF/DOCX/plain text). The client renders this in the review pane and locates each proposal’s source_excerpt within it. May be truncated for very large documents.

string
incidents
required

The proposed incidents for the reviewer to accept, edit, or drop.

Array<object>

A single incident the AI extracted from an uploaded narrative document.

The same shape is returned by the preview call and accepted back on commit, so it carries every field a reviewer may edit before import.

object
description
required

Full narrative description of the incident, grounded in the source document.

string
detected_date

When the incident was detected, as a plain YYYY-MM-DD calendar date taken from the document. null (or anything unparseable) means the document carried no usable date, and the incident falls back to the import time.

string | null
occurred_date

When the incident began, as a plain YYYY-MM-DD calendar date, when the document says. null when it does not.

string | null
rationale
required

One- or two-sentence justification tying the proposal back to the source document.

string
severity
One of:

The severity the source document assigned, mapped onto the SEV scale. null when the document states none; score the incident after import instead.

string
Allowed values: SEV-5 SEV-4 SEV-3 SEV-2 SEV-1
source
required

Suggested intake source (how the incident was reported), chosen from the organization’s configured incident sources — usually the same for every incident in a document.

Reduced server-side to a configured name, or to "" when the model returned something that is not one. Empty means “the AI did not pick a source”, which the reviewer resolves in the preview; on import an empty source takes the organization’s default.

string
source_excerpt
required

A short span copied verbatim from the source document that this incident was drawn from. The client substring-matches it against document_text to scroll to and highlight the originating passage.

string
title
required

Concise incident title.

string
source_file_id

The uploaded document, kept so it can be attached to every incident the batch creates. Send it back as source_file_id on commit.

Not attached to anything until then. Kept for at least 24 hours and discarded once no commit has claimed it by then; a later commit still imports, without it. One commit can claim it. null when the document could not be kept, including when it is not a type the attachment upload accepts (such as HTML).

string | null format: uuid
Example
{
"incidents": [
{
"severity": "SEV-5"
}
]
}

Empty, oversized, or unsupported/unreadable document

AI parsing is unconfigured, timed out, or the provider failed