Change some settings
const url = 'http://127.0.0.1:7700/api/settings';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"approvalThresholdCents":2000,"networkDefault":"allowlist","defaultHosts":["example.com"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url http://127.0.0.1:7700/api/settings \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "approvalThresholdCents": 2000, "networkDefault": "allowlist", "defaultHosts": [ "example.com" ] }'Owner only. Changes only the keys you send; quietHours and appearance merge one level deep. An
unknown key or a bad value is a 400 that names the field, and nothing changes. Each change is a
note event in the log with the old and the new value. The settings are saved in
BOX_HOME/settings.json.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
A single spend above this, in US cents, always asks for an OK, even inside the task’s budget.
The budget of a task that names none. 0 means every spend asks.
With allowlist, a task that names no hosts gets defaultHosts.
Personal. Folders agents may be given besides the owner’s home. Never the system or the box’s own state.
object
object
A color like #5b8cff, or empty for the default.
Example
{ "approvalThresholdCents": 2000, "networkDefault": "allowlist", "defaultHosts": [ "example.com" ]}Responses
Section titled “Responses”Every setting, after the change.
object
A single spend above this, in US cents, always asks for an OK, even inside the task’s budget.
The budget of a task that names none. 0 means every spend asks.
With allowlist, a task that names no hosts gets defaultHosts.
Personal. Folders agents may be given besides the owner’s home. Never the system or the box’s own state.
object
object
A color like #5b8cff, or empty for the default.
Example
{ "approvalThresholdCents": 10000, "defaultBudgetCents": 0, "networkDefault": "none", "defaultHosts": [], "agentFolders": [], "quietHours": { "enabled": false, "from": "22:00", "to": "07:00" }, "logRetentionDays": 365, "updateChannel": "stable", "autoUpdate": true, "appearance": { "theme": "light" }}An unknown setting or a bad value.
object
What went wrong
Example
{ "error": "settings.defaultBudgetCents: must be a whole number from 0 to 100000000"}The owner’s route, called by someone who is not the box’s own screen or a device paired as the owner.
object
What went wrong
Example
{ "error": "only the box's own screen or the owner's paired device can do this"}GurtOS is open source under the Apache License 2.0.Source code on GitHub.