Commit a reviewed set of AI-parsed risks: create them all and tag the batch with the engagement/report name so it 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":[],"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": [], "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.
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.
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
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.
object
The time that this relation was mutated
The threat objective type
Number of risks created.
The tags applied to the imported batch.
Example
{ "risks": [ { "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
Tags were requested without tags:write