curl --request GET \
--url https://api.outerlayer.ai/v1/work-items \
--header 'Authorization: Bearer <token>' \
--header 'X-Outerlayer-App-Id: <api-key>'import requests
url = "https://api.outerlayer.ai/v1/work-items"
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', 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",
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"
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")
.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")
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": [
{}
],
"pagination": {
"cursor": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}List live work items
Every live (not withdrawn) work item for this factory, filterable by repository, stage, and section. Page size 100; follow pagination.cursor for the rest. issue, with repository, narrows the page to the single item that subject answers to — a pull request whose closing issue is known resolves to the issue-keyed item, which no client can work out from a number alone. key narrows the page to the items whose own tracker key it is, such as a Linear or Jira ENG-142, and tracker to one tracker’s items. repository matches a GitHub item by its key and any other item by the repository it was added with. unclaimed=true narrows to rows with no live lease. startable=true narrows to rows a host can pick up, which is asked per queue: on the ordinary list, an unused build request (outerlayer work build, never work build --local), no open pull request and no live lease of any holder — a host or a session; under needs=amend, an unused amend trigger (a person’s fail on the general thread that nothing has answered, or a later build request on the item) and no live lease. A request or trigger is used up by any lease that started after it — a host lease released ok, failed, timed_out or idle, a host lease that lapsed without ever being released, and a session lease however it ended. The one exception is a host lease released interrupted, stopped or lease_lost, or with no outcome: the attempt was declined or cut short, so the request or trigger stays unused. Two host leases released lease_lost after one request or trigger use it up together. A linked session is a record, never a blocker; an open pull request moves a build request to the amend queue. startable=true lists the oldest request first: by the time of the oldest unused build request, or under needs=amend by the amend trigger, with id as the tie-break, so recomputing an item never moves its place. Any other list stays ordered by when each item was last computed. claimed=true narrows to rows WITH a live lease — the same claimed column unclaimed=true reads, in the opposite direction; asking for both together is refused with a 400 before any store read. needs=revise narrows to drafts whose general thread waits on an agent, with no live claim, in the same row shape as needs=amend and with an empty automationTriggers. It lists nothing while draft specs are off for the organization, the factory has no connected repository, or the asking runner sends isolation=shared-user: a revise job goes only to a container or a microVM. Under startable=true it lists the drafts whose waiting follow-up no lease has used, oldest follow-up first. needs=criteria narrows to items with an unused request to record their acceptance criteria, and no live claim, in the same row shape with empty threads and automationTriggers. A request is made when a member approves a spec and when an item that wraps a tracker issue is added. It lists nothing unless the asking runner sends isolation=container or isolation=vm and a runnerProtocol of 62 or more, or while the factory has no reachable connected repository. Under startable=true it lists the items oldest request first. needs=verify narrows to parents with a verification of their criteria that no runner has taken, in the same row shape with empty threads and automationTriggers. A verification is queued when the last child of a milestone that a criterion names ships, and when every child of the plan has shipped. It lists nothing unless the asking runner sends isolation=container or isolation=vm and a runnerProtocol of 86 or more, or while the factory has no reachable connected repository. Under startable=true it lists the parents oldest request first. needs=amend narrows to items whose general thread waits on an agent after a person’s fail (or a later build request), or that a factory automation triggers, and no live claim — each such row carries a threads array (the waiting threads only, in the same shape GET /v1/work-items/{id}/threads returns) and an automationTriggers array (the kind of each automation trigger that counts for the item now, each once and sorted: failed-check, judge-fix, merge-conflict or proofs-out-of-date) beside the ordinary fields. judge-fix means a required judge fails an item at the head of the pull request, and the factory sends failed judges to the agent. It counts while the fix rounds are not used up, and for a head with a failed GitHub check that has attempts left only failed-check counts. With startable=true and a runnerProtocol below 80, or none, the list leaves out judge-fix, because such a runner starts an agent that cannot fix a failed judge item. proofs-out-of-date means the item’s newest evaluation of the pull request’s head found a declared proof that is missing or from an earlier commit. For each head and each set of such proofs it counts at most twice: once when the evaluation first finds them, and once more when that run ends and a later evaluation finds the same proofs at the same head. When no test records any of those proofs, it counts once, with recordProofsOnly false. It counts no more at a head where an agent handed the item to a person, if each of those proofs was captured by hand. recordProofsOnly is true when proofs-out-of-date is the only trigger and counts for the first time, no thread waits on an agent and no member’s build request is unanswered. A runner that reads it true records the item’s proofs again and runs no agent. The second time it counts, recordProofsOnly is false, so an agent fixes why the recording failed.
curl --request GET \
--url https://api.outerlayer.ai/v1/work-items \
--header 'Authorization: Bearer <token>' \
--header 'X-Outerlayer-App-Id: <api-key>'import requests
url = "https://api.outerlayer.ai/v1/work-items"
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', 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",
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"
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")
.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")
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": [
{}
],
"pagination": {
"cursor": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Query Parameters
The ids of the agents the asking runner builds with, comma separated. A runner key that asks for startable work, with or without needs, lists only items whose agent is one of them, and items that name no agent. An id the gateway does not know is left out, and the others still apply. An id that is not a lowercase agent id is refused with invalid_query. Leave it out for claude-code alone.
1000