delete-role-mappings.asciidoc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. [role="xpack"]
  2. [[security-api-delete-role-mapping]]
  3. === Delete role mappings API
  4. ++++
  5. <titleabbrev>Delete role mappings</titleabbrev>
  6. ++++
  7. .New API reference
  8. [sidebar]
  9. --
  10. For the most up-to-date API details, refer to {api-es}/group/endpoint-security[Security APIs].
  11. --
  12. Removes role mappings.
  13. [[security-api-delete-role-mapping-request]]
  14. ==== {api-request-title}
  15. `DELETE /_security/role_mapping/<name>`
  16. [[security-api-delete-role-mapping-prereqs]]
  17. ==== {api-prereq-title}
  18. * To use this API, you must have at least the `manage_security` cluster privilege.
  19. [[security-api-delete-role-mapping-desc]]
  20. ==== {api-description-title}
  21. Role mappings define which roles are assigned to each user. For more information,
  22. see <<mapping-roles>>.
  23. The role mapping APIs are generally the preferred way to manage role mappings
  24. rather than using <<mapping-roles-file,role mapping files>>.
  25. The delete role mappings API cannot remove role mappings that are defined
  26. in role mapping files.
  27. [[security-api-delete-role-mapping-path-params]]
  28. ==== {api-path-parms-title}
  29. `name`::
  30. (string) The distinct name that identifies the role mapping. The name is
  31. used solely as an identifier to facilitate interaction via the API; it does
  32. not affect the behavior of the mapping in any way.
  33. [[security-api-delete-role-mapping-example]]
  34. ==== {api-examples-title}
  35. The following example delete a role mapping:
  36. [source,console]
  37. --------------------------------------------------
  38. DELETE /_security/role_mapping/mapping1
  39. --------------------------------------------------
  40. // TEST[setup:role_mapping]
  41. If the mapping is successfully deleted, the request returns `{"found": true}`.
  42. Otherwise, `found` is set to false.
  43. [source,console-result]
  44. --------------------------------------------------
  45. {
  46. "found" : true
  47. }
  48. --------------------------------------------------