Retrieve a schedule
curl --request GET \
--url https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}', 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://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": {},
"timing": {},
"session_request": {},
"paused": true,
"pause_note": {},
"repeats": {},
"sessions_created": 123,
"next_run_times": [
"<string>"
],
"last_run_at": {},
"created_at": "<string>",
"updated_at": "<string>"
}Schedules
Retrieve a schedule
Fetch a schedule by id, with its cron expression, status, and session template.
GET
/
api
/
v2
/
schedules
/
{schedule_id}
Retrieve a schedule
curl --request GET \
--url https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}', 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://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": {},
"timing": {},
"session_request": {},
"paused": true,
"pause_note": {},
"repeats": {},
"sessions_created": 123,
"next_run_times": [
"<string>"
],
"last_run_at": {},
"created_at": "<string>",
"updated_at": "<string>"
}Retrieves one schedule.
Returns the schedule object.
Path parameters
string
required
The schedule’s id (UUID).
Response
The schedule object, also returned by create, list, update, pause, and resume.string
Unique id (UUID).
string
Display name.
string | null
Optional description.
object
When the schedule fires:
type ("cron"), expression (five-field cron), and timezone (IANA name the expression is evaluated in).object
Template used to create each scheduled session, in the Create session body shape. Re-resolved on every fire.
boolean
Whether the schedule is paused. Paused schedules do not fire automatically but can still be triggered.
string | null
Why the schedule is paused: the note passed to Pause, an explanatory note when it was paused automatically after repeated failures, or a note that it became inactive after creating its
repeats sessions.integer | null
How many sessions to create before the schedule becomes inactive.
null means it runs until paused or deleted.integer
Automatic fires that created a session. Skipped fires, errors, and manual triggers are not counted. When this reaches
repeats, the schedule is paused.string[]
The next 5 fire times (UTC, RFC 3339). Empty while paused.
string | null
When the schedule last fired automatically. Manual triggers do not update it.
string
When the schedule was created.
string
When the schedule was last modified.
Examples
curl "https://agp.eu.hcompany.ai/api/v2/schedules/9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f" \
-H "Authorization: Bearer $HAI_API_KEY"
from hai_agents import Client
client = Client()
schedule = client.schedules.get_schedule("9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f")
print(schedule.name, schedule.next_run_times)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const schedule = await client.schedules.getSchedule({ scheduleId: "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f" });
console.log(schedule.name, schedule.nextRunTimes);
Response
{
"id": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
"name": "morning-market-scan",
"description": "Weekday scan of new Paris listings",
"timing": {"type": "cron", "expression": "0 9 * * 1-5", "timezone": "Europe/Paris"},
"session_request": {
"agent": "h/web-surfer-flash",
"messages": [
{"type": "user_message", "message": "Scan new apartment listings in Paris 11e and summarize the top five"}
],
"max_time_s": 3600
},
"paused": false,
"pause_note": null,
"repeats": null,
"sessions_created": 10,
"next_run_times": [
"2026-07-06T07:00:00Z",
"2026-07-07T07:00:00Z",
"2026-07-08T07:00:00Z",
"2026-07-09T07:00:00Z",
"2026-07-10T07:00:00Z"
],
"last_run_at": "2026-07-03T07:00:00Z",
"created_at": "2026-06-20T12:00:00Z",
"updated_at": "2026-07-03T07:00:00Z"
}
Errors
| Status | Cause |
|---|---|
404 | No schedule with this id in your organization. |
Was this page helpful?