Create daemon job
/daemon-job
Request Body
See args_schema on the daemon job.
See args_validation on the daemon job.
Ignored for API tokens.
Nightly exportResponse Body
Describes the args a run of this job takes, keyed by arg name. An arg whose value has format: integrated_account_id must be the ID of an integrated account in the job's environment, and required: true makes it mandatory. Other entries are stored but not checked.
{"integrated_account_id":{"format":"integrated_account_id","required":true}}A JSONata expression evaluated against { args } when a run or a cron trigger is created. Return an object with a message to reject the args with a 400 carrying that message.
$not(args.since) ? { "message": "since is required" }The environment the daemon job belongs to.
The ID of the daemon job.
8c1d4c1e-9a0b-4b0e-a3f5-4cfa0d1f2e10A name for the daemon job.
Nightly exportcurl -X POST 'https://api.truto.one/daemon-job' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"label": "Nightly export",
"args_schema": {},
"args_validation": "your_args_validation",
"environment_id": "your_environment_id"
}'const body = {
"label": "Nightly export",
"args_schema": {},
"args_validation": "your_args_validation",
"environment_id": "your_environment_id"
};
const response = await fetch('https://api.truto.one/daemon-job', {
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"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"label": "Nightly export",
"args_schema": {},
"args_validation": "your_args_validation",
"environment_id": "your_environment_id"
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())