Get Role Mappings API
Introduced 1.0
Retrieves role mappings. Specify a role name to retrieve the mapping for one role, or omit the role name to retrieve all role mappings.
Endpoints
GET /_plugins/_security/api/rolesmapping
GET /_plugins/_security/api/rolesmapping/{role}
Path parameters
The following table lists the available path parameters.
| Parameter | Data type | Required | Description |
|---|---|---|---|
role | String | No | The name of the role whose mapping you want to retrieve. If omitted, all role mappings are returned. |
Example request
The following request retrieves all role mappings:
GET _plugins/_security/api/rolesmapping
The following request retrieves the mapping for the role_starfleet role:
GET _plugins/_security/api/rolesmapping/role_starfleet
Example response
The response is abbreviated here:
{
"manage_snapshots": {
"and_backend_roles": [],
"backend_roles": [
"snapshotrestore"
],
"hidden": false,
"hosts": [],
"reserved": false,
"users": []
},
"logstash": {
"and_backend_roles": [],
"backend_roles": [
"logstash"
],
"hidden": false,
"hosts": [],
"reserved": false,
"users": []
},
"kibana_user": {
"and_backend_roles": [],
"backend_roles": [
"kibanauser"
],
"description": "Maps kibanauser to kibana_user",
"hidden": false,
"hosts": [],
"reserved": false,
"users": []
},
...
}
The response to a request for one role mapping contains only that mapping:
{
"role_starfleet": {
"and_backend_roles": [],
"backend_roles": [
"starfleet",
"captains",
"defectors",
"cn=ldaprole,ou=groups,dc=example,dc=com"
],
"hidden": false,
"hosts": [
"*.starfleetintranet.com"
],
"reserved": false,
"users": [
"worf"
]
}
}