Goal Outcomes
curl --request GET \
--url https://win.oneshotagent.com/v1/compute/{goalId}/outcomesimport requests
url = "https://win.oneshotagent.com/v1/compute/{goalId}/outcomes"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://win.oneshotagent.com/v1/compute/{goalId}/outcomes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://win.oneshotagent.com/v1/compute/{goalId}/outcomes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://win.oneshotagent.com/v1/compute/{goalId}/outcomes"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://win.oneshotagent.com/v1/compute/{goalId}/outcomes")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/compute/{goalId}/outcomes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyGoals
Goal Outcomes
Case counts, declared value, costs and first finished dates
GET
/
v1
/
compute
/
{goalId}
/
outcomes
Goal Outcomes
curl --request GET \
--url https://win.oneshotagent.com/v1/compute/{goalId}/outcomesimport requests
url = "https://win.oneshotagent.com/v1/compute/{goalId}/outcomes"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://win.oneshotagent.com/v1/compute/{goalId}/outcomes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://win.oneshotagent.com/v1/compute/{goalId}/outcomes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://win.oneshotagent.com/v1/compute/{goalId}/outcomes"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://win.oneshotagent.com/v1/compute/{goalId}/outcomes")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/compute/{goalId}/outcomes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyGET /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 thecasesdone check’sfinished_statesor isunreached. 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:totalandper_casekeyed 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.knowncounts the cases with a value.at_stake:totalandper_case, from the numeric fact the case view’s input for the value field defaults from (default_fact).totalcounts cases that are neither finished nor cancelled. Omitted without that input or such a fact.cost.per_case: keyed by case key, each withspent_usdcfrom the spend ledger,actual_usdcandquoted_per_unitfrom 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, withcount,spent_usdc, and, when declared,finishedandvalue(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.