---
title: "Remove role from admin user or API Key"
method: DELETE
path: "/api/license-manager/users/{userId}/roles/{roleId}"
tags: ["Roles"]
---

# Remove role from admin user or API Key

`DELETE /api/license-manager/users/{userId}/roles/{roleId}`

Allows you to remove a License Manager [role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc) from a specific admin user or API key. This method only allows the removal of one role per request. The role's ID must be specified on the request path, not on the request body.

> Note that a successful response returns a `204` response with an empty body. A deletion on a role or user that does not exist will also return a `204`. Thus, this method should not be used to verify the existence of a specific user or role. 

## Permissions

Any user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:

| **Product** | **Category** | **Resource** |
| --------------- | ----------------- | ----------------- |
| License Manager | Services access control | **Save user** |

You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy):

| **Role** | **Resource** | 
| --------------- | ----------------- | 
| User Administrator - RESTRICTED | Save user |

>❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm).

To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).

## Path parameters

- `userId` string, required
- `roleId` string, required

## Headers

- `Content-Type` string, required
- `Accept` string, required

## Response `204`

Success - A no-content response, but the role deletion was performed successfully.

## Other responses

- `400` — Bad Request - A userId or role list with invalid format. The message on the body of the response will contain further information.
- `405` — Method Not Allowed

## Changes

- **2023-10-11** `fcf61fb140f2` — 1 breaking
  - added the new required `header` request parameter `Accept`
- **2022-01-28** `ca8bd421f133` — 2 warning
  - deleted the `path` request parameter `accountName`
  - deleted the `path` request parameter `environment`
- **2021-11-09** `7a2ee1e98a24` — 1 breaking, 1 warning, 3 info
  - removed the success response with the status `200`
  - deleted the `path` request parameter `environment`
  - added the non-success response with the status `400`
  - added the non-success response with the status `405`
  - …1 more
- **2021-11-01** `2a274b318992` — 1 breaking, 1 warning
  - added the new path request parameter `environment`
  - deleted the `path` request parameter `environment`
- **2021-10-28** `e1d08a8a5e44` — 1 breaking, 1 warning
  - added the new path request parameter `environment`
  - deleted the `path` request parameter `environment`

[Full history](https://skmtc.dev/vtex/apis/license-manager-api/changes/api/license-manager/users/:userId/roles/:roleId/delete.md)

---

[API](https://skmtc.dev/vtex/apis/license-manager-api.md) · [All operations](https://skmtc.dev/vtex/apis/license-manager-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/vtex/license-manager-api/revisions/a7dd68911d51/schema)
