---
title: "Delete a role from a guild in Discord."
method: POST
path: "/deleteRole"
---

# Delete a role from a guild in Discord.

`POST /deleteRole`

This function removes a specified role from a Discord guild. It takes the guild ID and role ID as parameters and returns a Promise that resolves when the role is successfully deleted. This operation is irreversible and should be used with caution.

## Request body

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

- object
  - `message` string

## Other responses

- `400` — Bad request - invalid guild ID or role ID
- `403` — Forbidden - insufficient permissions to delete the role
- `404` — Not found - guild or role does not exist
- `500` — Internal server error

## Changes

- **2025-05-29** `2deb154b9766` — 1 warning, 3 info
  - removed the optional property `success` from the response with the `200` status
  - added the non-success response with the status `403`
  - added the non-success response with the status `404`
  - added the optional property `message` to the response with the `200` status
- **2025-05-28** `d03e8c66c195` — 1 warning, 3 info
  - removed the optional property `message` from the response with the `200` status
  - removed the non-success response with the status `403`
  - removed the non-success response with the status `404`
  - added the optional property `success` to the response with the `200` status

[Change history](https://skmtc.dev/microfox-ai/apis/microfox-discord-sdk-api/changes/deleteRole/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)
