Find API keys with a query Added in 7.15.0
Get a paginated list of API keys and their information. You can optionally filter the results with a query.
Query parameters
-
with_limited_by boolean
Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors.
-
with_profile_uid boolean
Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists.
-
typed_keys boolean
Determines whether aggregation names are prefixed by their respective types in the response.
Body
-
aggregations object
Any aggregations to run over the corpus of returned API keys. Aggregations and queries work together. Aggregations are computed only on the API keys that match the query. This supports only a subset of aggregation types, namely:
terms
,range
,date_range
,missing
,cardinality
,value_count
,composite
,filter
, andfilters
. Additionally, aggregations only run over the same subset of fields that query works with. -
query object
Additional properties are allowed.
-
from number
Starting document offset. 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
The number of hits to return. By default, you cannot page through more than 10,000 hits using the
from
andsize
parameters. To page through more hits, use thesearch_after
parameter. -
search_after array[number | string | boolean | null | object]
A field value.
One of: Additional properties are allowed.
curl \
-X POST http://api.example.com/_security/_query/api_key \
-H "Content-Type: application/json" \
-d '{"aggregations":{},"query":{"match":{},"prefix":{},"range":{},"term":{},"wildcard":{}},"from":42.0,"":"string","size":42.0,"search_after":[42.0]}'