Skip to main content
GET
Goal Outcomes
GET /v1/compute/{goalId}/outcomes requires the owner’s read proof or access token. Organization members can read GET /v1/org/goals/{goalId}/outcomes for their organization’s goals. Both return { success: true, data: ... } with:
  • by_state: counts of each current state, without an assumed order.
  • finished: cases whose state is in the cases done check’s finished_states or is unreached. Omitted without that check. This count uses state alone; the done check’s owner requirement is evaluated separately.
  • open: total cases minus finished cases, or all cases without a cases done check.
  • value: total and per_case keyed by case key, only when a value field is declared. Each case uses its latest successful delivery by delivery time. Missing values are null and add nothing to the total; pending, withheld and failed deliveries add nothing. known counts the cases with a value.
  • at_stake: total and per_case, from the numeric fact the case view’s input for the value field defaults from (default_fact). total counts cases that are neither finished nor cancelled. Omitted without that input or such a fact.
  • cost.per_case: keyed by case key, each with spent_usdc from the spend ledger, actual_usdc and quoted_per_unit from the record. Recorded costs can be null before settlement.
  • cost.per_finished_case: finished cases’ spend divided by their count, null for no finished cases, omitted without a cases done check.
  • by_owner: only named owners, with count, spent_usdc, and, when declared, finished and value (known values only, omitted when none is known). Omitted when no case has an owner.
  • finished_by_day: counts by UTC day of each case’s first finished time. Reopening never changes that time. Historical transitions before recording began are unavailable and are not assigned an invented date.