Commit a reviewed set of AI-parsed risks: create them all, tag the batch with the engagement/report name, and attach the document they were parsed from, so each risk can be traced back to its source.
const url = 'https://api.adversarial.com/api/v1/risks/import/ai/commit';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"risks":[],"source_file_id":null,"tags":[]}'};
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/commit \ --header 'Content-Type: application/json' \ --data '{ "risks": [], "source_file_id": null, "tags": [] }'Request Bodyrequired
Section titled “Request Bodyrequired”Request body for the AI import commit step: the (possibly edited) set of risks the reviewer accepted, plus any tags to apply to the whole batch.
object
The finalized risks to create.
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.
The source_file_id the parse step returned. The document is attached
to every created risk, recording where the batch came from. Optional.
Tags (by content) to apply to every imported risk — e.g. the engagement or report name — so the whole batch can be traced back to its source. Each is created if it doesn’t already exist. Optional.
Responses
Section titled “Responses”Risks created and tagged
Response from the AI import commit step.
object
The created risks as register rows, in the order they were imported.
Returned so the client can drop them straight into its cached register views — the same thing the single-risk create endpoint enables — and the reviewer sees the batch land immediately, even under a filter the new rows don’t satisfy.
Each carries the source document among its attachments when it was
attached. It is not when no source_file_id was sent, or when that id
no longer names a document you uploaded for import, such as one already
discarded or claimed; the risks are imported either way.
Register row for Organization Risks (RSKs). A Risk plus the relational data
shown on the risk register: threat objectives, incident associations, tags, and
comment count.
object
Files attached to this risk, newest-first.
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.
Count of comments on this risk (not the comments themselves).
Number of risks linked under this risk (i.e. children pointing at it).
A risk is itself a linked child when risk.parent_id is set.
The core view of an Organization Risk (RSK).
Relational data — threat objectives, comments, incident associations, and tags —
is exposed on RiskRegisterEntry, not here.
object
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.
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.
When set, this risk is linked under the named parent risk.
The status of a risk
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.
object
A threat objective paired with how relevant it is to a risk.
Two relations are considered the same when the objective and its relevance
match; created_date records when the relation was last changed and is not
part of its identity.
Number of risks created.
The tags applied to the imported batch.
Example
{ "risks": [ { "attachments": [ { "status": "pending" } ], "incident_associations": "INC-00001", "risk": { "id": "RSK-00001", "impact": "Very Low", "initially_reported_urgency": "Critical", "likelihood": "Remote", "parent_id": "RSK-00001", "status": "New", "type": "Code", "urgency": "Info" }, "threat_objectives": [ { "relevance": "Moderate", "threat_objective": "Sabotage" } ] } ]}No risks to import, too many, or a source that is not one of the organization’s risk sources
Tags were requested without tags:write