curl --request POST \
--url https://api.outerlayer.ai/v1/work-items/build \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"attestor": "<string>",
"instructions": "<string>",
"note": "<string>",
"sessionId": "<string>",
"subject": {
"key": "<string>",
"number": 1,
"repository": "<string>",
"url": "<string>"
},
"workItemId": "<string>"
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/build"
payload = {
"attestor": "<string>",
"instructions": "<string>",
"note": "<string>",
"sessionId": "<string>",
"subject": {
"key": "<string>",
"number": 1,
"repository": "<string>",
"url": "<string>"
},
"workItemId": "<string>"
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
attestor: '<string>',
instructions: '<string>',
note: '<string>',
sessionId: '<string>',
subject: {key: '<string>', number: 1, repository: '<string>', url: '<string>'},
workItemId: '<string>'
})
};
fetch('https://api.outerlayer.ai/v1/work-items/build', 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/build",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'attestor' => '<string>',
'instructions' => '<string>',
'note' => '<string>',
'sessionId' => '<string>',
'subject' => [
'key' => '<string>',
'number' => 1,
'repository' => '<string>',
'url' => '<string>'
],
'workItemId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.outerlayer.ai/v1/work-items/build"
payload := strings.NewReader("{\n \"attestor\": \"<string>\",\n \"instructions\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"workItemId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.outerlayer.ai/v1/work-items/build")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attestor\": \"<string>\",\n \"instructions\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"workItemId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/build")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attestor\": \"<string>\",\n \"instructions\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"workItemId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attestor": "<string>",
"number": 123,
"requestedAt": "<string>",
"section": "<string>",
"stage": "<string>",
"workItemId": "<string>",
"repositoryTokens": {
"earnable": false,
"message": "<string>",
"reason": "key_has_no_member"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Request a host build an item
Records a build-requested attestation naming who asked and when — the fact claim_work_item and the queue listings read to decide whether a host may pick the item up. With no open pull request it feeds the implement queue; with an open pull request whose general thread waits on an agent it feeds the amend queue as a new trigger. An open pull request with no review waiting on an agent is refused as nothing_to_rerun, and nothing is stored. Adds the item to Work first (admitting it, the same as POST /v1/work-items) when subject names one not already there; workItemId addresses an item that must already exist. Never links the calling session and never takes a lease, even when called from inside one — POST /v1/work-items alone never queues an item for a host, and this route is the only thing that does. A request from a key with no member recorded on it, or from a key that holds work.claim, is accepted, and the response carries repositoryTokens with earnable: false and the reason: a container host takes repository tokens only for a build a member asked for, so it will fail that build, while a host that runs builds with its own hooks can still take it. The optional instructions (at most 2000 characters) are guidance for the agent that runs the build: control characters other than newline and tab are removed, the text is trimmed, and text with nothing left is stored as null. They belong to this request alone and are returned as instructions on its buildRequests entry.
curl --request POST \
--url https://api.outerlayer.ai/v1/work-items/build \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"attestor": "<string>",
"instructions": "<string>",
"note": "<string>",
"sessionId": "<string>",
"subject": {
"key": "<string>",
"number": 1,
"repository": "<string>",
"url": "<string>"
},
"workItemId": "<string>"
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/build"
payload = {
"attestor": "<string>",
"instructions": "<string>",
"note": "<string>",
"sessionId": "<string>",
"subject": {
"key": "<string>",
"number": 1,
"repository": "<string>",
"url": "<string>"
},
"workItemId": "<string>"
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
attestor: '<string>',
instructions: '<string>',
note: '<string>',
sessionId: '<string>',
subject: {key: '<string>', number: 1, repository: '<string>', url: '<string>'},
workItemId: '<string>'
})
};
fetch('https://api.outerlayer.ai/v1/work-items/build', 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/build",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'attestor' => '<string>',
'instructions' => '<string>',
'note' => '<string>',
'sessionId' => '<string>',
'subject' => [
'key' => '<string>',
'number' => 1,
'repository' => '<string>',
'url' => '<string>'
],
'workItemId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.outerlayer.ai/v1/work-items/build"
payload := strings.NewReader("{\n \"attestor\": \"<string>\",\n \"instructions\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"workItemId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.outerlayer.ai/v1/work-items/build")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"attestor\": \"<string>\",\n \"instructions\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"workItemId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/build")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"attestor\": \"<string>\",\n \"instructions\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"workItemId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"attestor": "<string>",
"number": 123,
"requestedAt": "<string>",
"section": "<string>",
"stage": "<string>",
"workItemId": "<string>",
"repositoryTokens": {
"earnable": false,
"message": "<string>",
"reason": "key_has_no_member"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Factory id the request is scoped to.
API key (sk_outerlayer_*)
Body
Response
The build request was recorded. It feeds the implement queue, or the amend queue when the item has an open pull request.
Show child attributes
Show child attributes