decisions

Operations of the Decision API. Paths are relative to your deployment's API host.

GET /api/decision-api/decisions

List decisions this caller may answer

Every row is filtered through authorization-api against the decision subject's resource. hasMore reports the underlying SCAN, not the filtered page — those differ whenever the filter removed rows, and a client that stopped paginating on a short page would hide answerable work.

Authentication: bearer token (Authorization: Bearer <token>)

ParameterInTypeRequiredDescription
beforequerystringnoCursor: return decisions created before this id.
includeDeferredquerybooleannoInclude decisions still inside their deferral window. Default false — that IS the snooze.
kindqueryDecisionKindno
limitquerynumberno
producerRefquerystringnoOnly decisions carrying this producer handle. With producerService, this is the inline-embed lookup: "which decision belongs to this thread".
producerServicequerystringnoOnly decisions opened by this producer service.
scopequeryDecisionListScopeno
statusqueryDecisionStatusnoFilter by derived status. Omitted: every ANSWERABLE status (a decision list is a to-do list), minus deferred ones unless includeDeferred.
StatusDescriptionBody
200application/json DecisionResponseDtoPaginatedEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/problem+json ProblemDetailsDto

GET /api/decision-api/decisions/badge

How many decisions are waiting for this caller

Counts only what the caller can actually act on. capped is true when the real number exceeded the counting ceiling — a badge says "lots", never a wrong number.

Authentication: bearer token (Authorization: Bearer <token>)

StatusDescriptionBody
200application/json DecisionBadgeDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/problem+json ProblemDetailsDto

POST /api/decision-api/decisions/bulk-defer

Snooze several decisions

Reports the count the SERVER changed and names the ids it did not. The requested and changed counts differ exactly when something went wrong.

Authentication: bearer token (Authorization: Bearer <token>)

Request body: application/json BulkDeferDecisionsDto

StatusDescriptionBody
200application/json BulkDispositionResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/problem+json ProblemDetailsDto

POST /api/decision-api/decisions/simulate

Compile a policy and evaluate it under hypothetical commits

Pure: persists nothing and reads no decision. Needs a user token (TokenClassGuard). A policy that does not compile is a 422 naming every violation.

Authentication: bearer token (Authorization: Bearer <token>)

Request body: application/json SimulatePolicyDto

StatusDescriptionBody
200application/json PolicySimulationResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/problem+json ProblemDetailsDto

GET /api/decision-api/decisions/{decisionId}

Read one decision

Authentication: bearer token (Authorization: Bearer <token>)

ParameterInTypeRequiredDescription
decisionIdpathstringyes
StatusDescriptionBody
200application/json DecisionResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/problem+json ProblemDetailsDto

POST /api/decision-api/decisions/{decisionId}/commit

Answer — commit one of the decision’s options

The option must be one the record already carries; a key it does not carry is a 422, never coerced to the nearest option. A second commit on the same option by the same answerer is a 409, not a second vote.

Authentication: bearer token (Authorization: Bearer <token>)

ParameterInTypeRequiredDescription
decisionIdpathstringyes

Request body: application/json CommitOptionDto

StatusDescriptionBody
200application/json DecisionResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/problem+json ProblemDetailsDto

POST /api/decision-api/decisions/{decisionId}/commits/{commitId}/retract

Take back your own answer, while the record is still open

Refused once the record has settled — the producer may already have acted on it.

Authentication: bearer token (Authorization: Bearer <token>)

ParameterInTypeRequiredDescription
commitIdpathstringyes
decisionIdpathstringyes
StatusDescriptionBody
200application/json DecisionResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/problem+json ProblemDetailsDto

POST /api/decision-api/decisions/{decisionId}/defer

Snooze one decision

A read-model predicate: the list condition flips on its own when the clock passes it. Nothing is scheduled and there is no restore job to fail.

Authentication: bearer token (Authorization: Bearer <token>)

ParameterInTypeRequiredDescription
decisionIdpathstringyes

Request body: application/json DeferDecisionDto

StatusDescriptionBody
200application/json DecisionResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/problem+json ProblemDetailsDto

GET /api/decision-api/decisions/{decisionId}/explanation

Why a decision is in its current state

The policy verdict over the stored compiled policy and the stored counters (the contract’s explain function). It reports the policy verdict only, not the lifecycle state: whether the decision is expired, closed or settled by its producer is read from the decision itself. Readable by whoever may read the decision.

Authentication: bearer token (Authorization: Bearer <token>)

ParameterInTypeRequiredDescription
decisionIdpathstringyes
StatusDescriptionBody
200application/json DecisionExplanationResponseDtoDataEnvelope
400application/problem+json ProblemDetailsDto
401application/problem+json ProblemDetailsDto
403application/problem+json ProblemDetailsDto
404application/problem+json ProblemDetailsDto
409application/problem+json ProblemDetailsDto
422application/problem+json ProblemDetailsDto
500application/problem+json ProblemDetailsDto