curl --request POST \
--url https://atollhq.com/api/orgs/{id}/runner-leases/claim \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"issueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"claimKind": "issue"
}
'import requests
url = "https://atollhq.com/api/orgs/{id}/runner-leases/claim"
payload = {
"issueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"claimKind": "issue"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
issueId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
idempotencyKey: '<string>',
claimKind: 'issue'
})
};
fetch('https://atollhq.com/api/orgs/{id}/runner-leases/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://atollhq.com/api/orgs/{id}/runner-leases/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([
'issueId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'idempotencyKey' => '<string>',
'claimKind' => 'issue'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://atollhq.com/api/orgs/{id}/runner-leases/claim"
payload := strings.NewReader("{\n \"issueId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"idempotencyKey\": \"<string>\",\n \"claimKind\": \"issue\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://atollhq.com/api/orgs/{id}/runner-leases/claim")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"issueId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"idempotencyKey\": \"<string>\",\n \"claimKind\": \"issue\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://atollhq.com/api/orgs/{id}/runner-leases/claim")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"issueId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"idempotencyKey\": \"<string>\",\n \"claimKind\": \"issue\"\n}"
response = http.request(request)
puts response.read_body{
"lease": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issue_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runner_installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"claim_generation": 2,
"claim_kind": "issue",
"attention_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"human_attention_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runner_attention_idempotency_key": "<string>",
"idempotency_key": "<string>",
"state": "active",
"mutation_sequence": 1,
"last_mutation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_transition": "<string>",
"last_progress": "preparing",
"last_error_code": "runner_error",
"expires_at": "2023-11-07T05:31:56Z",
"turn_intent_persisted_at": "2023-11-07T05:31:56Z",
"sdk_accepted_at": "2023-11-07T05:31:56Z",
"model_completed_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"terminal_at": "2023-11-07T05:31:56Z",
"codex_thread_id": "<string>",
"verification_event_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"artifact_binding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"token": "<string>",
"replayed": true,
"token_reissued": true,
"acknowledgement_only": true
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}Atomically claim an issue for the current local runner
Agent-only claim. The authenticated agent’s current runner, assignment, project access, issue state, and dependency satisfaction are validated atomically. Notification attention-resume claims keep their unread-routing and acknowledgement contract. Canonical human-attention claims use a separate closed source with the exact waiting execution, resolved item, expected versions, current host, source lease, and retained thread; they never read or acknowledge notification rows. The local runner associates ordinary claims with one atoll_local_runner execution whose external_run_id is the lease UUID. Non-orphaned attention leases are unique. Untouched pre-intent replays reissue tokens and invalidate the original token; the four newest prior recovery tokens remain valid for one minute or until one is used, which promotes it. Other replays return token null. Only a proven pre-intent orphan can be replaced; uncertain_outcome blocks replacement.
curl --request POST \
--url https://atollhq.com/api/orgs/{id}/runner-leases/claim \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"issueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"claimKind": "issue"
}
'import requests
url = "https://atollhq.com/api/orgs/{id}/runner-leases/claim"
payload = {
"issueId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotencyKey": "<string>",
"claimKind": "issue"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
issueId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
idempotencyKey: '<string>',
claimKind: 'issue'
})
};
fetch('https://atollhq.com/api/orgs/{id}/runner-leases/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://atollhq.com/api/orgs/{id}/runner-leases/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([
'issueId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'idempotencyKey' => '<string>',
'claimKind' => 'issue'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://atollhq.com/api/orgs/{id}/runner-leases/claim"
payload := strings.NewReader("{\n \"issueId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"idempotencyKey\": \"<string>\",\n \"claimKind\": \"issue\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://atollhq.com/api/orgs/{id}/runner-leases/claim")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"issueId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"idempotencyKey\": \"<string>\",\n \"claimKind\": \"issue\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://atollhq.com/api/orgs/{id}/runner-leases/claim")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"issueId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"idempotencyKey\": \"<string>\",\n \"claimKind\": \"issue\"\n}"
response = http.request(request)
puts response.read_body{
"lease": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issue_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runner_installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"claim_generation": 2,
"claim_kind": "issue",
"attention_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"human_attention_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runner_attention_idempotency_key": "<string>",
"idempotency_key": "<string>",
"state": "active",
"mutation_sequence": 1,
"last_mutation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_transition": "<string>",
"last_progress": "preparing",
"last_error_code": "runner_error",
"expires_at": "2023-11-07T05:31:56Z",
"turn_intent_persisted_at": "2023-11-07T05:31:56Z",
"sdk_accepted_at": "2023-11-07T05:31:56Z",
"model_completed_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"terminal_at": "2023-11-07T05:31:56Z",
"codex_thread_id": "<string>",
"verification_event_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"artifact_binding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"token": "<string>",
"replayed": true,
"token_reissued": true,
"acknowledgement_only": true
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}{
"error": "Unauthorized",
"code": "unauthorized"
}Authorizations
Body
Response
Runner lease claimed or idempotently replayed. Notification attention claims require an unread routed notification and preserve acknowledgement-only terminal replay. Canonical human-attention claims require a resolved item and waiting execution with exact identity and versions; they do not acknowledge notifications. Untouched pre-intent replays may reissue a token and invalidate the original token; the four newest prior recovery tokens remain valid for one minute or until one is used, which promotes it. Other replays return token: null. Only proven pre-intent orphans can be replaced; uncertain_outcome blocks replacement.

