Archive, never delete
Apex never deletes data. Every destructive-looking action — "delete" buttons, "remove member" flows, expired subscriptions, trial ends — is an archive. The row stays in the database with an archivedAt timestamp set. It disappears from default-visible lists. Every relation that referenced it keeps pointing to the same row.
This is a principle, not a feature flag. It applies at every scope: organizations, workspaces, leads, experiments, communications, cohorts, partner profiles, memberships, invitations, api keys. If you built an experiment six months ago and someone "deleted" it, it's archived — every event that referenced it, every decision that cited it, every variant that won, is preserved.
Why
Scientific integrity
Apex exists to help teams learn from experiments and observations. If we let operators delete data, every historical insight becomes suspect: "did this experiment actually run? Did that lead actually convert? Was this cohort actually correct when we sent that campaign?" The archive-only model guarantees the answer is always recoverable.
Audit and compliance
Mutation events flow through an append-only audit log. Archives emit audit entries too. An auditor asking "who removed whom on what date" gets a deterministic answer.
Reversibility
If a workspace admin archives a lead by accident, unarchive is one click. No restore from backup, no support ticket, no data reconstruction. The row never left — it was just hidden.
Partner-payout history
Apex Partner Network carries money-movement history across merchants. Every transfer, every holdback, every vouch. Those histories are scientific-rigor-class: they can never be edited after the fact, and they must resolve even when a merchant or partner is "gone" from the product. Archive-only makes that trivial.
What this looks like in practice
"Delete" buttons archive
Every place you see a destructive button — Delete, Remove, Cancel — it archives. The confirmation copy says "Archive" or "Remove from visible lists," not "Delete." When a button says "Delete" somewhere, that's a bug; file it.
Archived rows stay visible when appropriate
- Historical reports show archived workspaces / cohorts / experiments so week-over-week numbers stay legible.
- Lead detail pages show archived partner-profile links with a muted "archived" chip so you can still see relationships that once existed.
- Audit logs never hide archived records.
Archived rows stop firing
Cohort archive prevents new communications from targeting it. Workspace archive hides it from the switcher default. Default-visible lists all filter archivedAt IS NULL.
Unarchive is one click
Every archived entity can be unarchived by the same role that archived it. The unarchive clears archivedAt and re-updates updatedAt; no state is reconstructed because no state was lost.
Re-signup re-activates
If a human's OrgPerson is archived and they sign back in with the same email, Apex unarchives their original record rather than creating a duplicate. History — Leads, Partner Profiles, cohort memberships — re-attaches automatically.
"Empty" stores have real reasons
If you go to look at a workspace and it's empty, something is genuinely empty. Apex never silently hid things you might have expected to see. Either a filter is on, or the data simply hasn't been produced yet.
Small exceptions
Pure ephemera — dedup hashes, session tokens, rate-limit counters, transient cache rows — may hard-delete. These carry no scientific value and no entity references them. Any such hard-delete should be annotated in code with a one-line comment explaining why it's allowed.
Related
- Permissions and roles — who can archive what.
- How Apex accounts work — the scope boundaries archive respects.