POST
Ban user

Overview

Bans a user account. The operation:
  1. Sets users.status = BANNED, users.bannedAt = now, users.bannedReason = reason.
  2. Revokes every active refresh token the user holds — they are forced to re-login on all devices and will then hit the disabled-account gate.
It is idempotent: re-banning an already-banned user is a no-op (the original bannedAt/bannedReason are not overwritten).

Authentication

Bearer <accessToken> with scope: 'admin' required (requireAdmin).
Role-gated: requires SUPER or MODERATOR. A FINANCE admin is read-only on the user surface and receives 403 FORBIDDEN.

Path parameters

Query parameters

None.

Request body

Example payload

Response — 200 OK

Returns the updated user summary object.

Error responses

Example error — 403 FORBIDDEN

Side effects

  • users row updated (status, bannedAt, bannedReason).
  • All of the user’s refresh_tokens rows revoked.
  • An audit-log row is written (admin id, target user id, action users.ban).

See also

curl

Postman

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