---
title: "Ban User"
method: POST
path: "/admin/users/{user_id}/ban"
tags: ["admin", "users"]
---

# Ban User

`POST /admin/users/{user_id}/ban`

## Request

- Base URL: `https://api.trytrata.com`
- URL: `https://api.trytrata.com/admin/users/{user_id}/ban`
- Auth: HTTP bearer

## Path parameters

- `user_id` string, required

## Request body

- BanUserRequest
  - `banned_until` string, date-time, nullable

## Response `200`

Successful Response

- BanUserResponse
  - `banned_until` string, date-time, required

## Other responses

- `404`: Not found
- `422`: Validation Error

## Changes

- **2026-09-16** `7d4d864e0649`: 1 breaking, 1 warning, 2 info
  - the request's body type changed from `object` to no type
  - removed the request property `banned_until`
  - added `#/components/schemas/BanUserRequest, subschema #2` to the request body `anyOf` list
  - the request body `application/json` default value `{}` was removed

[Operation history](https://skmtc.dev/trytrata/apis/trytrata-api/changes/admin/users/:user_id/ban/post.md)

---

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