---
title: "Put Trace Retention"
method: PUT
path: "/api/v1/orgs/{org_id}/trace-retention"
tags: ["organizations"]
---

# Put Trace Retention

`PUT /api/v1/orgs/{org_id}/trace-retention`

## Request

- Base URL: `https://cp.xenovia.io` (the document declares no server; this is the origin it was published from)
- URL: `https://cp.xenovia.io/api/v1/orgs/{org_id}/trace-retention`
- Auth: none declared

Set how long telemetry is kept, and apply it to what is already kept.

409 while TELEMETRY_RETENTION_ENABLED is off: nothing expires, so there
is nothing to apply and nothing is written. Otherwise the organisation's
existing rows are re-stamped first: if ClickHouse refuses, the setting
is not changed (503). A shorter period deletes what falls outside it at
ClickHouse's next merge. Should the commit fail after the re-stamp, the
rows carry the new period and the setting the old one until the next
change; the follow-up re-stamp runs only once the change is committed.

## Path parameters

- `org_id` string, required

## Headers

- `Authorization` string, nullable

## Request body

- TraceRetentionUpdate: null returns a period to the platform default.
  - `content_days` integer, nullable
  - `retain_days` integer, nullable

## Response `200`

Successful Response

- TraceRetentionRead: How long the organisation's telemetry is kept, in days.
  - `enabled` boolean, required
  - `content_days` integer, required
  - `retain_days` integer, required
  - `content_days_is_default` boolean, required
  - `retain_days_is_default` boolean, required
  - `min_retain_days` integer, required
  - `max_retain_days` integer, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-04** `2f4b4b338b8f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/xenovia/apis/controlplane/changes/api/v1/orgs/:org_id/trace-retention/put.md)

---

[API](https://skmtc.dev/xenovia/apis/controlplane.md) - [All operations](https://skmtc.dev/xenovia/apis/controlplane/llms.txt) - [OpenAPI document](https://skmtc.dev/xenovia/apis/controlplane/revisions/3e25bef24f8f?raw)
