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",
"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",
"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. Attention-resume first claims validate an unread notification and routing; exact terminal replays remain acknowledgement-only after the notification is read or acknowledged. 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",
"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",
"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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Organization identifier
Body
Response
Runner lease claimed or idempotently replayed. First attention claims require an unread routed notification. Terminal attention replays acknowledge only, including after read or acknowledgement. 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.
Fenced local execution lease. The lease token is never returned in this object.
Show child attributes
Show child attributes
Ephemeral token for a new claim or eligible pre-intent replay; null for other replays.
True when the idempotency key returned an existing lease.
True only when an untouched pre-intent active lease received a newly generated token; the original token is invalidated.
True only for terminal attention replays that acknowledge without starting a turn, including after notification read or acknowledgement.

