Skip to main content

Endpoints

POST /api/auth/disable-account

Disables the authenticated user’s account. Requires password verification and 2FA if enabled. Cancels all active Polar subscriptions.

Request

string
required
User password for verification
string
Required if 2FA is enabled. TOTP code from authenticator app.

Response

boolean
Always true on success
string
“Account disabled successfully”

DELETE /api/auth/disable-account

Enables a disabled account. Requires password verification and 2FA if enabled. Returns 400 error if account is not currently disabled.

Request

string
required
User password for verification
string
Required if 2FA is enabled. TOTP code from authenticator app.

Response

boolean
Always true on success
string
“Account enabled successfully”

Implementation Details

Code Reference

Status Codes

OK
Success
Bad Request
Validation error or account not disabled (DELETE only)
Unauthorized
Invalid password or 2FA code
Not Found
User not found

Example Requests

Disable Account

Enable Account

Difference from Ban

  • Disable: Temporary account suspension, can be re-enabled
  • Ban: Permanent account restriction, requires unban action
Both prevent authentication, but disable is typically used for temporary suspensions while ban is for permanent restrictions.

Security Notes

  • Requires password verification
  • Requires 2FA code if 2FA is enabled
  • All Polar subscriptions are canceled when disabling
  • Disabled accounts cannot authenticate
  • Audit logs are created for disable/enable actions

Audit Events

  • USER_DISABLE: Account disabled (POST)
  • USER_UPDATE: Account enabled (DELETE, with action: 'account_enabled')