Retrieve a run trace
curl --request GET \
--url https://api.usepatchwork.co/v1/loom/runs/{id}/trace \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usepatchwork.co/v1/loom/runs/{id}/trace', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.usepatchwork.co/v1/loom/runs/{id}/trace"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"status": "success",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "running",
"cost_credits": 123,
"opened_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z",
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"turns": [
{
"seq": 123,
"model_class": "<string>",
"input_tokens": 123,
"output_tokens": 123,
"cost_credits": 123,
"request": {},
"response": {},
"tool_calls": [
{
"patch_ref": "<string>",
"interaction": "<string>",
"status": "<string>",
"args": {},
"result": {},
"risk": "<string>",
"reliability": "<string>",
"cost_credits": 123,
"outcome": {
"state": "occurred",
"detail": {},
"created_at": "2023-11-07T05:31:56Z"
}
}
]
}
]
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}Runs
Retrieve a run trace
Full trace — turns, tool calls, tokens, and outcomes. This is what “every run on a trace” means.
GET
/
v1
/
loom
/
runs
/
{id}
/
trace
Retrieve a run trace
curl --request GET \
--url https://api.usepatchwork.co/v1/loom/runs/{id}/trace \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usepatchwork.co/v1/loom/runs/{id}/trace', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.usepatchwork.co/v1/loom/runs/{id}/trace"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"status": "success",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "running",
"cost_credits": 123,
"opened_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z",
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"turns": [
{
"seq": 123,
"model_class": "<string>",
"input_tokens": 123,
"output_tokens": 123,
"cost_credits": 123,
"request": {},
"response": {},
"tool_calls": [
{
"patch_ref": "<string>",
"interaction": "<string>",
"status": "<string>",
"args": {},
"result": {},
"risk": "<string>",
"reliability": "<string>",
"cost_credits": 123,
"outcome": {
"state": "occurred",
"detail": {},
"created_at": "2023-11-07T05:31:56Z"
}
}
]
}
]
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}Authorizations
Identify accepts a workspace API key (sk_…). Loom accepts either a short-lived session token (direct) or a workspace API key (relay).
Headers
Relay only. Opaque subject id, chosen by you and never resolved by Patchwork. Partitions threads and memory within your workspace. Direct tokens carry sub instead — do not send this header on a session token.
Required on every subject-scoped resource: threads, messages, runs, outcomes, confirmations and realtime. Omitting it is subject_required, never a wider result. The value is used exactly as given — never trimmed or normalised — so a stray space creates a second partition and is refused as invalid_subject.