curl --request GET \
--url https://api.usepatchwork.co/v1/loom/threads \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usepatchwork.co/v1/loom/threads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.usepatchwork.co/v1/loom/threads"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"status": "success",
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"subject_ref": "<string>",
"agent": {
"name": "<string>"
},
"message_count": 123,
"last_message": {
"role": "<string>",
"content": "<string>",
"created_at": "2023-11-07T05:31:56Z"
},
"pending_elicitation": {
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "<string>",
"prompt": {}
},
"pending_confirmation": {
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"patch_ref": "<string>",
"summary": {},
"risk": "<string>"
},
"pending_action": {
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"patch_ref": "<string>",
"args": {}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"has_more": true,
"limit": 123,
"next_cursor": "<string>"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}List threads
Recent active threads for the subject this call names. Newest first, cursor-paginated. A call that names no subject is refused with subject_required — there is no way to list across subjects.
curl --request GET \
--url https://api.usepatchwork.co/v1/loom/threads \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usepatchwork.co/v1/loom/threads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.usepatchwork.co/v1/loom/threads"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"status": "success",
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"subject_ref": "<string>",
"agent": {
"name": "<string>"
},
"message_count": 123,
"last_message": {
"role": "<string>",
"content": "<string>",
"created_at": "2023-11-07T05:31:56Z"
},
"pending_elicitation": {
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "<string>",
"prompt": {}
},
"pending_confirmation": {
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"patch_ref": "<string>",
"summary": {},
"risk": "<string>"
},
"pending_action": {
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"patch_ref": "<string>",
"args": {}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"has_more": true,
"limit": 123,
"next_cursor": "<string>"
}
}{
"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.
Query Parameters
Opaque pagination cursor. Pass back the next_cursor from the previous page verbatim; do not construct one.
Page size. Clamped to 100.
1 <= x <= 100