---
title: "Ban User"
method: POST
path: "/api/v1/community/roles/ban"
tags: ["community"]
---

# Ban User

`POST /api/v1/community/roles/ban`

## Request

- Base URL: `https://api.hipowork.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.hipowork.com/api/v1/community/roles/ban`
- Auth: OAuth 2 (password, token URL `/api/v1/auth/oauth/token`)

管理员禁用/解禁用户。

约束：不能禁自己；不能禁其他管理员（避免管理员互相封禁导致治理瘫痪）。
被禁用户仍可浏览社区，但一切写操作（发帖/回帖/点赞/举报）返回 403。

## Request body

- BanRequest
  - `user_id` string, required: 目标用户 ID
  - `banned` boolean
  - `reason` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/hipowork/apis/hipo-work-ai-recruitment-platform.md) · [All operations](https://skmtc.dev/hipowork/apis/hipo-work-ai-recruitment-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/hipowork/apis/hipo-work-ai-recruitment-platform/revisions/de21a6c57062?raw)
