Skip to main content

Endpoints

POST /api/auth/ban-account

Bans 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 banned successfully”

DELETE /api/auth/ban-account

Unbans the authenticated user’s account. Requires password verification and 2FA if enabled. Returns 400 error if account is not currently banned.

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 unbanned successfully”

Implementation Details

Code Reference

Status Codes

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

Example Requests

Ban Account

Unban Account

Security Notes

  • Requires password verification
  • Requires 2FA code if 2FA is enabled
  • All Polar subscriptions are canceled when banning
  • Banned accounts cannot authenticate
  • Audit logs are created for ban/unban actions

Audit Events

  • USER_BAN: Account banned (POST)
  • USER_UPDATE: Account unbanned (DELETE, with action: 'account_unbanned')