---
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.

## Changes

- **2025-05-29** `2deb154b9766` — 2 info
  - added the non-success response with the status `403`
  - added the non-success response with the status `404`
- **2025-05-28** `d03e8c66c195` — 2 info
  - removed the non-success response with the status `403`
  - removed the non-success response with the status `404`

[Change history](https://skmtc.dev/microfox-ai/apis/microfox-discord-sdk-api/changes/removeRoleFromUser/post.md)

---

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