---
title: "Set how many days a firm's interval contexts are kept (operators only)"
method: PUT
path: "/v1/admin/tenants/{tenant}/context-retention"
tags: ["admin"]
---

# Set how many days a firm's interval contexts are kept (operators only)

`PUT /v1/admin/tenants/{tenant}/context-retention`

## Request

- Base URL: `https://api.sixminute.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.sixminute.ai/v1/admin/tenants/{tenant}/context-retention`
- Auth: HTTP bearer

Sets `policy.context_retention_days` (1 to 365; zero retention is not built) and, in the same transaction, moves every stored expiry of the firm's device contexts and notes, decided cells' screen material, runs, steps, derivation cache and stored calendar by the difference in days, never recomputing it, so a shortening applies at once. Decisions and entries have no expiry and are not touched. Answers the counts moved, the old tables' included: they move too until the follow-up drops them.

## Path parameters

- `tenant` string, required

## Request body

- object
  - `days` integer, required

## Response `200`

The setting as it now stands, and the rows moved.

- object
  - `tenant` object, required
    - `id` string, required
    - `name` string, required
  - `days` integer, required
  - `previous` integer, required
  - `shifted` object, required
    - `interval_contexts` integer, required
    - `pipeline_runs` integer, required
    - `pipeline_steps` integer, required
    - `derivation_cache` integer, required
    - `pipeline_shadow` integer
    - `pipeline_decisions` integer
    - `intervals` integer, required
    - `device_contexts` integer
    - `device_notes` integer
    - `device_intervals` integer
    - `calendar_events` integer

## Other responses

- `400`: The body, query or path did not validate; `errors` lists the fields.
- `401`: No bearer token, or one that does not verify or has expired.
- `403`: The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.
- `404`: No such row for this tenant.
- `503`: A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.

---

[API](https://skmtc.dev/sixminute/apis/sixminute-api.md) - [All operations](https://skmtc.dev/sixminute/apis/sixminute-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sixminute/apis/sixminute-api/revisions/605577eadc10?raw)
