---
title: "Ban several users at once"
method: POST
path: "/stats/users/bulk-ban"
tags: ["Stats"]
---

# Ban several users at once

`POST /stats/users/bulk-ban`

## Request

- Base URL: `https://api.nippy.host`
- URL: `https://api.nippy.host/stats/users/bulk-ban`
- Auth: `bearer` (a scheme the document does not define)

Admin-only (ADR 0049). Applies the full single-user ban to each listed user in turn, with one reason. Users that cannot be banned (already banned, an admin, yourself, not found) are skipped and reported. Never adds email-domain rules.

## Request body

- BulkBanUsersDto
  - `userIds` string[], required: Users to ban. Duplicates are ignored.
  - `reason` string, required: One reason, recorded on every ban.

## Response `200`

- APIAdminBulkBanResult
  - `banned` number, required: Users banned by this request.
  - `skipped` number, required: Users not banned (see each item’s error).
  - `items` APIAdminBulkBanItem[], required
    - `userId` string, required: User id (UUID).
    - `banned` boolean, required: Whether this user is now banned by this request.
    - `error` string, nullable, required: Why the user was not banned (already banned, an admin, not found…); null when banned.
    - `result` APIAdminBanResult, required
      - `userId` string, required: User id (UUID).
      - `bannedAt` string, required: Ban time (ISO 8601).
      - `tokensRevoked` number, required: API and MCP/OAuth tokens revoked.
      - `sitesSuspended` number, required: Sites suspended across the accounts the user owns.
      - `previewsDiscarded` number, required: Live previews discarded.
      - `subscriptionsCanceled` number, required: Stripe subscriptions cancelled immediately.
      - `domainBlocked` string, nullable, required: The domain a new `block` rule was added for, or null when none was added.
      - `failures` string[], required: Human-readable descriptions of takedown steps that failed.

## Other responses

- `403`: Admin access required

---

[API](https://skmtc.dev/nippy/apis/nippy-backend-api.md) · [All operations](https://skmtc.dev/nippy/apis/nippy-backend-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nippy/apis/nippy-backend-api/revisions/7ab23f040a55?raw)
