Check user profile privileges

  • POST also GET /_security/profile/_has_privileges
Auth

Determine whether the users associated with the specified user profile IDs have all the requested privileges.

Note

The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions. Individual users and external applications should not call this API directly. Elastic reserves the right to change or remove this feature in future releases without prior notice.

Read the reference documentation

Required authorization

Cluster privileges read_security

Request body

uids string[] required

A list of profile IDs. The privileges are checked for associated users of the profiles.

privileges object required

An object containing all the privileges to be checked.

application object[]
application string required

The name of the application.

privileges string[] required

A list of the privileges that you want to check for the specified resources. It may be either application privilege names or the names of actions that are granted by those privileges

resources string[] required

A list of resource names against which the privileges should be checked.

cluster union anyOf[]

A list of the cluster privileges that you want to check.

Values: all cancel_task create_snapshot cross_cluster_replication cross_cluster_search delegate_pki grant_api_key manage manage_api_key manage_autoscaling manage_behavioral_analytics manage_ccr
index object[]
names union oneOf required

A list of indices.

One of: string[] or string
privileges union anyOf[] required

A list of the privileges that you want to check for the specified indices.

Values: all auto_configure create create_doc create_index cross_cluster_replication cross_cluster_replication_internal delete delete_index index maintenance manage
allow_restricted_indices boolean

This needs to be set to true (default is false) if using wildcards or regexps for patterns that cover restricted indices. Implicitly, restricted indices do not match index patterns because restricted indices usually have limited privileges and including them in pattern tests would render most such tests false. If restricted indices are explicitly included in the names list, privileges will be checked against them regardless of the value of allow_restricted_indices.

Response

application/json
has_privilege_uids string[] required

The subset of the requested profile IDs of the users that have all the requested privileges.

errors object

The subset of the requested profile IDs for which an error was encountered. It does not include the missing profile IDs or the profile IDs of the users that do not have all the requested privileges. This field is absent if empty.

count number required
details map string to object required
<string> object
type string required

The type of error

reason union string nullable

A human-readable explanation of the error, in English.

One of: string
stack_trace string

The server stack trace. Present only if the error_trace=true parameter was sent with the request.

caused_by object
root_cause object[]
suppressed object[]