elasticsearch/docs/reference/rest-api/security/delete-roles.asciidoc
James Rodewig 255c9a7f95
[DOCS] Move x-pack docs to docs/reference dir (#99209)
**Problem:**
For historical reasons, source files for the Elasticsearch Guide's security, watcher, and Logstash API docs are housed in the `x-pack/docs` directory. This can confuse new contributors who expect Elasticsearch Guide docs to be located in `docs/reference`. 

**Solution:**
- Move the security, watcher, and Logstash API doc source files to the `docs/reference` directory
- Update doc snippet tests to use security

Rel: https://github.com/elastic/platform-docs-team/issues/208
2023-09-12 14:53:41 -04:00

54 lines
1.3 KiB
Text

[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 role management APIs are generally the preferred way to manage roles, rather than using
<<roles-management-file,file-based role management>>. The delete roles API cannot remove roles that are defined in roles files.
[[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,console]
--------------------------------------------------
DELETE /_security/role/my_admin_role
--------------------------------------------------
// TEST[setup:admin_role]
If the role is successfully deleted, the request returns `{"found": true}`.
Otherwise, `found` is set to false.
[source,console-result]
--------------------------------------------------
{
"found" : true
}
--------------------------------------------------