curl --request POST \
--url https://api.example.com/agents/{agent_id}/schedules \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"initial_input": {
"content": "<string>",
"type": "text",
"author": "user"
},
"description": "<string>",
"cron_expression": "<string>",
"interval_seconds": 2,
"timezone": "UTC",
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"paused": false,
"task_params": {},
"task_metadata": {}
}
'import requests
url = "https://api.example.com/agents/{agent_id}/schedules"
payload = {
"name": "<string>",
"initial_input": {
"content": "<string>",
"type": "text",
"author": "user"
},
"description": "<string>",
"cron_expression": "<string>",
"interval_seconds": 2,
"timezone": "UTC",
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"paused": False,
"task_params": {},
"task_metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
initial_input: {content: '<string>', type: 'text', author: 'user'},
description: '<string>',
cron_expression: '<string>',
interval_seconds: 2,
timezone: 'UTC',
start_at: '2023-11-07T05:31:56Z',
end_at: '2023-11-07T05:31:56Z',
paused: false,
task_params: {},
task_metadata: {}
})
};
fetch('https://api.example.com/agents/{agent_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.example.com/agents/{agent_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([
'name' => '<string>',
'initial_input' => [
'content' => '<string>',
'type' => 'text',
'author' => 'user'
],
'description' => '<string>',
'cron_expression' => '<string>',
'interval_seconds' => 2,
'timezone' => 'UTC',
'start_at' => '2023-11-07T05:31:56Z',
'end_at' => '2023-11-07T05:31:56Z',
'paused' => false,
'task_params' => [
],
'task_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/agents/{agent_id}/schedules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"initial_input\": {\n \"content\": \"<string>\",\n \"type\": \"text\",\n \"author\": \"user\"\n },\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"timezone\": \"UTC\",\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false,\n \"task_params\": {},\n \"task_metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/agents/{agent_id}/schedules")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"initial_input\": {\n \"content\": \"<string>\",\n \"type\": \"text\",\n \"author\": \"user\"\n },\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"timezone\": \"UTC\",\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false,\n \"task_params\": {},\n \"task_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agents/{agent_id}/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"initial_input\": {\n \"content\": \"<string>\",\n \"type\": \"text\",\n \"author\": \"user\"\n },\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"timezone\": \"UTC\",\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false,\n \"task_params\": {},\n \"task_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agent_id": "<string>",
"name": "<string>",
"initial_input": {
"content": "<string>",
"type": "text",
"author": "user"
},
"initial_input_method": "<string>",
"description": "<string>",
"cron_expression": "<string>",
"interval_seconds": 123,
"timezone": "UTC",
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"paused": false,
"task_params": {},
"task_metadata": {},
"creator_principal": {
"principal_type": "<string>",
"user_id": "<string>",
"service_account_id": "<string>",
"account_id": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"state": "ACTIVE",
"next_action_times": [
"2023-11-07T05:31:56Z"
],
"live_data_available": true,
"skipped_action_times": [
"2023-11-07T05:31:56Z"
],
"last_action_time": "2023-11-07T05:31:56Z",
"num_actions_taken": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create Run Schedule
Create a recurring schedule that starts a fresh agent run on each fire.
curl --request POST \
--url https://api.example.com/agents/{agent_id}/schedules \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"initial_input": {
"content": "<string>",
"type": "text",
"author": "user"
},
"description": "<string>",
"cron_expression": "<string>",
"interval_seconds": 2,
"timezone": "UTC",
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"paused": false,
"task_params": {},
"task_metadata": {}
}
'import requests
url = "https://api.example.com/agents/{agent_id}/schedules"
payload = {
"name": "<string>",
"initial_input": {
"content": "<string>",
"type": "text",
"author": "user"
},
"description": "<string>",
"cron_expression": "<string>",
"interval_seconds": 2,
"timezone": "UTC",
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"paused": False,
"task_params": {},
"task_metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
initial_input: {content: '<string>', type: 'text', author: 'user'},
description: '<string>',
cron_expression: '<string>',
interval_seconds: 2,
timezone: 'UTC',
start_at: '2023-11-07T05:31:56Z',
end_at: '2023-11-07T05:31:56Z',
paused: false,
task_params: {},
task_metadata: {}
})
};
fetch('https://api.example.com/agents/{agent_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.example.com/agents/{agent_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([
'name' => '<string>',
'initial_input' => [
'content' => '<string>',
'type' => 'text',
'author' => 'user'
],
'description' => '<string>',
'cron_expression' => '<string>',
'interval_seconds' => 2,
'timezone' => 'UTC',
'start_at' => '2023-11-07T05:31:56Z',
'end_at' => '2023-11-07T05:31:56Z',
'paused' => false,
'task_params' => [
],
'task_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/agents/{agent_id}/schedules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"initial_input\": {\n \"content\": \"<string>\",\n \"type\": \"text\",\n \"author\": \"user\"\n },\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"timezone\": \"UTC\",\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false,\n \"task_params\": {},\n \"task_metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/agents/{agent_id}/schedules")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"initial_input\": {\n \"content\": \"<string>\",\n \"type\": \"text\",\n \"author\": \"user\"\n },\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"timezone\": \"UTC\",\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false,\n \"task_params\": {},\n \"task_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agents/{agent_id}/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"initial_input\": {\n \"content\": \"<string>\",\n \"type\": \"text\",\n \"author\": \"user\"\n },\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"interval_seconds\": 2,\n \"timezone\": \"UTC\",\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"paused\": false,\n \"task_params\": {},\n \"task_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agent_id": "<string>",
"name": "<string>",
"initial_input": {
"content": "<string>",
"type": "text",
"author": "user"
},
"initial_input_method": "<string>",
"description": "<string>",
"cron_expression": "<string>",
"interval_seconds": 123,
"timezone": "UTC",
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"paused": false,
"task_params": {},
"task_metadata": {},
"creator_principal": {
"principal_type": "<string>",
"user_id": "<string>",
"service_account_id": "<string>",
"account_id": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"state": "ACTIVE",
"next_action_times": [
"2023-11-07T05:31:56Z"
],
"live_data_available": true,
"skipped_action_times": [
"2023-11-07T05:31:56Z"
],
"last_action_time": "2023-11-07T05:31:56Z",
"num_actions_taken": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Body
Request body for creating a scheduled agent run.
Human-readable name, unique among active schedules for the agent.
1 - 64^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$The first input delivered to each created task.
Show child attributes
Show child attributes
Optional description of what this schedule does.
Cron expression for the cadence (e.g. '0 17 * * MON-FRI'). Mutually exclusive with interval_seconds.
Interval cadence in seconds. Mutually exclusive with cron_expression.
x >= 1IANA timezone the cron expression is evaluated in (e.g. 'America/New_York').
When the schedule should start being active.
When the schedule should stop being active.
Whether to create the schedule in a paused state.
Resolved config forwarded as task params at fire time.
Metadata copied onto each created task at fire time.
Response
Successful Response
Response model describing a scheduled agent run.
The unique identifier of the run schedule.
The agent this schedule belongs to.
Human-readable schedule name.
The initial input.
Show child attributes
Show child attributes
Delivery method, inferred from the agent's ACP type.
Optional description.
Cron cadence, if cron-based.
Interval cadence in seconds, if interval-based.
Timezone the cron expression is evaluated in.
Schedule activation time.
Schedule deactivation time.
Whether the schedule is paused.
Task params at fire time.
Task metadata at fire time.
Credential-free creator identity.
Show child attributes
Show child attributes
When the schedule was created.
When the schedule was updated.
Live schedule state from Temporal.
ACTIVE, PAUSED Upcoming scheduled fire times.
Whether requested live Temporal fields were retrieved successfully. Null when live enrichment was not requested.
Skipped one-off scheduled fire times.
When the schedule last fired.
Number of times the schedule has fired.

