curl --request POST \
--url https://api.outerlayer.ai/v1/schedule-runs/claim \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"host": "<string>",
"cliVersion": "<string>",
"runnerProtocol": 123,
"seconds": 1073741823
}
'import requests
url = "https://api.outerlayer.ai/v1/schedule-runs/claim"
payload = {
"host": "<string>",
"cliVersion": "<string>",
"runnerProtocol": 123,
"seconds": 1073741823
}
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({
host: '<string>',
cliVersion: '<string>',
runnerProtocol: 123,
seconds: 1073741823
})
};
fetch('https://api.outerlayer.ai/v1/schedule-runs/claim', 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/schedule-runs/claim",
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([
'host' => '<string>',
'cliVersion' => '<string>',
'runnerProtocol' => 123,
'seconds' => 1073741823
]),
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/schedule-runs/claim"
payload := strings.NewReader("{\n \"host\": \"<string>\",\n \"cliVersion\": \"<string>\",\n \"runnerProtocol\": 123,\n \"seconds\": 1073741823\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/schedule-runs/claim")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"host\": \"<string>\",\n \"cliVersion\": \"<string>\",\n \"runnerProtocol\": 123,\n \"seconds\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/schedule-runs/claim")
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 \"host\": \"<string>\",\n \"cliVersion\": \"<string>\",\n \"runnerProtocol\": 123,\n \"seconds\": 1073741823\n}"
response = http.request(request)
puts response.read_body{
"data": {
"run": {
"automationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instructions": "<string>",
"issuesLeft": 123,
"leaseExpiresAt": "<string>",
"repository": "<string>",
"timeLimitSeconds": 123
},
"runKey": "<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>"
}
}Claim the next run of a schedule automation
Gives the calling runner the oldest pending run of its factory, with a lease, and a run key (olrun_…) for the agent that does the run. The answer is null when no run is pending. The body carries isolation, what the runner’s builds run in: a run goes only to a container or a microVM, so a runner whose builds run with shared-user isolation is refused (run_isolation_not_allowed), and so is a managed runner key (run_managed_runner_not_allowed). runnerProtocol must be 48 or newer, or the claim is refused with 426. A runner may send repos with its include and exclude patterns, and then takes no run that reads another repository. The run key reaches only the run’s issues, nothing and topics routes and the session upload, and it stops working when the run ends.
curl --request POST \
--url https://api.outerlayer.ai/v1/schedule-runs/claim \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"host": "<string>",
"cliVersion": "<string>",
"runnerProtocol": 123,
"seconds": 1073741823
}
'import requests
url = "https://api.outerlayer.ai/v1/schedule-runs/claim"
payload = {
"host": "<string>",
"cliVersion": "<string>",
"runnerProtocol": 123,
"seconds": 1073741823
}
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({
host: '<string>',
cliVersion: '<string>',
runnerProtocol: 123,
seconds: 1073741823
})
};
fetch('https://api.outerlayer.ai/v1/schedule-runs/claim', 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/schedule-runs/claim",
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([
'host' => '<string>',
'cliVersion' => '<string>',
'runnerProtocol' => 123,
'seconds' => 1073741823
]),
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/schedule-runs/claim"
payload := strings.NewReader("{\n \"host\": \"<string>\",\n \"cliVersion\": \"<string>\",\n \"runnerProtocol\": 123,\n \"seconds\": 1073741823\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/schedule-runs/claim")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"host\": \"<string>\",\n \"cliVersion\": \"<string>\",\n \"runnerProtocol\": 123,\n \"seconds\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/schedule-runs/claim")
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 \"host\": \"<string>\",\n \"cliVersion\": \"<string>\",\n \"runnerProtocol\": 123,\n \"seconds\": 1073741823\n}"
response = http.request(request)
puts response.read_body{
"data": {
"run": {
"automationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instructions": "<string>",
"issuesLeft": 123,
"leaseExpiresAt": "<string>",
"repository": "<string>",
"timeLimitSeconds": 123
},
"runKey": "<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>"
}
}