---
title: "Removes a specific role from a user in a guild."
method: POST
path: "/removeRoleFromUser"
---

# Removes a specific role from a user in a guild.

`POST /removeRoleFromUser`

This function revokes a designated role from a user within a specified guild. It allows for optional audit log documentation by providing a reason for the role removal. The function returns a Promise that resolves upon successful role removal.

## Request body

- object
  - `body` object — Body of the removeRoleFromUser 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`

Role successfully removed from the user.

- object
  - `success` boolean — Indicates if the role was successfully removed.

## Other responses

- `400` — Bad request. This could occur if the provided IDs are invalid or if the user doesn't have the specified role.
- `403` — Forbidden. The bot doesn't have the necessary permissions to remove roles.
- `404` — Not Found. The specified guild, user, or role doesn't exist.
- `500` — Internal server error. An unexpected error occurred while processing the request.

---

[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)
