List runs
curl --request GET \
--url https://api.example.com/sop/runs \
--header 'x-user-id: <x-user-id>'import requests
url = "https://api.example.com/sop/runs"
headers = {"x-user-id": "<x-user-id>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-user-id': '<x-user-id>'}};
fetch('https://api.example.com/sop/runs', 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://api.example.com/sop/runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-user-id: <x-user-id>"
],
]);
$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://api.example.com/sop/runs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-user-id", "<x-user-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/sop/runs")
.header("x-user-id", "<x-user-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/sop/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-user-id"] = '<x-user-id>'
response = http.request(request)
puts response.read_body{
"runs": [
{
"user_id": "<string>",
"sop_id": "<string>",
"definition": {
"name": "<string>",
"steps": [
{
"subject": "<string>",
"description": "<string>",
"executor": {
"agent_id": "<string>",
"session_key": "<string>"
},
"version": "v1",
"verifier": {
"agent": {
"agent_id": "<string>",
"session_key": "<string>"
},
"type": "agent",
"criteria": ""
},
"max_attempts": 3
}
],
"description": "",
"workspace_grain": "run",
"session_settings": {}
},
"id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"sessions": {},
"state": {
"phase": "pending",
"id": "<string>",
"inputs": [
{
"name": "<string>",
"content": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"role": "user",
"id": "<string>",
"metadata": {},
"created_at": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_input_tokens": 0,
"cache_creation_input_tokens": 0
},
"finished_at": "<string>",
"finished_reason": "completed",
"structured_output": {},
"error": {
"message": "<string>",
"type": "unknown"
}
}
],
"steps": [
{
"phase": "pending",
"given": [
{
"name": "<string>",
"content": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"role": "user",
"id": "<string>",
"metadata": {},
"created_at": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_input_tokens": 0,
"cache_creation_input_tokens": 0
},
"finished_at": "<string>",
"finished_reason": "completed",
"structured_output": {},
"error": {
"message": "<string>",
"type": "unknown"
}
}
],
"submission": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"verifications": [
{
"passed": true,
"message": "",
"verifier": "",
"created_at": "<string>"
}
]
}
],
"created_at": "<string>"
}
}
],
"total": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}sop
List runs
Return the caller’s runs, newest first.
Args:
sop_id (str | None):
Narrow to one procedure.
phase (SOPPhase | None):
Narrow to one phase.
user_id (str):
Injected authenticated user id.
storage (StorageBase):
Injected storage backend.
Returns:
ListSOPRunsResponse:
The matching runs.
GET
/
sop
/
runs
List runs
curl --request GET \
--url https://api.example.com/sop/runs \
--header 'x-user-id: <x-user-id>'import requests
url = "https://api.example.com/sop/runs"
headers = {"x-user-id": "<x-user-id>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-user-id': '<x-user-id>'}};
fetch('https://api.example.com/sop/runs', 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://api.example.com/sop/runs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-user-id: <x-user-id>"
],
]);
$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://api.example.com/sop/runs"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-user-id", "<x-user-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/sop/runs")
.header("x-user-id", "<x-user-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/sop/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-user-id"] = '<x-user-id>'
response = http.request(request)
puts response.read_body{
"runs": [
{
"user_id": "<string>",
"sop_id": "<string>",
"definition": {
"name": "<string>",
"steps": [
{
"subject": "<string>",
"description": "<string>",
"executor": {
"agent_id": "<string>",
"session_key": "<string>"
},
"version": "v1",
"verifier": {
"agent": {
"agent_id": "<string>",
"session_key": "<string>"
},
"type": "agent",
"criteria": ""
},
"max_attempts": 3
}
],
"description": "",
"workspace_grain": "run",
"session_settings": {}
},
"id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"sessions": {},
"state": {
"phase": "pending",
"id": "<string>",
"inputs": [
{
"name": "<string>",
"content": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"role": "user",
"id": "<string>",
"metadata": {},
"created_at": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_input_tokens": 0,
"cache_creation_input_tokens": 0
},
"finished_at": "<string>",
"finished_reason": "completed",
"structured_output": {},
"error": {
"message": "<string>",
"type": "unknown"
}
}
],
"steps": [
{
"phase": "pending",
"given": [
{
"name": "<string>",
"content": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"role": "user",
"id": "<string>",
"metadata": {},
"created_at": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_input_tokens": 0,
"cache_creation_input_tokens": 0
},
"finished_at": "<string>",
"finished_reason": "completed",
"structured_output": {},
"error": {
"message": "<string>",
"type": "unknown"
}
}
],
"submission": [
{
"text": "<string>",
"type": "text",
"id": "<string>",
"created_at": "<string>",
"finished_at": "<string>"
}
],
"verifications": [
{
"passed": true,
"message": "",
"verifier": "",
"created_at": "<string>"
}
]
}
],
"created_at": "<string>"
}
}
],
"total": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.
Query Parameters
Only runs of this procedure.
Only runs standing here — awaiting is the one worth asking for.
Where a step, or a whole run, stands.
One enum for both: a run is only ever as far along as its steps let it be.
Available options:
pending, running, awaiting, completed, failed