# IAM.ROLE.DELETE

> Delete a role. Logins that had it lose what it gave at once.

URL: https://docs.hotkv.com/commands/iam-role-delete/

```
IAM.ROLE.DELETE name
```

- Group: IAM
- Complexity: O(N) where N is the number of open sessions
- HotKV Cloud: not available
- On-Premise: requires the enterprise-iam license feature

`IAM.ROLE.DELETE` removes a role. The sessions that had it lose what it gave on
their next command, on every node of a cluster. A session that had no other role
can then run nothing, until it logs in again (and a login with no role is
refused). Who was given the role stays on record, so a role created later with
the same name is theirs again; see [IAM.USER.UNASSIGN](https://docs.hotkv.com/commands/iam-user-unassign/index.md).

The built-in roles `admin` and `readonly` can be deleted like any other.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| The role was deleted | Integer `1` | Integer `1` |
| There is no such role | Integer `0` | Integer `0` |

Without a license that includes `enterprise-iam` the reply is the error
`NOLICENSE enterprise-iam requires a HotKV license. Contact sales@hotkv.com`.

## Examples

```
127.0.0.1:6379> IAM.ROLE.DELETE reporting
(integer) 1
127.0.0.1:6379> IAM.ROLE.DELETE reporting
(integer) 0
```

## Compatibility

HotKV-only command.

## See also

[IAM.ROLE.CREATE](https://docs.hotkv.com/commands/iam-role-create/index.md), [IAM.ROLE.LIST](https://docs.hotkv.com/commands/iam-role-list/index.md),
[Roles and single sign-on](https://docs.hotkv.com/operate/iam/index.md)