delete-roles.asciidoc 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. [role="xpack"]
  2. [[security-api-delete-role]]
  3. === Delete roles API
  4. ++++
  5. <titleabbrev>Delete roles</titleabbrev>
  6. ++++
  7. Removes roles in the native realm.
  8. [[security-api-delete-role-request]]
  9. ==== {api-request-title}
  10. `DELETE /_security/role/<name>`
  11. [[security-api-delete-role-prereqs]]
  12. ==== {api-prereq-title}
  13. * To use this API, you must have at least the `manage_security` cluster privilege.
  14. [[security-api-delete-role-desc]]
  15. ==== {api-description-title}
  16. The Roles API is generally the preferred way to manage roles, rather than using
  17. file-based role management. For more information about the native realm, see
  18. {stack-ov}/realms.html[Realms] and <<configuring-native-realm>>.
  19. [[security-api-delete-role-path-params]]
  20. ==== {api-path-parms-title}
  21. `name`::
  22. (string) The name of the role.
  23. [[security-api-delete-role-example]]
  24. ==== {api-examples-title}
  25. The following example deletes a `my_admin_role` role:
  26. [source,js]
  27. --------------------------------------------------
  28. DELETE /_security/role/my_admin_role
  29. --------------------------------------------------
  30. // CONSOLE
  31. // TEST[setup:admin_role]
  32. If the role is successfully deleted, the request returns `{"found": true}`.
  33. Otherwise, `found` is set to false.
  34. [source,js]
  35. --------------------------------------------------
  36. {
  37. "found" : true
  38. }
  39. --------------------------------------------------
  40. // TESTRESPONSE