Parse an uploaded narrative document into proposed risks (preview only).
const url = 'https://api.adversarial.com/api/v1/risks/import/ai/parse';const form = new FormData();form.append('file', 'file');
const options = {method: 'POST'};
options.body = form;
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/risks/import/ai/parse \ --header 'Content-Type: multipart/form-data' \ --form file=@fileThis does NOT persist anything: the reviewer edits the returned proposals
client-side and posts the accepted set to /v1/risks/import/ai/commit.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The narrative document to parse: plain text, Markdown, PDF, or Word (.docx).
Responses
Section titled “Responses”Proposed risks parsed from the document
Response from the AI parse (preview) step. Nothing is persisted yet — the client renders these for review/editing and posts the final set to commit.
object
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.
The proposed risks for the reviewer to accept, edit, or drop.
A single risk 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
Full narrative description of the risk, grounded in the source document.
When the risk was discovered, as a plain YYYY-MM-DD calendar date, taken
from the document — normally its report date, or a date the document ties
specifically to the activity that surfaced this finding.
A bare date string rather than a timestamp on purpose: it is what the
model can reliably lift out of a narrative, and what the CSV import
template already uses.
None (or anything unparseable) means the document carried no usable
date, and the risk falls back to the creation time on import.
Initially reported urgency (IRU) inferred from how the source framed the finding.
One- or two-sentence justification tying the proposal back to the source document.
Suggested intake source (how the risk was identified), chosen from the
organization’s configured risk_source list — usually the same for every
finding 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; it must not be
quietly swapped for a default, because an intake nobody chose is
indistinguishable from one somebody did.
A short span copied verbatim from the source document that this risk
was drawn from. The client substring-matches it against document_text
to scroll to and highlight the originating passage.
Concise risk title.
Best-fit risk category, presented as the risk’s class.
Example
{ "risks": [ { "initially_reported_urgency": "Critical", "type": "Code" } ]}Empty, oversized, or unsupported/unreadable document
AI parsing is unconfigured, timed out, or the provider failed