Remove a Role from a User
Remove a role from a user.
caution
This endpoint has been deprecated and will be phased out at the end of 2023. Please update any existing usages of it to use the Delete Warrant endpoint instead.
Endpoint
DELETE /v1/users/:userId/roles/:roleId
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
userId | The userId of the user you want to remove a role from. | URL param | yes |
roleId | The roleId of the role you want to remove from a user. | URL param | yes |
Request
- cURL
- Go
- Java
- Node.js
- Python
- Ruby
- PHP
- CLI
curl "https://api.warrant.dev/v1/users/s9djanc98gls/roles/admin" \
-X DELETE \
-H "Authorization: ApiKey YOUR_KEY"
wookie, err := role.RemoveRoleFromUser("admin", "s9djanc98gls")
if err != nil {
// handle error
}
try {
client.removeRoleFromUser("admin", "s9djanc98gls");
} catch (WarrantException e) {
// Handle error
}
// Class method
await warrantClient.Role.removeRoleFromUser("s9djanc98gls", "admin");
// Instance method
const user = await warrantClient.User.get("s9djanc98gls");
await user.removeRole("admin");
# Class method
warrant.Role.remove_from_user("s9djanc98gls", "admin")
# Instance method
user = warrant.User.get("s9djanc98gls")
user.remove_role("admin")
# Class method
Warrant::Role.remove_from_user("s9djanc98gls", "admin")
# Instance method
user = Warrant::User.get("s9djanc98gls")
user.remove_role("admin")
$warrant->removeRoleFromUser("s9djanc98gls", "admin");
warrant remove role:admin user:s9djanc98gls
Response
200 OK