---
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}`

## Request

- Base URL: `https://api.prewave.com`
- URL: `https://api.prewave.com/public/v1/users/{userId}/roles/{roleName}`
- Auth: API key in header `X-Auth-Token`
- TypeScript: <https://skmtc.dev/prewave/apis/public-prewave-api/docs/public/v1/users/:userId/roles/:roleName/delete.ts> (a function with typed inputs; its response is checked against the schema)

### 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.dev/prewave/apis/public-prewave-api.md) - [All operations](https://skmtc.dev/prewave/apis/public-prewave-api/llms.txt) - [OpenAPI document](https://skmtc.dev/prewave/apis/public-prewave-api/revisions/462a5e63fc9f?raw)
