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>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
before | query | string | no | Cursor: return decisions created before this id. |
includeDeferred | query | boolean | no | Include decisions still inside their deferral window. Default false — that IS the snooze. |
kind | query | DecisionKind | no | |
limit | query | number | no | |
producerRef | query | string | no | Only decisions carrying this producer handle. With producerService, this is the inline-embed lookup: "which decision belongs to this thread". |
producerService | query | string | no | Only decisions opened by this producer service. |
scope | query | DecisionListScope | no | |
status | query | DecisionStatus | no | Filter by derived status. Omitted: every ANSWERABLE status (a decision list is a to-do list), minus deferred ones unless includeDeferred. |
| Status | Description | Body |
|---|---|---|
| 200 | application/json DecisionResponseDtoPaginatedEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/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>)
| Status | Description | Body |
|---|---|---|
| 200 | application/json DecisionBadgeDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/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
| Status | Description | Body |
|---|---|---|
| 200 | application/json BulkDispositionResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/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
| Status | Description | Body |
|---|---|---|
| 200 | application/json PolicySimulationResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/problem+json ProblemDetailsDto |
GET /api/decision-api/decisions/{decisionId}
Read one decision
Authentication: bearer token (Authorization: Bearer <token>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
decisionId | path | string | yes |
| Status | Description | Body |
|---|---|---|
| 200 | application/json DecisionResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/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>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
decisionId | path | string | yes |
Request body: application/json CommitOptionDto
| Status | Description | Body |
|---|---|---|
| 200 | application/json DecisionResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/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>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
commitId | path | string | yes | |
decisionId | path | string | yes |
| Status | Description | Body |
|---|---|---|
| 200 | application/json DecisionResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/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>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
decisionId | path | string | yes |
Request body: application/json DeferDecisionDto
| Status | Description | Body |
|---|---|---|
| 200 | application/json DecisionResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/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>)
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
decisionId | path | string | yes |
| Status | Description | Body |
|---|---|---|
| 200 | application/json DecisionExplanationResponseDtoDataEnvelope | |
| 400 | application/problem+json ProblemDetailsDto | |
| 401 | application/problem+json ProblemDetailsDto | |
| 403 | application/problem+json ProblemDetailsDto | |
| 404 | application/problem+json ProblemDetailsDto | |
| 409 | application/problem+json ProblemDetailsDto | |
| 422 | application/problem+json ProblemDetailsDto | |
| 500 | application/problem+json ProblemDetailsDto |