Create an execution configuration that triggers a Template on a schedule or on demand.
Request headers
|
Header |
Required |
Description |
|
|
Yes |
|
|
|
Yes |
|
|
|
No |
Optional idempotency key for unsafe requests. |
Request body
|
Parameter |
Type |
Required |
Description |
|
|
string |
Yes |
Forward Identity ID that owns the Schedule. |
|
|
string |
Yes |
Forward Template ID to execute. |
|
|
string |
Yes |
Schedule name. |
|
|
string |
No |
Schedule description. |
|
|
array |
Yes |
Events injected at each execution. Currently supports |
|
|
object |
No |
Execution policy. Defaults apply when omitted. |
|
|
object|null |
No |
Trigger policy. Omitted or |
|
|
string |
Yes |
Execution environment. |
|
|
object |
No |
Custom metadata for labels or pass-through data only. |
Trigger policy
|
|
Required input |
Description |
|
|
|
Triggers on a 5-field cron expression in the specified IANA timezone. |
|
|
|
Runs once at an ISO 8601 time. |
|
|
|
Repeats at a fixed ISO 8601 duration interval, such as |
|
|
|
Never runs automatically. Trigger with the Run Schedule endpoint. |
Execution policy
|
Field |
Type |
Default |
Description |
|
|
string |
|
|
|
|
integer |
1 |
Maximum concurrent runs for this Schedule. |
|
|
integer |
1 |
Reserved. The value is recorded and validated, but only one attempt runs. |
|
|
integer |
300000 |
Timeout per attempt. |
Example request
curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/schedules' \
-H "Authorization: Bearer $QODER_PAT" \
-H "Content-Type: application/json" \
-d '{
"identity_id": "idn_019eabc123",
"template_id": "tmpl_support",
"name": "Daily tech brief",
"description": "Generate a daily technology news summary",
"initial_events": [
{
"type": "user.message",
"content": "Summarize current technology news in five bullet points."
}
],
"trigger_policy": {
"type": "cron",
"expression": "0 9 * * *",
"timezone": "Asia/Shanghai"
},
"execution": {
"session_mode": "new_session",
"max_concurrent_runs": 1,
"max_attempts": 1,
"timeout_ms": 300000
},
"environment_id": "env_019e64e01a137caf953ac2ac7b42ec5c"
}'
Example response
HTTP 200 OK
{
"id": "sched_019f00112233445566778899aabbccdd",
"identity_id": "idn_019eabc123",
"template_id": "tmpl_support",
"name": "Daily tech brief",
"description": "Generate a daily technology news summary",
"status": "active",
"paused_reason": null,
"initial_events": [
{
"type": "user.message",
"content": "Summarize current technology news in five bullet points."
}
],
"execution": {
"session_mode": "new_session",
"max_concurrent_runs": 1,
"max_attempts": 1,
"timeout_ms": 300000
},
"trigger_policy": {
"type": "cron",
"expression": "0 9 * * *",
"timezone": "Asia/Shanghai",
"upcoming_runs_at": ["2026-06-23T01:00:00Z"]
},
"environment_id": "env_019e64e01a137caf953ac2ac7b42ec5c",
"sinks": [],
"metadata": {},
"archived_at": null,
"created_at": "2026-06-22T10:00:00Z",
"updated_at": "2026-06-22T10:00:00Z"
}
Errors
|
HTTP |
Type |
Code |
Trigger |
|
400 |
|
|
Trigger policy type or expression is invalid. |
|
400 |
|
|
Trigger interval is less than one minute. |
|
400 |
|
|
|
|
400 |
|
|
Request body contains |
|
404 |
|
|
Identity does not exist. |
|
404 |
|
|
Template does not exist. |
|
401 |
|
|
PAT is invalid or has expired. |
Notes
-
The create endpoint does not accept
sinks. Schedules created through the API returnsinks: []. -
manualschedules can only be triggered withPOST /api/v1/forward/schedules/{schedule_id}/run. -
onceschedules are automatically archived after the first run reaches a terminal state.