Create daemon
/daemon
Request Body
Ignored for API tokens.
defaultworker-1Response Body
The environment the daemon belongs to.
05daecaf-4365-42e8-8370-8127de5dd717The daemon group this daemon belongs to. Runs created with a daemon_group_key go to a daemon in that group.
defaultThe ID of the daemon.
2f0c8a5e-6f1b-4c51-9d34-1a1c3f3e9b77A name for the daemon.
worker-1When the daemon was last active.
A value your daemon process can set, for example to claim the daemon. Stored as sent.
Any JSON object you want to store with the daemon.
The daemon's status. A new daemon starts as stopped; your daemon process updates it.
activestoppedactivestoppingstarting
curl -X POST 'https://api.truto.one/daemon' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"label": "worker-1",
"group_key": "default",
"metadata": {},
"environment_id": "your_environment_id"
}'const body = {
"label": "worker-1",
"group_key": "default",
"metadata": {},
"environment_id": "your_environment_id"
};
const response = await fetch('https://api.truto.one/daemon', {
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"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"label": "worker-1",
"group_key": "default",
"metadata": {},
"environment_id": "your_environment_id"
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())