Decisions API
Decisions and confirmations
POST /orgs/{org}/confirmations/{token}
Answers a confirmation (the SPA's JSON version of /org/confirm/{token}).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
org required | path | string | The org slug. |
token required | path | string | The confirmation token. |
Request body
application/json, Answer.
| Field | Type | Description |
|---|---|---|
answer required | string | The 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
| Name | In | Type | Description |
|---|---|---|---|
org required | path | string | The 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
| Name | In | Type | Description |
|---|---|---|---|
org required | path | string | The org slug. |
Request body
application/json, CreateRule.
| Field | Type | Description |
|---|---|---|
agent required | string | The agent's handle. |
category required | string | The category, e.g. draft. |
expires_at | string (date-time) | null | Expiry. |
page | string | null | Limit to a page subtree (short ID or UUID). |
space | string | null | Limit 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
| Name | In | Type | Description |
|---|---|---|---|
org required | path | string | The org slug. |
id required | path | string (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
| Name | In | Type | Description |
|---|---|---|---|
org required | path | string | The org slug. |
ref required | path | string | The task's short ID or UUID. |
Request body
application/json, CreateConfirmation.
| Field | Type | Description |
|---|---|---|
category | string | null | The category, matched against standing rules. |
options | string[] | null | Choices; free text when absent. |
question required | string | The question for the human. |
Responses
201- Created. Confirmation
application/json
GET /orgs/{org}/tasks/{ref}/decisions
Decisions recorded on a task.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
org required | path | string | The org slug. |
ref required | path | string | The 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
| Name | In | Type | Description |
|---|---|---|---|
org required | path | string | The org slug. |
ref required | path | string | The task's short ID or UUID. |
Request body
application/json, RecordDecision.
| Field | Type | Description |
|---|---|---|
answer required | string | The answer given. |
category | string | null | The category (e.g. spend). |
conversation_ref | string | null | The conversation reference. |
options | object | null | The options offered. |
question required | string | The question asked. |
Responses
201- Created. Decision
application/json