Unban user
Users
Unban user
Reverse a ban: clear bannedAt/bannedReason and restore the user to ACTIVE. SUPER or MODERATOR only.
POST
Unban user
Overview
Reverses a ban. ClearsbannedAt and bannedReason and restores users.status = ACTIVE. The user can sign in again (they were forced out of all sessions at ban time; unban does not re-issue tokens — the user logs in normally).
Idempotent: a no-op on a user who is already ACTIVE.
Authentication
Bearer <accessToken> with scope: 'admin' required (requireAdmin).
Path parameters
| Name | Type | Required | Notes | Example |
|---|---|---|---|---|
id | string | yes | User ObjectId, 1..64 chars. | 66400a8f1c2b4d5e6f7a8b01 |
Query parameters
None.Request body
None.Response — 200 OK
Returns the updated user summary object with status: "ACTIVE" and bannedAt/bannedReason cleared to null.
Error responses
| Status | Code | Meaning |
|---|---|---|
| 401 | UNAUTHENTICATED | Missing, malformed, expired, or non-admin-scope token. |
| 403 | FORBIDDEN | Caller is a FINANCE admin (read-only on the user surface). |
| 404 | NOT_FOUND | No user with that id. |
Example error — 404 NOT_FOUND
Side effects
usersrow updated (status = ACTIVE,bannedAt/bannedReason = null).- An audit-log row is written (admin id, target user id, action
users.unban).
See also
- Ban user — the action this reverses.
curl
Postman
Seedocs/postman/swappr.postman_collection.json → Admin Users → Unban.