curl --request GET \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/threads \
--header 'Authorization: Bearer <token>' \
--header 'X-Outerlayer-App-Id: <api-key>'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/threads"
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Outerlayer-App-Id': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/threads', 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.outerlayer.ai/v1/work-items/{workItemId}/threads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/work-items/{workItemId}/threads"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.outerlayer.ai/v1/work-items/{workItemId}/threads")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/threads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"criteria": [
{
"checkItems": [
{
"check": "<string>",
"id": "<string>",
"result": "pass",
"criterion": "<string>",
"reason": "<string>",
"refs": [
{
"path": "<string>",
"changed": true,
"href": "<string>",
"inDiff": true,
"line": 1
}
]
}
],
"comments": [
{
"action": "pass",
"author": {
"kind": "person",
"name": "<string>",
"apiKeyId": "<string>",
"membershipId": "<string>",
"sessionTraceId": "<string>"
},
"body": "<string>",
"createdAt": "<string>",
"id": "<string>",
"unchanged": true,
"artifact": "<string>",
"attachments": [
{
"filename": "<string>",
"id": "<string>",
"kind": "image",
"mediaType": "<string>",
"sizeBytes": 123,
"url": "<string>",
"urlExpiresAt": "<string>"
}
],
"reviewSendId": "<string>"
}
],
"criterion": "<string>",
"proof": {
"artifact": "<string>",
"current": true
},
"verdict": "pass",
"waitingOn": "person"
}
],
"general": {
"checkItems": [
{
"check": "<string>",
"id": "<string>",
"result": "pass",
"criterion": "<string>",
"reason": "<string>",
"refs": [
{
"path": "<string>",
"changed": true,
"href": "<string>",
"inDiff": true,
"line": 1
}
]
}
],
"comments": [
{
"action": "pass",
"author": {
"kind": "person",
"name": "<string>",
"apiKeyId": "<string>",
"membershipId": "<string>",
"sessionTraceId": "<string>"
},
"body": "<string>",
"createdAt": "<string>",
"id": "<string>",
"unchanged": true,
"artifact": "<string>",
"attachments": [
{
"filename": "<string>",
"id": "<string>",
"kind": "image",
"mediaType": "<string>",
"sizeBytes": 123,
"url": "<string>",
"urlExpiresAt": "<string>"
}
],
"reviewSendId": "<string>"
}
],
"criterion": "<string>",
"proof": {
"artifact": "<string>",
"current": true
},
"verdict": "pass",
"waitingOn": "person"
},
"threads": [
{
"comments": [
{
"authorKind": "person",
"authorName": "<string>",
"body": "<string>",
"createdAt": "<string>",
"id": "<string>",
"attachments": [
{
"filename": "<string>",
"id": "<string>",
"kind": "image",
"mediaType": "<string>",
"sizeBytes": 123,
"url": "<string>",
"urlExpiresAt": "<string>"
}
]
}
],
"externalRef": "<string>",
"externalUrl": "<string>",
"id": "<string>",
"source": "<string>",
"waitingOn": "person",
"anchor": {
"excerpt": "<string>",
"line": 123,
"path": "<string>",
"prNumber": 123,
"repository": "<string>"
},
"quote": {
"state": "quoted",
"url": "<string>",
"author": "<string>",
"authorKind": "bot",
"body": "<string>",
"createdAt": "<string>",
"truncated": true
},
"ruleGapCheck": true
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}A work item's general thread and its criterion threads
The item’s general thread plus one thread per acceptance criterion that carries proof or a comment — each with its derived waitingOn, its latest verdict, its proof (if any) and every comment, oldest first. Each thread also holds checkItems: what the item’s judges said that the thread answers, with each result and reason. A criterion thread holds the judge items that name its criterion. The general thread holds the failing judge items that no criterion thread carries. threads holds the conversations that started at a source outside OuterLayer, such as the line comments of a GitHub review. Each names its source, the source’s id and link, and holds its comments. A thread on a pull request line also has an anchor with the repository, pull request, file, line and code excerpt. A caller with an item key reads the threads as its running agent may know them. A hand-off that arrived after the lease started, such as a member’s fail or a comment sent to the agent, shows only once the build’s hook handed it to the agent and the gateway recorded the read; until then it waits, and a hand-off the agent never reads starts the next agent job. Every other comment from a source that arrived after the lease started is left out. A member’s comment written in OuterLayer that is not a hand-off always shows. Judge items are the judges’ latest, whatever the lease.
curl --request GET \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/threads \
--header 'Authorization: Bearer <token>' \
--header 'X-Outerlayer-App-Id: <api-key>'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/threads"
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Outerlayer-App-Id': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/threads', 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.outerlayer.ai/v1/work-items/{workItemId}/threads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/work-items/{workItemId}/threads"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.outerlayer.ai/v1/work-items/{workItemId}/threads")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/threads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"criteria": [
{
"checkItems": [
{
"check": "<string>",
"id": "<string>",
"result": "pass",
"criterion": "<string>",
"reason": "<string>",
"refs": [
{
"path": "<string>",
"changed": true,
"href": "<string>",
"inDiff": true,
"line": 1
}
]
}
],
"comments": [
{
"action": "pass",
"author": {
"kind": "person",
"name": "<string>",
"apiKeyId": "<string>",
"membershipId": "<string>",
"sessionTraceId": "<string>"
},
"body": "<string>",
"createdAt": "<string>",
"id": "<string>",
"unchanged": true,
"artifact": "<string>",
"attachments": [
{
"filename": "<string>",
"id": "<string>",
"kind": "image",
"mediaType": "<string>",
"sizeBytes": 123,
"url": "<string>",
"urlExpiresAt": "<string>"
}
],
"reviewSendId": "<string>"
}
],
"criterion": "<string>",
"proof": {
"artifact": "<string>",
"current": true
},
"verdict": "pass",
"waitingOn": "person"
}
],
"general": {
"checkItems": [
{
"check": "<string>",
"id": "<string>",
"result": "pass",
"criterion": "<string>",
"reason": "<string>",
"refs": [
{
"path": "<string>",
"changed": true,
"href": "<string>",
"inDiff": true,
"line": 1
}
]
}
],
"comments": [
{
"action": "pass",
"author": {
"kind": "person",
"name": "<string>",
"apiKeyId": "<string>",
"membershipId": "<string>",
"sessionTraceId": "<string>"
},
"body": "<string>",
"createdAt": "<string>",
"id": "<string>",
"unchanged": true,
"artifact": "<string>",
"attachments": [
{
"filename": "<string>",
"id": "<string>",
"kind": "image",
"mediaType": "<string>",
"sizeBytes": 123,
"url": "<string>",
"urlExpiresAt": "<string>"
}
],
"reviewSendId": "<string>"
}
],
"criterion": "<string>",
"proof": {
"artifact": "<string>",
"current": true
},
"verdict": "pass",
"waitingOn": "person"
},
"threads": [
{
"comments": [
{
"authorKind": "person",
"authorName": "<string>",
"body": "<string>",
"createdAt": "<string>",
"id": "<string>",
"attachments": [
{
"filename": "<string>",
"id": "<string>",
"kind": "image",
"mediaType": "<string>",
"sizeBytes": 123,
"url": "<string>",
"urlExpiresAt": "<string>"
}
]
}
],
"externalRef": "<string>",
"externalUrl": "<string>",
"id": "<string>",
"source": "<string>",
"waitingOn": "person",
"anchor": {
"excerpt": "<string>",
"line": 123,
"path": "<string>",
"prNumber": 123,
"repository": "<string>"
},
"quote": {
"state": "quoted",
"url": "<string>",
"author": "<string>",
"authorKind": "bot",
"body": "<string>",
"createdAt": "<string>",
"truncated": true
},
"ruleGapCheck": true
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}