curl --request POST \
--url https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cron": "<string>",
"fencing_token": 1,
"message": "<string>",
"once": true,
"timezone": "<string>"
}
'import requests
url = "https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules"
payload = {
"cron": "<string>",
"fencing_token": 1,
"message": "<string>",
"once": True,
"timezone": "<string>"
}
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({
cron: '<string>',
fencing_token: 1,
message: '<string>',
once: true,
timezone: '<string>'
})
};
fetch('https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules', 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.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules",
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([
'cron' => '<string>',
'fencing_token' => 1,
'message' => '<string>',
'once' => true,
'timezone' => '<string>'
]),
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://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules"
payload := strings.NewReader("{\n \"cron\": \"<string>\",\n \"fencing_token\": 1,\n \"message\": \"<string>\",\n \"once\": true,\n \"timezone\": \"<string>\"\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://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cron\": \"<string>\",\n \"fencing_token\": 1,\n \"message\": \"<string>\",\n \"once\": true,\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules")
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 \"cron\": \"<string>\",\n \"fencing_token\": 1,\n \"message\": \"<string>\",\n \"once\": true,\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": 123,
"cron": "<string>",
"etag": "<string>",
"fleet_id": "<string>",
"message": "<string>",
"once": true,
"schedule_id": "<string>",
"source": "<string>",
"status": "<string>",
"sync": "<string>",
"timezone": "<string>",
"updated_at": 123,
"last_error": "<string>",
"override": {
"cron": null,
"message": null,
"status": "active",
"timezone": null
}
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}Create a schedule for the running fleet
Creates a schedule for the fleet the lease runs, with source fleet, and registers it in QStash as a person’s schedule is. The fleet comes from the lease and never from the body, and the fleet’s declared secrets are masked out of the message. A fleet holds at most 16 schedules it created, refused past that with UZ-SCHED-009. With once set, the schedule retires after its first fire. A schedule that saved and did not register answers 201 with its sync state. Takes no Idempotency-Key: the runner does not retry a call, and a model that repeats one has asked for a second schedule.
curl --request POST \
--url https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cron": "<string>",
"fencing_token": 1,
"message": "<string>",
"once": true,
"timezone": "<string>"
}
'import requests
url = "https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules"
payload = {
"cron": "<string>",
"fencing_token": 1,
"message": "<string>",
"once": True,
"timezone": "<string>"
}
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({
cron: '<string>',
fencing_token: 1,
message: '<string>',
once: true,
timezone: '<string>'
})
};
fetch('https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules', 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.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules",
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([
'cron' => '<string>',
'fencing_token' => 1,
'message' => '<string>',
'once' => true,
'timezone' => '<string>'
]),
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://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules"
payload := strings.NewReader("{\n \"cron\": \"<string>\",\n \"fencing_token\": 1,\n \"message\": \"<string>\",\n \"once\": true,\n \"timezone\": \"<string>\"\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://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cron\": \"<string>\",\n \"fencing_token\": 1,\n \"message\": \"<string>\",\n \"once\": true,\n \"timezone\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsfleet.net/v1/runners/me/leases/{lease_id}/schedules")
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 \"cron\": \"<string>\",\n \"fencing_token\": 1,\n \"message\": \"<string>\",\n \"once\": true,\n \"timezone\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": 123,
"cron": "<string>",
"etag": "<string>",
"fleet_id": "<string>",
"message": "<string>",
"once": true,
"schedule_id": "<string>",
"source": "<string>",
"status": "<string>",
"sync": "<string>",
"timezone": "<string>",
"updated_at": 123,
"last_error": "<string>",
"override": {
"cron": null,
"message": null,
"status": "active",
"timezone": null
}
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": 123,
"resolved_by": "<string>",
"user_message": "<string>"
}Authorizations
The opaque agt_r token minted when the runner enrols (POST /v1/runners)
Path Parameters
UUIDv7 of the lease.
Body
POST /v1/runners/me/leases/{lease_id}/schedules request.
A five-field cron expression.
The lease's fencing token; a holder the fleet has superseded is refused.
x >= 0What the fleet is asked to do when it fires.
Whether it retires after its first fire.
The zone the expression is read in; UTC when absent.
Response
The schedule as reconciled with the scheduler
One schedule, as the tenant surface renders it.
When it was created.
The expression it fires on.
Strong tag binding the pinned recipe, setup and instance override.
The fleet it wakes.
What the fleet is asked to do.
Whether it retires after its first fire. Beta: this field may change shape before it is stable.
Its identity.
Who made it: api for a person, trigger for the fleet's own
document, fleet for the fleet while it ran. Only a fleet schedule
can be changed by the fleet. Beta: this field may change shape before it is stable.
What the operator wants it to be doing.
How far agentsfleet has brought the external scheduler in line.
A schedule can save without registering. This field shows you that state.
The zone that expression is read in.
When it was last changed.
Why the last push failed, when one did.
Explicit instance overlay, omitted when the pinned recipe is inherited.
Show child attributes
Show child attributes