Update the retention window

View as Markdown
Sets the workspace retention window in days, from 1 to 3650. Values outside that range are rejected, not clamped. In one transaction, it writes the workspace setting and copies the same value to `data_retention_days` on every existing country config. The content window can be shorter than the value you set, because it never exceeds the plan cap. The response reports both windows. A later `PUT /api/compliance/configs` resets the workspace window to the smallest `data_retention_days` across all country configs. Shortening the window **deletes nothing right away**. Older data goes at the next daily sweep (03:00 UTC), or immediately with `POST /api/compliance/retention/enforce`. After that sweep the deletion is irreversible. **Side effects.** Updates the workspace setting and all country configs. Writes an audit entry. Tonight's sweep uses the new window. **Idempotency.** Safe to retry. This is a full replace of one value. **Access** - **Required scope:** `full`. Signed-in users need the `owner` or `admin` role. - **Rate limit:** General API — 120 (Starter), 200 (Growth), 300 (Business) or 600 (Enterprise) requests/min per workspace. See [Rate limits](/rate-limits). - **Plan:** Available on every plan. Retention is not behind a plan gate.

Authentication

AuthorizationBearer
Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

Request

This endpoint expects an object.
data_retention_daysintegerRequired1-3650
How many days call rows and message rows are kept. Must be a whole number.

Response

The resulting retention window.
dataobject
How long the workspace keeps data, as the daily sweep applies it.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error