curl --request PUT \
--url https://api.outerlayer.ai/v1/apps/{appId}/build-variables/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"service": {
"header": {
"name": "<string>",
"value": "<string>"
},
"upstream": "<string>"
},
"value": "<string>"
}
'import requests
url = "https://api.outerlayer.ai/v1/apps/{appId}/build-variables/{name}"
payload = {
"service": {
"header": {
"name": "<string>",
"value": "<string>"
},
"upstream": "<string>"
},
"value": "<string>"
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
service: {header: {name: '<string>', value: '<string>'}, upstream: '<string>'},
value: '<string>'
})
};
fetch('https://api.outerlayer.ai/v1/apps/{appId}/build-variables/{name}', 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/apps/{appId}/build-variables/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'service' => [
'header' => [
'name' => '<string>',
'value' => '<string>'
],
'upstream' => '<string>'
],
'value' => '<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/apps/{appId}/build-variables/{name}"
payload := strings.NewReader("{\n \"service\": {\n \"header\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"upstream\": \"<string>\"\n },\n \"value\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.outerlayer.ai/v1/apps/{appId}/build-variables/{name}")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"service\": {\n \"header\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"upstream\": \"<string>\"\n },\n \"value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/apps/{appId}/build-variables/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"service\": {\n \"header\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"upstream\": \"<string>\"\n },\n \"value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"name": "<string>",
"setAt": "<string>",
"setBy": "<string>",
"service": {
"header": {
"name": "<string>",
"value": "<string>"
},
"host": "<string>",
"upstream": "<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>"
}
}Save or replace a build variable of the factory
Stores the value in Supabase Vault under the name, in place of any value the factory saved under it, and deletes the old secret. A name that is not a variable name, or that the runner sets itself (OUTERLAYER_API_KEY, the model credential and the commit identity, for some), is refused with invalid_managed_build_setting (422) and nothing is saved. So is a value with fewer than 3 characters other than spaces at either end, which the runner could not remove from logs and transcripts. A factory holds at most 100 variables. Answers the name, who saved it and when, never the value. The body can also name a service. A managed build then holds a stand-in for the variable, and the runner sets the value in the service’s header on each request the build sends to the service’s own host. The runner matches on the host and the start of the path of the address, so the build needs no tool variables and no change to a repository’s registry settings. A service that breaks a rule (an address that is not HTTPS, holds a login or names a private host, a header with no ${VALUE}, or the same host and path as another variable) is refused with invalid_managed_build_setting (422) and nothing is saved. A factory sends at most 16 variables to a service. A save with a service and no value changes only the service of a variable that exists, and only while the service keeps its host. A save that sends the stored value to another host, or removes the service, needs the value in the body, so a caller who cannot read the value cannot redirect it. Answers 404 unless the managed_runners flag is on for the organization.
curl --request PUT \
--url https://api.outerlayer.ai/v1/apps/{appId}/build-variables/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"service": {
"header": {
"name": "<string>",
"value": "<string>"
},
"upstream": "<string>"
},
"value": "<string>"
}
'import requests
url = "https://api.outerlayer.ai/v1/apps/{appId}/build-variables/{name}"
payload = {
"service": {
"header": {
"name": "<string>",
"value": "<string>"
},
"upstream": "<string>"
},
"value": "<string>"
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
service: {header: {name: '<string>', value: '<string>'}, upstream: '<string>'},
value: '<string>'
})
};
fetch('https://api.outerlayer.ai/v1/apps/{appId}/build-variables/{name}', 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/apps/{appId}/build-variables/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'service' => [
'header' => [
'name' => '<string>',
'value' => '<string>'
],
'upstream' => '<string>'
],
'value' => '<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/apps/{appId}/build-variables/{name}"
payload := strings.NewReader("{\n \"service\": {\n \"header\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"upstream\": \"<string>\"\n },\n \"value\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.outerlayer.ai/v1/apps/{appId}/build-variables/{name}")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"service\": {\n \"header\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"upstream\": \"<string>\"\n },\n \"value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/apps/{appId}/build-variables/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"service\": {\n \"header\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n },\n \"upstream\": \"<string>\"\n },\n \"value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"name": "<string>",
"setAt": "<string>",
"setBy": "<string>",
"service": {
"header": {
"name": "<string>",
"value": "<string>"
},
"host": "<string>",
"upstream": "<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>"
}
}