# Data retention

What the API keeps about requests and integrations is deleted automatically after a fixed time. The clean-up jobs run on a schedule — inside our database, and for export files a service on our own server; nothing waits for someone to remember it.

| Data | Kept for | Deleted |
|---|---|---|
| API request log — `GET /v1/request-logs` shows you the last 30 days | 90 days | daily |
| Idempotency keys and the stored first response | 24 hours | daily, once expired |
| Audit events — `GET /v1/audit-events` | 90 days | daily |
| Events — `GET /v1/events` | 30 days | daily |
| Webhook deliveries and their attempts | 30 days | daily |
| Data export files — the file behind a creator's data export link | 7 days | every few minutes, once the link expired |
| Export jobs — `GET /v1/jobs/{id}` | 30 days | every 10 minutes, counted from when the job finished |
| Unused claim links | 30 days | daily, counted from when the link expired |
| Invitations to join an account — `GET /v1/members` | 30 days | daily, counted from when the invitation was accepted, revoked or expired |
| OAuth authorization codes | 1 day | daily, counted from when the code expired |
| OAuth access and refresh tokens | 1 day | daily, counted from when the token expired |
| Revoked OAuth grants (a creator's connection to an app) with their codes and tokens | 90 days | daily, counted from the revocation |

## What these records hold

- **Request log:** method, route template (`/v1/leads/{id}`, never the real URL), status, error code, request id, key and duration. No creator data, no request bodies, no IP address.
- **Idempotency keys:** your key, a hash of the request and the first response, so that a retry gets the same answer.
- **Audit events:** who created, rolled or revoked a key, changed a webhook endpoint, the key policy or an authenticator — with the time and, where we know it, the IP address and client.
- **Data exports:** the file a creator asked for through an app (her profile, photos and records); 7 days after it is ready the export turns `expired` and the file is deleted. The record that she asked for an export stays.
- **Export jobs:** the job's status and progress, never the exported data.
- **Claim links:** a hash of the link, the lead it belongs to and when it expires. A used link stays as the record of who issued it.
- **Invitations:** the invited email address, the role, who invited and a hash of the join link. The membership that an accepted invitation created stays as long as the person is a member.
- **OAuth codes, tokens and grants:** hashes only, never a token itself; the grant records which app a creator connected and with which scopes.
- **Events:** the event type, the ids it concerns and what changed (`previous_attributes`: the names of the changed fields, with the old value only for `stage` and `status`). Most payloads are built from the object's current state when the event is read or delivered, but a few events store a snapshot of their object with the event: a removed photo (`photo.removed`: its id, lead, kind, primary flag, consent status and timestamps — never the file or its storage path) and the job or data request a creator API event is about (`job.completed`, `data_export.ready`, `deletion_request.completed`: status and timestamps, no creator data). Snapshots are deleted with their event after 30 days.
- **Webhook deliveries:** no payload is stored; for each delivery attempt the status code, duration and a short error.

## Leads and creator data

Leads, listings, photos and confirmations are not on this list: they stay while the creator is in the pipeline. The same goes for the [consent ledger](https://docs.creator-guard.com/consent-ledger/), which is evidence: a decision made through an OAuth app keeps the app's name as it was at that moment, even if the app is renamed or deleted later. How a creator has her data removed is described under [Data protection](https://docs.creator-guard.com/data-protection/).

## Backups

The database is backed up every night: encrypted copies on our own server, plus the daily backups of our database provider. Deleted data leaves the backups when they age out.
