---
title: "Bans a player."
method: POST
path: "/bans"
tags: ["Player Bans"]
---

# Bans a player.

`POST /bans`

## Request body

- NewBan
  - `player_id` string, required — a SteamID
  - `player_ip` string, ipv4, nullable — The player's IP address. If left unspecified, the player's last known IP address will be used instead.
  - `reason` 'macro' | 'auto-bhop' | 'auto-strafe', required

## Response `201`

- CreatedBan
  - `ban_id` integer, required

## Other responses

- `401`
- `409` — the player is already banned
- `422` — invalid request body

---

[API](https://skmtc.dev/cs2kz/apis/cs2kz-api.md) · [All operations](https://skmtc.dev/cs2kz/apis/cs2kz-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cs2kz/cs2kz-api/revisions/73ecd7bbda3b/schema)
