Add an issue to Work
curl --request POST \
--url https://api.outerlayer.ai/v1/work-items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"subject": {
"key": "<string>",
"number": 1,
"repository": "<string>",
"url": "<string>"
},
"attestor": "<string>",
"note": "<string>",
"sessionId": "<string>"
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items"
payload = {
"subject": {
"key": "<string>",
"number": 1,
"repository": "<string>",
"url": "<string>"
},
"attestor": "<string>",
"note": "<string>",
"sessionId": "<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({
subject: {key: '<string>', number: 1, repository: '<string>', url: '<string>'},
attestor: '<string>',
note: '<string>',
sessionId: '<string>'
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => [
'key' => '<string>',
'number' => 1,
'repository' => '<string>',
'url' => '<string>'
],
'attestor' => '<string>',
'note' => '<string>',
'sessionId' => '<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"
payload := strings.NewReader("{\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"attestor\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<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")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"attestor\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<string>\"\n}")
.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::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"attestor\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"additionId": "<string>",
"attestor": "<string>",
"branch": "<string>",
"created": true,
"number": 123,
"recomputed": true,
"section": "<string>",
"stage": "<string>",
"workItemId": "<string>"
}
}{
"data": {
"additionId": "<string>",
"attestor": "<string>",
"branch": "<string>",
"created": true,
"number": 123,
"recomputed": true,
"section": "<string>",
"stage": "<string>",
"workItemId": "<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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Work Items
Add an issue to Work
Records that a named source is working on an issue and puts it on Work, with no build request, so no host takes it (outerlayer work build --local). The attestor is resolved by the server (a recorded session, then a CI run, then the caller’s own membership, then the API key itself) and never accepted from the caller. A second addition of the same subject by the same resolved attestor is a no-op that returns the existing addition.
POST
/
v1
/
work-items
Add an issue to Work
curl --request POST \
--url https://api.outerlayer.ai/v1/work-items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"subject": {
"key": "<string>",
"number": 1,
"repository": "<string>",
"url": "<string>"
},
"attestor": "<string>",
"note": "<string>",
"sessionId": "<string>"
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items"
payload = {
"subject": {
"key": "<string>",
"number": 1,
"repository": "<string>",
"url": "<string>"
},
"attestor": "<string>",
"note": "<string>",
"sessionId": "<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({
subject: {key: '<string>', number: 1, repository: '<string>', url: '<string>'},
attestor: '<string>',
note: '<string>',
sessionId: '<string>'
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => [
'key' => '<string>',
'number' => 1,
'repository' => '<string>',
'url' => '<string>'
],
'attestor' => '<string>',
'note' => '<string>',
'sessionId' => '<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"
payload := strings.NewReader("{\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"attestor\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<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")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"attestor\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<string>\"\n}")
.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::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": {\n \"key\": \"<string>\",\n \"number\": 1,\n \"repository\": \"<string>\",\n \"url\": \"<string>\"\n },\n \"attestor\": \"<string>\",\n \"note\": \"<string>\",\n \"sessionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"additionId": "<string>",
"attestor": "<string>",
"branch": "<string>",
"created": true,
"number": 123,
"recomputed": true,
"section": "<string>",
"stage": "<string>",
"workItemId": "<string>"
}
}{
"data": {
"additionId": "<string>",
"attestor": "<string>",
"branch": "<string>",
"created": true,
"number": 123,
"recomputed": true,
"section": "<string>",
"stage": "<string>",
"workItemId": "<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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Factory id the request is scoped to.
API key (sk_outerlayer_*)
Body
application/json
Response
The addition already existed (same subject, same resolved attestor).
Show child attributes
Show child attributes