> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cleanup

> Trigger data cleanup operations for expired records and old audit logs.

The Cleanup API triggers maintenance operations that remove expired data. Rate limited to 5 requests/min due to its destructive nature. **Admin only.**

## POST /api/v1/cleanup

Trigger data cleanup for the tenant. Removes expired variant assignments and old audit logs based on tenant retention configuration.

### Example

```bash theme={null}
curl -X POST https://playground.kaireonai.com/api/v1/cleanup \
  -H "X-Tenant-Id: my-tenant"
```

### Response

```json theme={null}
{
  "cleaned": {
    "expiredVariantAssignments": 142,
    "oldAuditLogs": 3580
  }
}
```

<Tip>
  Cleanup runs are audit-logged. You can automate periodic cleanup by calling this endpoint from a cron job or scheduled pipeline.
</Tip>
