Skip to content
POST /daemon

Request Body

environment_idstring · uuid

Ignored for API tokens.

group_keystring
Example: default
labelstring
Example: worker-1
metadataRecord<string, any>

Response Body

created_atstring · date-time
environment_idstring · uuid

The environment the daemon belongs to.

Example: 05daecaf-4365-42e8-8370-8127de5dd717
group_keystring

The daemon group this daemon belongs to. Runs created with a daemon_group_key go to a daemon in that group.

Example: default
idstring · uuid

The ID of the daemon.

Example: 2f0c8a5e-6f1b-4c51-9d34-1a1c3f3e9b77
labelstring

A name for the daemon.

Example: worker-1
last_active_atstring · date-time

When the daemon was last active.

lockstring

A value your daemon process can set, for example to claim the daemon. Stored as sent.

metadataRecord<string, any>

Any JSON object you want to store with the daemon.

statusstring

The daemon's status. A new daemon starts as stopped; your daemon process updates it.

Example: active
Possible values:
stoppedactivestoppingstarting
updated_atstring · date-time
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())