POST
Reactivate a pending-deletion account

Overview

When a user calls DELETE /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

Example payload

Response — 200 OK

Identical shape to POST /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

Once the grace window elapses, the erasure worker tombstones the row (PII nulled, child data hard-deleted). After that point reactivation is impossible and returns 401 — there is no longer an account to restore.

Example error — 401

Side effects

  • Clears deletedAt + deletedReason on the user document.
  • Issues a new session (creates a refresh_tokens row keyed by a new ULID session id).
  • Writes a user.reactivated audit row (actorType: USER).

Typical client flow

  1. User logs in during the grace window → 403 ACCOUNT_PENDING_DELETION with meta.deletionScheduledAt.
  2. Client shows a reactivation screen (“Your account is scheduled for deletion on {date}”).
  3. User taps Reactivate → client calls POST /auth/reactivate with the same credentials → 200 + fresh session → user is back in.

See also

curl