---
title: "Performs a moderation action on a user in a Discord guild."
method: POST
path: "/moderateUser"
---

# Performs a moderation action on a user in a Discord guild.

`POST /moderateUser`

The moderateUser function allows administrators to execute various moderation actions on users within a Discord guild. It supports actions such as banning, kicking, timing out, and warning users, with optional parameters for specifying reasons, durations, and message deletion.

## Request body

- object
  - `body` object — Body of the moderateUser sls call
    - `arguments` unknown[], required
      - unknown
    - `auth` object — Authentication object
      - `strategy` 'apikey' — Authentication strategy
      - `variables` unknown[] — Variables for the authentication strategy
        - unknown
    - `packageName` string — @microfox/discord

## Response `200`

Successful moderation action

- object
  - `success` boolean — Indicates if the moderation action was successful.
  - `message` string — A message describing the result of the moderation action.

## Other responses

- `400` — Bad Request - Invalid parameters
- `403` — Forbidden - Insufficient permissions
- `404` — Not Found - User or guild not found
- `500` — Internal Server Error

---

[API](https://skmtc.net/microfox-ai/apis/microfox-discord-sdk-api.md) · [All operations](https://skmtc.net/microfox-ai/apis/microfox-discord-sdk-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/microfox-ai/microfox-discord-sdk-api/versions/7cb5b64ae924/schema)
