Return the set of unique values for one document field across a collection, together with a per-value document count sorted desc. Thin wrapper over /aggregate for the common SELECT DISTINCT <field> case — use this when a UI needs a facet list (e.g. brand_slug) without loading every document. Null/missing values are excluded.
Documentation Index
Fetch the complete documentation index at: https://docs.mixpeek.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
REQUIRED: Bearer token authentication using your API key. Format: 'Bearer sk_xxxxxxxxxxxxx'. You can create API keys in the Mixpeek dashboard under Organization Settings.
"Bearer YOUR_API_KEY"
"Bearer YOUR_STRIPE_API_KEY"
Namespace identifier for scoping this request. All resources (collections, buckets, taxonomies, etc.) are scoped to a namespace. You can provide either the namespace name or namespace ID. Format: ns_xxxxxxxxxxxxx (ID) or a custom name like 'my-namespace'. Falls back to ?namespace= query parameter if the header is omitted.
"ns_abc123def456"
"production"
"my-namespace"
The unique identifier of the collection.
Field + optional filters/limit for the distinct query.
Document field whose distinct values should be returned. Dotted paths are supported (e.g. metadata.brand_slug). Null/missing values are excluded.
"brand_slug"
"metadata.category"
Optional pre-aggregation filters, same syntax as the standard aggregation endpoint. Applied before distinct values are computed.
Maximum number of distinct values to return (sorted by count desc). Defaults to no limit on the server side; for high-cardinality fields always set a limit to keep the response bounded.
1 <= x <= 10000Successful Response
Flat list of distinct values for a single field.
The field that was queried.
Distinct values sorted by descending count. Respects the limit argument; use the length of this list as the returned count.
Number of distinct values in the response (== len(values)). When limit is set this can be less than the true cardinality.