curl --request POST \
--url https://api.hq.zone/v1/api/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deliver_to": {},
"name": "<string>",
"prompt": "<string>",
"trigger": {},
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"delivery_locale": "<string>",
"description": "<string>",
"max_duration_secs": 123,
"max_steps": 1,
"reset_each_fire": true
}
'import requests
url = "https://api.hq.zone/v1/api/schedules"
payload = {
"deliver_to": {},
"name": "<string>",
"prompt": "<string>",
"trigger": {},
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"delivery_locale": "<string>",
"description": "<string>",
"max_duration_secs": 123,
"max_steps": 1,
"reset_each_fire": True
}
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({
deliver_to: {},
name: '<string>',
prompt: '<string>',
trigger: {},
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
delivery_locale: '<string>',
description: '<string>',
max_duration_secs: 123,
max_steps: 1,
reset_each_fire: true
})
};
fetch('https://api.hq.zone/v1/api/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.hq.zone/v1/api/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([
'deliver_to' => [
],
'name' => '<string>',
'prompt' => '<string>',
'trigger' => [
],
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'delivery_locale' => '<string>',
'description' => '<string>',
'max_duration_secs' => 123,
'max_steps' => 1,
'reset_each_fire' => true
]),
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.hq.zone/v1/api/schedules"
payload := strings.NewReader("{\n \"deliver_to\": {},\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"trigger\": {},\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"delivery_locale\": \"<string>\",\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"max_steps\": 1,\n \"reset_each_fire\": true\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.hq.zone/v1/api/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deliver_to\": {},\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"trigger\": {},\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"delivery_locale\": \"<string>\",\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"max_steps\": 1,\n \"reset_each_fire\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hq.zone/v1/api/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 \"deliver_to\": {},\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"trigger\": {},\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"delivery_locale\": \"<string>\",\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"max_steps\": 1,\n \"reset_each_fire\": true\n}"
response = http.request(request)
puts response.read_body{
"schedule": {
"args": "<unknown>",
"consecutive_failure_count": 123,
"failure_count": 123,
"fire_count": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_duration_secs": 123,
"name": "<string>",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "<string>",
"trigger": "<unknown>",
"description": "<string>",
"last_fire_at": "2023-11-07T05:31:56Z",
"last_fire_lag_ms": 123,
"last_fire_status": "<string>",
"last_run_conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"next_fire_at": "2023-11-07T05:31:56Z",
"owner_display_name": "<string>",
"owner_external_id": "<string>"
}
}Create a schedule
Creates a new schedule that periodically runs an agent with a given prompt and delivery target, according to the supplied trigger. If agent_id is omitted the workspace’s default enabled agent is used, and a non-existent agent_id returns 404. The new schedule is owned by the caller. Returns 201 with the created schedule; if the workspace plan’s schedule limit has been reached the request fails with 402. Requires the schedules:write scope.
curl --request POST \
--url https://api.hq.zone/v1/api/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deliver_to": {},
"name": "<string>",
"prompt": "<string>",
"trigger": {},
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"delivery_locale": "<string>",
"description": "<string>",
"max_duration_secs": 123,
"max_steps": 1,
"reset_each_fire": true
}
'import requests
url = "https://api.hq.zone/v1/api/schedules"
payload = {
"deliver_to": {},
"name": "<string>",
"prompt": "<string>",
"trigger": {},
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"delivery_locale": "<string>",
"description": "<string>",
"max_duration_secs": 123,
"max_steps": 1,
"reset_each_fire": True
}
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({
deliver_to: {},
name: '<string>',
prompt: '<string>',
trigger: {},
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
delivery_locale: '<string>',
description: '<string>',
max_duration_secs: 123,
max_steps: 1,
reset_each_fire: true
})
};
fetch('https://api.hq.zone/v1/api/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.hq.zone/v1/api/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([
'deliver_to' => [
],
'name' => '<string>',
'prompt' => '<string>',
'trigger' => [
],
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'delivery_locale' => '<string>',
'description' => '<string>',
'max_duration_secs' => 123,
'max_steps' => 1,
'reset_each_fire' => true
]),
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.hq.zone/v1/api/schedules"
payload := strings.NewReader("{\n \"deliver_to\": {},\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"trigger\": {},\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"delivery_locale\": \"<string>\",\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"max_steps\": 1,\n \"reset_each_fire\": true\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.hq.zone/v1/api/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deliver_to\": {},\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"trigger\": {},\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"delivery_locale\": \"<string>\",\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"max_steps\": 1,\n \"reset_each_fire\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hq.zone/v1/api/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 \"deliver_to\": {},\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"trigger\": {},\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"delivery_locale\": \"<string>\",\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"max_steps\": 1,\n \"reset_each_fire\": true\n}"
response = http.request(request)
puts response.read_body{
"schedule": {
"args": "<unknown>",
"consecutive_failure_count": 123,
"failure_count": 123,
"fire_count": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_duration_secs": 123,
"name": "<string>",
"owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"state": "<string>",
"trigger": "<unknown>",
"description": "<string>",
"last_fire_at": "2023-11-07T05:31:56Z",
"last_fire_lag_ms": 123,
"last_fire_status": "<string>",
"last_run_conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"next_fire_at": "2023-11-07T05:31:56Z",
"owner_display_name": "<string>",
"owner_external_id": "<string>"
}
}Authorizations
Personal Access Token. Send as Authorization: Bearer hq_pat_....
Body
Optional BCP-47 locale override for this schedule's deliveries.
Falls back to the owner's workspace_users.locale when absent.
Wall-clock cap per fire, in seconds (default 1800, clamped 60..=3600). A fire that runs past it is killed and marked failed; size it for the schedule's step budget.
Per-turn step budget (max tool-call rounds) for each fire. Omit for the default of 200 - the same ceiling an interactive turn gets. Raise for heavy multi-step schedules; clamped 1..=1000 at fire time.
x >= 0Response
Created
Show child attributes
Show child attributes