Get user privileges

  • GET /_security/user/_privileges
Auth

Get the security privileges for the logged in user. All users can use this API, but only to determine their own privileges. To check the privileges of other users, you must use the run as feature. To check whether a user has a specific list of privileges, use the has privileges API.

Response

application/json
applications object[] required
application string required

The name of the application to which this entry applies.

privileges string[] required

A list of strings, where each element is the name of an application privilege or action.

resources string[] required

A list resources to which the privileges are applied.

cluster string[] required
remote_cluster object[]
clusters union oneOf required

A list of cluster aliases to which the permissions in this entry apply.

One of: string[] or string
privileges enum[] required

The cluster level privileges that owners of the role have on the remote cluster.

Values: monitor_enrich monitor_stats
global object[] required
application object
manage object

The applications for which application privileges can be managed. Absent when the application section is present but grants no privileges.

applications string[] required
profile object

A privilege that grants the ability to write the data and access sections of user profiles for the specified applications.

write object

The applications for which user profile data can be written. Absent when the profile section is present but grants no privileges.

applications string[] required
role object

A privilege that grants the ability to manage roles that are scoped to the specified indices.

manage object

The index-scoped role management privileges. Absent when the role section is present but grants no privileges.

indices object[] required
names string[] required

A list of indices (or index name patterns) that the owners of the role can manage roles for.

privileges string[] required

The index privileges that the managed roles are allowed to grant on the specified indices.

data_source object[]

A list of data source privilege entries, used to grant access to ES|QL data sources.

names string[] required

A list of data source names or wildcard patterns to which the permissions in this entry apply.

privileges union anyOf[] required

The data source privileges that owners of the role have for the specified data sources.

Supported values include:

  • create: Grants privilege to create a data source with a matching name.
  • delete: Grants privilege to delete a data source with a matching name.
  • read_metadata: Grants privilege to read a data source's metadata.
  • read: Grants privilege to attach a dataset to a data source with a matching name.
  • manage: Grants all data source privileges, including create, delete, read, and read_metadata.
Values: create delete read_metadata read manage
indices object[] required
field_security object[]

The document fields that the owners of the role have read access to.

except union oneOf
One of: string[] or string
grant union oneOf
One of: string[] or string
names union string | string[] required

A list of indices (or index name patterns) to which the permissions in this entry apply.

privileges union anyOf[] required

The index level privileges that owners of the role have on the specified indices.

Values: all auto_configure create create_doc create_index create_view cross_cluster_replication cross_cluster_replication_internal delete delete_index delete_view index
query union oneOf[]

Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role.

One of:
allow_restricted_indices boolean required

Set to true if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the names list, Elasticsearch checks privileges against these indices regardless of the value set for allow_restricted_indices.

remote_indices object[]
clusters string[] required
field_security object[]

The document fields that the owners of the role have read access to.

except union oneOf
One of: string[] or string
grant union oneOf
One of: string[] or string
names union string | string[] required

A list of indices (or index name patterns) to which the permissions in this entry apply.

privileges union anyOf[] required

The index level privileges that owners of the role have on the specified indices.

Values: all auto_configure create create_doc create_index create_view cross_cluster_replication cross_cluster_replication_internal delete delete_index delete_view index
query union oneOf[]

Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role.

One of:
allow_restricted_indices boolean required

Set to true if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the names list, Elasticsearch checks privileges against these indices regardless of the value set for allow_restricted_indices.

run_as string[] required