---
title: "Ban guild member"
method: PUT
path: "/guilds/{guild_id}/bans/{user_id}"
tags: ["Guilds"]
---

# Ban guild member

`PUT /guilds/{guild_id}/bans/{user_id}`

Ban guild member. Requires ban_members permission. Prevents user from joining; optionally deletes recent messages and sets ban expiry duration.

## Path parameters

- `guild_id` string, snowflake, required
- `user_id` string, snowflake, required

## Request body

- GuildBanCreateRequest
  - `delete_message_days` integer — Number of days of messages to delete from the banned user (0-7). Deprecated in favor of delete_message_seconds.
  - `delete_message_seconds` integer — Number of seconds of messages to delete for the banned user (0-604800, default 0)
  - `reason` string, nullable — The reason for the ban (max 512 characters)
  - `ban_duration_seconds` integer — Duration of the ban in seconds (0 for permanent, or between 60 and 63072000 seconds for a temporary ban)

## Response `204`

No Content

## Other responses

- `400` — Bad Request - The request was malformed or contained invalid data
- `401` — Unauthorized - Authentication is required or the token is invalid
- `403` — Forbidden - You do not have permission to perform this action
- `429` — Too Many Requests - You are being rate limited
- `500` — Internal Server Error - An unexpected error occurred

---

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