Update daemon
/daemon/{id}
Your daemon process uses this to report its status.
Truto stores status and lock as the daemon reports them and does not read or enforce either. lock is the daemon process's own lock, and any caller with access to the environment can change it. Every PATCH sets last_active_at to the current time; a last_active_at in the body is ignored.
Path Parameters
Request Body
Replaces the stored object.
stoppedactivestoppingstarting
Response 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
Errors
| Status | Description |
|---|---|
404 | Daemon not found |
curl -X PATCH 'https://api.truto.one/daemon/{id}' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"label": "your_label",
"group_key": "your_group_key",
"metadata": {},
"status": "stopped",
"lock": "your_lock"
}'const body = {
"label": "your_label",
"group_key": "your_group_key",
"metadata": {},
"status": "stopped",
"lock": "your_lock"
};
const response = await fetch('https://api.truto.one/daemon/{id}', {
method: 'PATCH',
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/{id}"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"label": "your_label",
"group_key": "your_group_key",
"metadata": {},
"status": "stopped",
"lock": "your_lock"
}
response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())