Skip to content

Change the engine's settings (owner only): checked with the rules the engine loads the settings file with, saved, and journaled as set_engine_settings.

POST
/datanotes/settings/update/
curl --request POST \
--url https://example.com/datanotes/settings/update/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Datanotes-Actor: {"harness":"my-script","model":"","session":"s-1"}' \
--data '{ "expect_version": "example", "changes": { "additionalProperty": "example" }, "dry_run": false }'

expect_version is the settings_version you read: another change since is refused (409). changes maps each setting to its new value; null puts its default back (not httpServerToken); telemetryHeaders is a patch merged into the current headers (a header set to null is removed). Secrets are write-only: send a new value, never read one; an address sent back as shown (without its credentials) keeps them. All or nothing: one refused value refuses the change, and refused lists each. A live setting applies from the next request or job, a restart one at the next start. dry_run: true checks without saving. A named token is refused (403), even with maintain.

X-Datanotes-Actor
string

JSON: on whose behalf the write is made, recorded in the journal (harness, model, session).

Example

{"harness":"my-script","model":"","session":"s-1"}
Media typeapplication/json
object
expect_version
required

The settings_version that /settings/ answered.

string
changes
required

Setting name -> new value; null puts the default back.

object
key
additional properties
dry_run

Check only: nothing saved, journaled or logged.

boolean

Done.

Media typeapplication/json
object
ok
required
boolean
dry_run
required
boolean
settings_version
required

The new version (unchanged on a dry run or when nothing changed).

string
changed
required

The settings whose value changes, in settings order.

Array<string>
applied_now
required

Of changed: the ones that apply at once.

Array<string>
after_restart
required

Of changed: the ones that apply at the next start.

Array<string>
restart_pending
required

Every setting waiting for a restart after this change.

Array<string>
follow_ups
required

What to do next.

Array<object>
object
setting
required
string
description
required
string
migration_id

The journal entry (absent on a dry run or when nothing changed).

string
settings
required

Every key of the settings file, in its order.

Array<object>

One key of the engine’s settings file, with its rule. Secrets are never sent: the owner token has no value, header values and the credentials inside an address are hidden.

object
name
required

The settings file’s key (camelCase).

string
type
required

The kind of value it takes.

string
Allowed values: boolean integer number string enum string_list string_map
value

The value saved now. Absent when write_only; telemetryHeaders shows each header’s value as <redacted>; an address shows no user or password.

default_value

The value when the file does not set it. Absent for httpServerToken.

changed
required

The value differs from the default (httpServerToken: it is set).

boolean
expected
required

The allowed values in words, read after “ takes “.

string
values

The allowed values of an enum.

Array<string>
minimum

The smallest value of an integer or number, when it has one.

number
maximum

The largest value of an integer or number, when it has one.

number
applies
required

live: a change applies from the next request or background job; restart: at the engine’s next start.

string
Allowed values: live restart
editable
required

False for the settings that change only in the settings file (tableKey, transactionLogFormat).

boolean
change_with

When not editable: why, and how to change it.

string
restart_pending
required

A restart setting whose saved value is not the one the engine runs with.

boolean
overridden_by

A start option of datanotes serve that wins over the setting, in words.

string
write_only

Its value is never sent (httpServerToken).

boolean
redacted

Something was hidden: header values, the credentials of an address, the token.

boolean
sends_data

An address the engine sends data to.

boolean
warning

What a change of it does, to show before it is saved.

string

Example

{
"ok": true,
"settings": [
{
"type": "boolean",
"applies": "live",
"write_only": true,
"redacted": true,
"sends_data": true
}
]
}

A bad body, or values refused: nothing changed. refused lists every refused setting.

Media typeapplication/json
object
error
required
string
refused
Array<object>
object
setting
required
string
error
required
string
hint
required
string

Example generated

{
"error": "example",
"refused": [
{
"setting": "example",
"error": "example",
"hint": "example"
}
]
}

Missing or wrong bearer token.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

A named token beyond its permissions (the engine’s administration, tables outside its write patterns, schema changes without ddl).

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

The settings changed since you read them (expect_version), or the settings file was edited on disk while the engine runs: nothing changed.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Unexpected error.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

The settings could not be saved or journaled: nothing changed.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}