Skip to main content

Field Values

List distinct values for a field across documents with counts. Useful for building filter dropdowns and faceted search interfaces.

GET/fields/:fieldId/values

Response

Response fields

valuesarrayArray of distinct value objects sorted by count descending.
values[].valuestringThe distinct field value.
values[].countintegerNumber of documents containing this value.
totalDistinctintegerTotal number of distinct values for this field (before limit is applied).

Response

{
  "values": [
    { "value": "Acme Corp", "count": 47 },
    { "value": "Globex Inc", "count": 23 }
  ],
  "totalDistinct": 156
}

Errors

Error responses

401unauthorizedMissing or invalid API key.
404not_foundNo field with the given fieldId exists for your workspace.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.