Get role mappings

  • GET /_security/role_mapping/{name}
  • GET /_security/role_mapping
Auth

Role mappings define which roles are assigned to each user. The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. The get role mappings API cannot retrieve role mappings that are defined in role mapping files.

About mapping users to roles

Required authorization

Cluster privileges manage_security

Path parameters

name union string | string[] optional

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. You can specify multiple mapping names as a comma-separated list. If you do not specify this parameter, the API returns information about all role mappings.

Leave it out to use /_security/role_mapping.

Response

application/json
<string> object
enabled boolean required
metadata object required
roles string[]
role_templates object[]
format enum
Values: string json
template string required
rules object required
any object[]
Same fields as rules in <string>
all object[]
Same fields as rules in <string>
field map string to oneOf · min properties: 1 · max properties: 1
except object
Same fields as rules in <string>