Trigger a schedule
curl --request POST \
--url https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}/trigger \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}/trigger"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}/trigger', 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}/trigger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/trigger"
req, _ := http.NewRequest("POST", 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.post("https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}/trigger")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}/trigger")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodySchedules
Trigger a schedule
Fire a schedule once, immediately.
POST
/
api
/
v2
/
schedules
/
{schedule_id}
/
trigger
Trigger a schedule
curl --request POST \
--url https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}/trigger \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}/trigger"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}/trigger', 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}/trigger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/trigger"
req, _ := http.NewRequest("POST", 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.post("https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}/trigger")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id}/trigger")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyFires the schedule once now and returns the outcome synchronously. Works while paused, and the regular cadence is unaffected:
next_run_times and last_run_at do not change. The fire goes through the same checks as an automatic one, so it can come back skipped_overlap or skipped_quota rather than created.
Returns the run record for this fire, with triggered_manually: true.
Path parameters
The schedule’s id (UUID).
Examples
curl -X POST "https://agp.eu.hcompany.ai/api/v2/schedules/9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f/trigger" \
-H "Authorization: Bearer $HAI_API_KEY"
from hai_agents import Client
client = Client()
run = client.schedules.trigger_schedule("9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f")
print(run.status, run.session_id)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const run = await client.schedules.triggerSchedule({ scheduleId: "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f" });
console.log(run.status, run.sessionId);
Response
{
"id": "3c2b1a09-8d7e-4f6a-b5c4-d3e2f1a0b9c8",
"schedule_id": "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
"status": "created",
"scheduled_for": "2026-07-04T11:26:03Z",
"session_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"error": null,
"triggered_manually": true,
"created_at": "2026-07-04T11:26:05Z"
}
Errors
| Status | Cause |
|---|---|
404 | No schedule with this id in your organization. |
409 | A fire for this schedule is already in progress; retry shortly (a Retry-After header is included). |
Was this page helpful?
⌘I