12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- [role="xpack"]
- [[security-api-delete-role]]
- === Delete roles API
- ++++
- <titleabbrev>Delete roles</titleabbrev>
- ++++
- Removes roles in the native realm.
- [[security-api-delete-role-request]]
- ==== {api-request-title}
- `DELETE /_security/role/<name>`
- [[security-api-delete-role-prereqs]]
- ==== {api-prereq-title}
- * To use this API, you must have at least the `manage_security` cluster privilege.
- [[security-api-delete-role-desc]]
- ==== {api-description-title}
- The Roles API is generally the preferred way to manage roles, rather than using
- file-based role management. For more information about the native realm, see
- {stack-ov}/realms.html[Realms] and <<configuring-native-realm>>.
- [[security-api-delete-role-path-params]]
- ==== {api-path-parms-title}
- `name`::
- (string) The name of the role.
- [[security-api-delete-role-example]]
- ==== {api-examples-title}
- The following example deletes a `my_admin_role` role:
- [source,js]
- --------------------------------------------------
- DELETE /_security/role/my_admin_role
- --------------------------------------------------
- // CONSOLE
- // TEST[setup:admin_role]
- If the role is successfully deleted, the request returns `{"found": true}`.
- Otherwise, `found` is set to false.
- [source,js]
- --------------------------------------------------
- {
- "found" : true
- }
- --------------------------------------------------
- // TESTRESPONSE
|