Docs Open org

API reference

Decisions API

Decisions and confirmations

POST /orgs/{org}/confirmations/{token}

Answers a confirmation (the SPA's JSON version of /org/confirm/{token}).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
token requiredpathstringThe confirmation token.

Request body

application/json, Answer.

FieldTypeDescription
answer requiredstringThe answer (one of the options, or free text); decline refuses.

Responses

200
OK. Decision application/json

GET /orgs/{org}/decision-rules

Live standing rules.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.

Responses

200
OK. Paged_DecisionRule application/json

POST /orgs/{org}/decision-rules

Creates a standing decision ("Always OK for @planner to draft in Car"). Humans only, for agents they manage, in scopes they can edit.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.

Request body

application/json, CreateRule.

FieldTypeDescription
agent requiredstringThe agent's handle.
category requiredstringThe category, e.g. draft.
expires_atstring (date-time) | nullExpiry.
pagestring | nullLimit to a page subtree (short ID or UUID).
spacestring | nullLimit to a space (slug or id).

Responses

201
Created. DecisionRule application/json

DELETE /orgs/{org}/decision-rules/{id}

Revokes a standing rule (its creator, the agent's managers, admins).

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
id requiredpathstring (uuid)The rule.

Responses

204
No content

POST /orgs/{org}/tasks/{ref}/confirmations

Asks the agent's human to confirm, returning an /org/confirm/{token} URL, or a decision at once when a standing rule covers the category.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe task's short ID or UUID.

Request body

application/json, CreateConfirmation.

FieldTypeDescription
categorystring | nullThe category, matched against standing rules.
optionsstring[] | nullChoices; free text when absent.
question requiredstringThe question for the human.

Responses

201
Created. Confirmation application/json

GET /orgs/{org}/tasks/{ref}/decisions

Decisions recorded on a task.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe task's short ID or UUID.

Responses

200
OK. Paged_Decision application/json

POST /orgs/{org}/tasks/{ref}/decisions

Records a decision: agent_reported from agents, verified from humans.

Parameters

NameInTypeDescription
org requiredpathstringThe org slug.
ref requiredpathstringThe task's short ID or UUID.

Request body

application/json, RecordDecision.

FieldTypeDescription
answer requiredstringThe answer given.
categorystring | nullThe category (e.g. spend).
conversation_refstring | nullThe conversation reference.
optionsobject | nullThe options offered.
question requiredstringThe question asked.

Responses

201
Created. Decision application/json