Effective: May 2026 Review cycle: Annual
Retention Schedule
| Data Type | Retention Period | Deletion Trigger |
|---|---|---|
| User account (email, name, Clerk ID) | Duration of account | Account deletion |
| Org membership records | Duration of membership | Member removal or org deletion |
| Episode scripts & drafts | Duration of account | Account deletion |
| Audio files (Cloudflare R2) | Duration of account | Account deletion |
| Pipeline run metadata | 30 days after a customer deletes it (adjustable; userDeletedRetentionDays) | The daily retention job, once the deleted run is older than the configured window. A customer can restore it from Logs until then. |
| Deleted run or episode (rows and audio) | Up to 30 days after deletion (adjustable; userDeletedRetentionDays) | The daily retention job permanently removes the run, draft and audio once the window passes. A customer can restore it from Logs until then, or permanently delete it sooner from Studio > System with the typed confirmation. A retired project or organisation is excluded: ADR-029 restores a project, and orgErasureDays owns a deleted tenant. |
| API request logs | 90 days | Rolling; log rotation |
| Billing records (invoices, invoice lines, subscription, payment method reference, usage ledger) | 7 years | Legal obligation; not user-deletable, and not removed by an org deletion - the money tables refuse that delete at the database (onDelete: Restrict, enforced since 2026-11-11). Removal is a manual, audited database action. |
Audit logs (admin actions, AuditLog) | 24 months | Removed by the daily cleanup job once older than 24 months |
| Anonymised analytics | Indefinite | No personal data retained post-anonymisation |
| Deleted organisation's content and personal data | 30 days (adjustable; orgErasureDays) | The daily retention job, once the organisation has been deleted for the configured window |
Audio Storage
Episode audio is stored in Cloudflare R2 under orgs/<orgId>/projects/<projectId>/, in two families: a run's own artifacts under runs/<YYYY>/<MM>/<DD>/<runId>/, and a published episode under episodes/<editionId>/audio.mp3, which is not inside the dated prefix and is therefore not reachable by a lifecycle rule on run scratch.
R2 deletions for run artifacts are executed by the daily retention job once a customer-deleted run is older than userDeletedRetentionDays, and by POST /api/projects/[projectId]/settings/storage-cleanup when a project admin reclaims eligible data or derived renders sooner. The predicate, the deletion and the R2 sweep are one implementation in lib/services/storageCleanup.service.ts; the platform-wide customer deletion sweep is lib/services/userDeletion.service.ts.
Backup Retention
The database is hosted on Neon and is restored from its continuous point-in-time history. The history window is a per-project setting, with 7 days as the operating target. Restores are performed into a separate branch, never over the live one, and are encrypted at rest. Backups are not accessible to end users and are used solely for disaster recovery.
There is no second copy outside this provider yet; that gap is tracked as a launch item and is the reason the dump is on the roadmap rather than in this paragraph.
Deletion Requests
What actually happens, which is what this document is for. Deleting an organisation (Settings → Organisation, OWNER only) does two things at once and one thing later:
- Immediately, before any row is written: a live subscription is cancelled at the payment provider, so no further charge can follow. If the provider refuses, the deletion is refused with it and the organisation stays as it was.
- Immediately, in one transaction: the organisation, its projects, runs and drafts are soft-deleted, which removes every surface and every sign-in from it. This is reversible by an operator on request, because a deletion pressed by mistake is a support conversation, not a data loss.
- After the retention window (30 days by default,
orgErasureDayson/admin/limits): the daily retention job erases the organisation's content and personal data - its name, memberships, invitations, projects, runs, drafts, test episodes, sources, music, custom voices, saved templates and presets, and its audio in object storage. A member whose only organisation this was has their name and email cleared. The organisation row itself is kept, renamed, because the billing records below point at it.
What is kept, and why. Invoices, invoice lines, the subscription, the payment-method reference (brand and last four only), the credit ledger and the audit log are kept for the periods in the schedule above: tax and consumer law require an invoice to survive the account it was issued to. They contain no free text a person wrote. The money tables refuse a hard delete at the database level, so this is enforced rather than promised.
Erasure on request. A request to privacy@podcastnext.com is honoured by deleting the organisation and setting the window to 0, which makes the next daily run erase it. The Clerk identity itself is removed in the Clerk dashboard by the operator once the request is verified; the application clears the name and email that it held.
Retention is a setting, and this document follows it. orgErasureDays (0-365) is on the platform limits page with an audit row for every change, so the window above is a statement about configuration rather than a claim about a constant somebody has to keep in sync with this file.
Responsibility
The engineering team is responsible for maintaining these mechanisms. Every row above is now enforced by code rather than by intent: app/api/cron/cleanup/route.ts runs daily and performs the audit-log purge, the seen-story purge, the test-episode reclamation (rows and audio), the customer-deleted run and episode sweep, the deleted-organisation erasure and the orphaned-storage sweep; the money retention is enforced by onDelete: Restrict at the database. Changing a period means changing a PlatformLimit or a migration - never only this document.