---
title: "Set how long audit events are kept (365 to 3,650 days)."
method: PUT
path: "/v1/organizations/current/audit/retention"
tags: ["organizations"]
---

# Set how long audit events are kept (365 to 3,650 days).

`PUT /v1/organizations/current/audit/retention`

## Request

- Base URL: `https://api.50heads.com`
- URL: `https://api.50heads.com/v1/organizations/current/audit/retention`
- Auth: HTTP bearer

Organization admins only (403 `organization_admin_required`), on a browser session with a fresh proof in the `x-50h-reauth` header (401 `reauth_required`). It needs a person: API keys, connected apps and service accounts get 403 `session_required`. Every change is written to the organization's audit. A daily job deletes events older than the period, except those a legal hold covers. Once set, the period applies to the workspace logs too. 50heads keeps its own records (payments, payouts, fraud checks) for as long as it must, whatever is set here.

## Request body

- OrganizationAuditRetentionUpdateRequest
  - `days` integer, required

## Response `200`

OK

- OrganizationAuditRetentionUpdateResponse
  - `retention` object, required
    - `days` integer, required
    - `isDefault` boolean, required
    - `floorDays` integer, required
    - `defaultDays` integer, required
    - `maxDays` integer, required
    - `setBy` object, nullable, required
      - `id` string, required
      - `name` string, nullable, required
    - `setAt` string, nullable, required

## Other responses

- `400`: The request is not valid; `error.details.validation` lists the fixes.
- `401`: No key or token, or it expired or was revoked.
- `403`: The key or token lacks the scope (`insufficient_scope`), or the action is not allowed.
- `429`: Too many requests; wait for Retry-After.

---

[API](https://skmtc.dev/50heads/apis/50heads-api.md) · [All operations](https://skmtc.dev/50heads/apis/50heads-api/llms.txt) · [OpenAPI document](https://skmtc.dev/50heads/apis/50heads-api/revisions/20175e8b00e3?raw)
