Get roles
- GET /_security/role/{name}
- GET /_security/role
Get roles in the native realm. The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The get roles API cannot retrieve roles that are defined in roles files.
Required authorization
- Cluster privileges read_security
Response
-
<string>object -
clusteranyOfrequired -
Values:
allcancel_taskmanagemanage_api_keymanage_behavioral_analyticsmanage_enrichmanage_esqlmanage_index_templatesmanage_inferencemanage_ingest_pipelinesmanage_logstash_pipelinesmanage_mlmanage_own_api_keymanage_pipelinemanage_reindexmanage_search_applicationmanage_search_query_rulesmanage_search_synonymsmanage_securitymanage_transformmonitormonitor_enrichmonitor_esqlmonitor_inferencemonitor_mlmonitor_reindexmonitor_transformnonepost_behavioral_analytics_eventread_pipelineread_securityread_project_routingmanage_project_routing -
indicesobjectrequired -
implicitly_grantedboolean -
Set to
trueon entries that were contributed by a registeredImplicitPrivilegesProviderrather than explicitly stored on the role. Only present when the get role API is called withinclude_implicit=true. The put role API rejects this field, so clients must not echo it back on a GET-then-PUT round-trip. -
field_securityobject -
The document fields that the owners of the role have read access to.
- Reference
-
namesstring | stringrequired -
A list of indices (or index name patterns) to which the permissions in this entry apply.
-
privilegesanyOfrequired -
The index level privileges that owners of the role have on the specified indices.
-
Values:
allauto_configurecreatecreate_doccreate_indexcreate_viewdeletedelete_indexdelete_viewindexmaintenancemanagemanage_data_stream_lifecyclemanage_viewmonitornonereadread_view_metadataview_index_metadatawrite