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>",
"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>",
"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>',
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>',
'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 \"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 \"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 \"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 implement queue’s listing read to decide whether a host may pick the item up. 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.
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>",
"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>",
"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>',
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>',
'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 \"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 \"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 \"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.
Show child attributes
Show child attributes