Retention and deletion
Settings
Section titled “Settings”Administrators read and update tenant settings:
GET /v1/settings/retentionPUT /v1/settings/retentionContent-Type: application/json
{ "captureRetentionDays": 365, "uploadRetentionDays": 30 }null means retain indefinitely. Values are whole days from 1 to 3650. Settings are tenant-scoped and
never affect another tenant.
Capture deletion
Section titled “Capture deletion”DELETE /v1/captures/:id requires an administrator session and a same-origin request. The API:
- loads the capture and its attachments for the reviewer’s tenant,
- deletes attachment objects from storage,
- sets
deleted_at, - appends one
capture.deletedaudit event.
Deleted captures disappear from lists, detail, search, and exports. Earlier audit events are retained.
The request returns 404 for another tenant’s capture.
Retention pass
Section titled “Retention pass”The API exposes POST /v1/maintenance/retention for administrators and runs the same pass on a
schedule in both runtimes. For each tenant with a capture retention period, it finds terminal
captures (accepted, returned, rejected) older than the cutoff, removes their evidence objects,
marks them deleted, and appends a system-attributed capture.deleted event. Unconsumed uploads older
than the upload retention period are removed with their objects.
What is preserved
Section titled “What is preserved”- Audit events, including the deletion event and every earlier transition.
- Capture metadata needed to interpret the audit trail. Evidence bytes are removed.
- Webhook delivery history and tenant settings.
If a stricter hard purge is required, treat it as a new policy decision and ADR. Backups may still contain deleted data according to the operator’s backup retention; document and enforce that separately.
Verification
Section titled “Verification”Use synthetic data to confirm that a deleted capture is absent from:
curl -H "Cookie: $SESSION" "$API/v1/captures"curl -H "Cookie: $SESSION" "$API/v1/exports/captures?format=json"and that its object keys are gone from the bucket. The shared contract suite exercises deletion, retention, and export exclusion.