Unverified accounts cleanup

Unverified accounts cleanup

Purges sign-up accounts that never confirmed their email address.

How it works

When someone signs up, an account is created in an “unverified” state and an email verification challenge is sent. The challenge expires after 24 hours. This job removes accounts whose verification window has lapsed so that the same email can be re-used for a fresh sign-up.

  1. Finds candidates — unverified accounts older than the grace period
  2. Deletes — each candidate account is deleted, including any related auth challenges

The cleanup is global, not per-workspace. The job is pinned to the system workspace: scheduling iterates every workspace but only the system workspace produces an actual cleanup run.

When it runs

The job runs automatically and only triggers when there is at least one candidate to purge.

Parameters

ParameterDefaultDescription
Grace Period (hours)24Hours after account creation before an unverified account becomes eligible for deletion. Values below 24 are clamped to 24 to protect accounts whose verification challenge is still valid
Dry RunfalseWhen enabled, report what would be deleted without deleting anything

Job results

MetricDescription
candidatesNumber of unverified accounts past the grace period
deletedNumber of accounts actually deleted (0 in dry run)
grace_period_hoursEffective grace period after clamping
dry_runWhether this was a dry run

A run with no candidates returns skipped: true, reason: "no candidates".

Troubleshooting

IssueSolution
Account not deletedConfirm the grace period has passed. The clamp prevents shorter windows from running
Email still rejected for sign-up after cleanupRun a dry run to confirm the candidate set, then a real run. Verify no other workspace still has a user referencing that account