Find users with a query

  • POST also GET /_security/_query/user
Auth

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[]