POST
Ban user (from report)

Overview

Terminally bans the user named as the accused on this report. Internally this delegates to the same code path as POST /admin/users/:id/ban — there is exactly one ban implementation:
  1. Sets users.bannedAt = now, users.bannedReason = banReason, users.status = BANNED.
  2. Revokes all active refresh tokens for the user (the user is logged out of every device on next API call).
  3. Transitions the report from OPEN → BANNED with resolvedBy, resolvedAt, resolutionReason = banReason.
Idempotent: re-calling on a BANNED report returns the row unchanged. Re-banning a user who is already banned is a no-op (no double-stamp). See Ban user for the user-side ban semantics and admin auth and MFA for how revoked refresh tokens propagate.

Authentication

Bearer <accessToken> with scope: 'admin' required.
Role-gated: SUPER or MODERATOR. FINANCE admins are read-only on the reports surface. Ban is destructive and immediately locks the user out — handle with care.

Path parameters

Query parameters

None.

Request body

Example payload

Response — 200 OK

Returns the full updated report row.

Error responses

Example error — 403 FORBIDDEN

Side effects

Unlike warn, ban does not send a push or email to the banned user. They will discover the ban on their next API call (which returns 403 ACCOUNT_BANNED with the banReason in detail).

See also

curl

Postman

See docs/postman/swappr.postman_collection.json → Admin Reports → Ban.