curl --request GET \
--url https://api.usepatchwork.co/v1/loom/threads/{thread_id}/messages \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usepatchwork.co/v1/loom/threads/{thread_id}/messages', 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/{thread_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"status": "success",
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "user",
"content": "<string>",
"parts": [
{
"type": "text",
"text": "<string>",
"kind": "<string>",
"payload": {},
"ref": "<string>"
}
],
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seq": 123,
"created_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"has_more": true,
"limit": 123,
"next_cursor": "<string>"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}List messages
Messages on a thread, in sequence. Direct tokens can only read their own threads.
curl --request GET \
--url https://api.usepatchwork.co/v1/loom/threads/{thread_id}/messages \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usepatchwork.co/v1/loom/threads/{thread_id}/messages', 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/{thread_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"status": "success",
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "user",
"content": "<string>",
"parts": [
{
"type": "text",
"text": "<string>",
"kind": "<string>",
"payload": {},
"ref": "<string>"
}
],
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seq": 123,
"created_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"has_more": true,
"limit": 123,
"next_cursor": "<string>"
}
}{
"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.
Path Parameters
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