Reactivate a pending-deletion account
Auth
Reactivate a pending-deletion account
Reverses a soft-delete inside the 30-day grace window and returns a fresh session
POST
Reactivate a pending-deletion account
Overview
When a user callsDELETE /me their account is soft-deleted: it becomes invisible to login and matching immediately, and a background worker permanently erases it 30 days later. During that 30-day grace window the deletion is reversible.
POST /auth/reactivate is the only way to reverse it. It takes the same email + password as login; on success it clears the pending deletion and returns a fresh session — an identical body to POST /auth/login. The caller lands fully authenticated.
A successful login does NOT reactivate. While an account is pending deletion,
POST /auth/login returns 403 ACCOUNT_PENDING_DELETION (with meta.deletionScheduledAt) instead of a session. This is deliberate: a user who merely wants to check their status never un-deletes by accident. Reactivation is always an explicit, separate action.Authentication
None required — like login, this endpoint takes credentials in the body.Path parameters
None.Query parameters
None.Request body
| Field | Type | Required | Allowed values | Example |
|---|---|---|---|---|
email | string | yes | RFC 5322 valid, lowercased server-side, 5..254 chars | alice@example.com |
password | string | yes | 1..200 chars | correct horse battery staple |
Example payload
Response — 200 OK
Identical shape toPOST /auth/login: accessToken, refreshToken, and a lightweight user summary. The account’s deletedAt / deletedReason are cleared, so subsequent logins succeed normally.
Example response
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | Email is malformed or password is missing. |
| 401 | UNAUTHENTICATED | Wrong credentials, no soft-deleted account for that email, or the 30-day grace window has already elapsed (nothing left to reactivate). All of these collapse to the same generic error — the endpoint is enumeration-safe and never reveals which case applied. |
| 429 | RATE_LIMITED | Too many attempts from this IP. Respect Retry-After. |
Example error — 401
Side effects
- Clears
deletedAt+deletedReasonon the user document. - Issues a new session (creates a
refresh_tokensrow keyed by a new ULID session id). - Writes a
user.reactivatedaudit row (actorType: USER).
Typical client flow
- User logs in during the grace window →
403 ACCOUNT_PENDING_DELETIONwithmeta.deletionScheduledAt. - Client shows a reactivation screen (“Your account is scheduled for deletion on {date}”).
- User taps Reactivate → client calls
POST /auth/reactivatewith the same credentials →200+ fresh session → user is back in.
See also
- Login — returns
ACCOUNT_PENDING_DELETIONduring the grace window. - Delete account — starts the 30-day grace window.
- GDPR data lifecycle — soft-delete → grace window → erasure.