Type to search.

Find users with a query

  • POST also GET /_security/_query/user
Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 8.14 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Get information for users in a paginated manner. You can optionally filter the results with a query.

Note

As opposed to the get user API, built-in users are excluded from the result. This API is only for native users.

Required privileges

Cluster privileges read_security

Query parameters

with_profile_uid boolean · default: false

Determines whether to retrieve the user profile UID, if it exists, for the users.

Request body

from number · default: 0

The starting document offset. It must not be negative. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

size number · default: 10

The number of hits to return. It must not be negative. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

search_after union[]

The search after definition

Response

application/json
total number required

The total number of users found.

count number required

The number of users returned in the response.

users object[] required

A list of users that match the query.

email union string nullable
One of: string
full_name union string nullable
metadata object required
roles string[] required
username string required
enabled boolean required
profile_uid string
_sort union[]