---
title: "Revoke a specific role from a user"
method: DELETE
path: "/public/v1/users/{userId}/roles/{roleName}"
tags: ["Users - Roles"]
---

# Revoke a specific role from a user

`DELETE /public/v1/users/{userId}/roles/{roleName}`

### Overview
Revoke a specific role from an existing user.

### Use Cases
- **Access Reduction**: Downgrade a user's permissions when they move to a different team or department.
- **Security**: Remove access that is no longer required as part of the principle of least privilege.

### Identification
- **userId**: Numerical identifier of the user.
- **roleName**: The exact string identifier of the role (e.g., `ROLE_USER_MANAGER`).

### Getting User ID
- To find users and their numerical IDs, use the Users Management API:
  - `GET /public/v1/users` - Retrieve all users with their `id` field.
- The `id` field in the user response is the `{userId}` used in this endpoint's path parameter.

### Getting Role Names
- Discover valid role names via `GET /public/v1/users/roles/available`.

### Related Operations
- **Add Roles**: [POST /public/v1/users/{userId}/roles](#operations-Users_-_Roles-add)
- **List All Roles**: [GET /public/v1/users/{userId}/roles](#operations-Users_-_Roles-read)

### Required Permission
`manage_public_users`

## Path parameters

- `userId` integer, required
- `roleName` string, required

## Response `204`

No Content - Role successfully removed.

## Other responses

- `403` — 403 Forbidden - Authentication or authorization failure. This status code is returned when: (1) the request lacks valid authentication credentials (missing or invalid X-Auth-Token header), or (2) the authenticated user does not have the required permission to access this resource.
- `404` — Not Found - User or Role identifier not found.
- `429` — 429 Too Many Requests - API rate limit exceeded. The request has been rejected because the rate limit for this endpoint has been exceeded. Default rate limits: GET requests - 100 per 10 seconds, 500 per minute; POST/PUT/PATCH/DELETE requests - 20 per 10 seconds, 100 per minute. For increased access, please contact customer success.
- `500` — 500 Internal Server Error - An unexpected error occurred on the server. The request may or may not have been processed.

---

[API](https://skmtc.net/prewave/apis/public-prewave-api.md) · [All operations](https://skmtc.net/prewave/apis/public-prewave-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prewave/public-prewave-api/revisions/466169815b78/schema)
