OpenSearch/x-pack/docs/en/rest-api/security/delete-role-mappings.asciidoc

55 lines
1.4 KiB
Plaintext

[role="xpack"]
[[security-api-delete-role-mapping]]
=== Delete role mappings API
++++
<titleabbrev>Delete role mappings</titleabbrev>
++++
Removes role mappings.
[[security-api-delete-role-mapping-request]]
==== {api-request-title}
`DELETE /_security/role_mapping/<name>`
[[security-api-delete-role-mapping-prereqs]]
==== {api-prereq-title}
* To use this API, you must have at least the `manage_security` cluster privilege.
[[security-api-delete-role-mapping-desc]]
==== {api-description-title}
Role mappings define which roles are assigned to each user. For more information,
see <<mapping-roles>>.
[[security-api-delete-role-mapping-path-params]]
==== {api-path-parms-title}
`name`::
(string) The distinct name that identifies the role mapping. The name is
used solely as an identifier to facilitate interaction via the API; it does
not affect the behavior of the mapping in any way.
[[security-api-delete-role-mapping-example]]
==== {api-examples-title}
The following example delete a role mapping:
[source,console]
--------------------------------------------------
DELETE /_security/role_mapping/mapping1
--------------------------------------------------
// TEST[setup:role_mapping]
If the mapping is successfully deleted, the request returns `{"found": true}`.
Otherwise, `found` is set to false.
[source,console-result]
--------------------------------------------------
{
"found" : true
}
--------------------------------------------------