---
title: "Ban a user"
method: POST
path: "/projects/{id}/auth/users/{userId}/ban"
tags: ["Auth Admin"]
---

# Ban a user

`POST /projects/{id}/auth/users/{userId}/ban`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/auth/users/{userId}/ban`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Bans a user temporarily or permanently. Banned users cannot sign in
and all their active sessions are immediately revoked.
Omitting banned_until clears any previous expiry. Deleted accounts cannot be banned.

- Omit `banned_until` for a permanent ban
- Provide `banned_until` ISO timestamp for a temporary ban

## Path parameters

- `id` string, uuid, required
- `userId` string, uuid, required

## Request body

- object
  - `banned_until` string, date-time: When the ban expires (omit for permanent ban)

## Response `200`

User banned successfully

- BanUserResponse: Response when banning a user
  - `message` string, required
  - `user_id` string, uuid, required
  - `email` string, email, required
  - `status` 'banned', required
  - `banned_until` string, date-time, nullable: When the ban expires (null for permanent ban)

## Other responses

- `404`: User not found
- `409`: Deleted accounts cannot be banned or restored

## Changes

- **2026-10-07** `23e7875e7c4c`: 2 info
  - the endpoint scheme security `ProjectAccessToken` was added to the API
  - added the non-success response with the status `409`
- **2026-09-19** `3a6f365f3f35`: 3 breaking, 7 info
  - added the new path request parameter `id`
  - the response's body type changed from no type to `object` for status `200`
  - the response's body type changed from no type to `object` for status `404`
  - added the optional property `banned_until` to the response with the `200` status
  - …6 more
- **2026-08-27** `bb44e98aba2e`: 7 breaking, 3 warning
  - the response's body type changed from `object` to no type for status `200`
  - the response's body type changed from `object` to no type for status `404`
  - removed the required property `email` from the response with the `200` status
  - removed the required property `error` from the response with the `404` status
  - …6 more
- **2026-07-27** `bb52784e098a`: 1 info
  - added the optional property `code` to the response with the `404` status

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/auth/users/:userId/ban/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
