Create daemon job cron trigger
/daemon-job-cron-trigger
Creates a daemon job run on a schedule and sends a daemon_job_run:created webhook event for each one. An API token creates the trigger in its own environment; a dashboard session can pass environment_id.
Request Body
The args for each run, as an object or a JSON string of one. Checked against the daemon job's args_schema and args_validation.
A cron expression in UTC. Runs must be at least 5 minutes apart.
0 0 * * *Ignored for API tokens.
Response Body
The args each run is created with.
When to create a run, as a cron expression in UTC.
0 0 * * *The daemon each run is created for.
The daemon job each run is created for.
The ID of the daemon job cron trigger.
Errors
| Status | Description |
|---|---|
400 | args is not an object or fails the job's checks, or cron_expression does not parse or runs less than 5 minutes apart. |
403 | environment_id is not one of yours. |
curl -X POST 'https://api.truto.one/daemon-job-cron-trigger' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"daemon_job_id": "your_daemon_job_id",
"daemon_id": "your_daemon_id",
"cron_expression": "0 0 * * *",
"args": {},
"daemon_group_key": "your_daemon_group_key",
"environment_id": "your_environment_id"
}'const body = {
"daemon_job_id": "your_daemon_job_id",
"daemon_id": "your_daemon_id",
"cron_expression": "0 0 * * *",
"args": {},
"daemon_group_key": "your_daemon_group_key",
"environment_id": "your_environment_id"
};
const response = await fetch('https://api.truto.one/daemon-job-cron-trigger', {
method: 'POST',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/daemon-job-cron-trigger"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"daemon_job_id": "your_daemon_job_id",
"daemon_id": "your_daemon_id",
"cron_expression": "0 0 * * *",
"args": {},
"daemon_group_key": "your_daemon_group_key",
"environment_id": "your_environment_id"
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())