# Retention

> What WhaBuzz stores, for how long, and how retention controls the replay window.

Canonical: https://docs.whabuzz.com/guides/retention/

## What is kept {#kept}

| Data | How long |
|---|---|
| Event metadata (id, type, timestamps, wamid, wa_id, number) | Forever |
| Event bodies and the `raw` Meta payload | Your `retention_days`, then removed |
| Webhook delivery records and attempts | 13 months |
| Media bytes | Never stored. Streamed through. |
| Business access tokens | Until you disconnect the number; stored encrypted |

## Your setting {#setting}

`retention_days` is one of **30, 90, 180 or 365**, default **90**. Change it with [`PATCH /v1/tenant`](https://docs.whabuzz.com/api/tenant.md#updateTenant). A shorter value removes older bodies at the next cleanup; a longer one only applies to events from now on.

Under the hood events live in monthly partitions that are dropped at 13 months.

## Replay window {#replay}

An event can be replayed only while its body exists, so the replay window equals your retention. Replaying older events answers `404 not_found` with `details.reason: "payload_expired"`. See [Webhooks](https://docs.whabuzz.com/guides/webhooks.md#replay).

Read the log yourself with [`GET /v1/events`](https://docs.whabuzz.com/api/events.md#listEvents) and [`GET /v1/events/{event_id}`](https://docs.whabuzz.com/api/events.md#getEvent).

## Customer data {#customer}

Message bodies contain your customers' personal data. Choose the shortest retention that serves you, and mirror what you need into your own system from the webhook.
