Update the retention windows. Applies immediately: the PostgreSQL prune loops re-read the policy on their next tick, and the flow store's table TTL is altered before this returns.
const url = 'https://example.com/api/v1/settings/retention';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"alert_linked_days":1,"diagnostic_days":1,"flow_days":1,"report_run_days":1,"unmatched_event_hours":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/settings/retention \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "alert_linked_days": 1, "diagnostic_days": 1, "flow_days": 1, "report_run_days": 1, "unmatched_event_hours": 1 }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The operator-editable retention windows.
object
Days to keep alert history, node-state snapshots, DNS chain changes and matched events.
Days to keep on-demand diagnostics: Troubleshoot analysis runs with their findings, and generated AI root-cause reports. Optional — omitting it sets the default (90).
Days to keep traffic-flow records, applied as a ClickHouse table TTL.
Days to keep generated report runs.
Hours to keep passive events that matched no rule.
Examplegenerated
{ "alert_linked_days": 1, "diagnostic_days": 1, "flow_days": 1, "report_run_days": 1, "unmatched_event_hours": 1}Responses
Section titled “Responses”Retention updated. Lowering a window deletes data older than it on the next prune
A window is outside the allowed range
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}No valid bearer token
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Role lacks ManageConfig
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}The flow store rejected the retention change; nothing was saved
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Inventory storage is unavailable (skeleton mode)
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}