Create aggregation

Create a new aggregation

Creates a new filter aggregation (facet).

Requires authentication.

Request

POST /aggregation

Headers

HeaderValue
AuthorizationBearer <token>
Content-Typeapplication/json

Request Body

FieldTypeRequiredDescription
titlestringYesDisplay title shown in the filter UI.
fieldstringYesThe document field to aggregate (e.g. color, size, price).
keystringYesMachine-readable key used in search requests.
typestringYesAggregation type (e.g. terms, range).
activebooleanNoWhether this aggregation is active. Defaults to true.
positionnumberNoDisplay order position.
sortingstringNoSort order for aggregation values.
showCountbooleanNoShow document count next to each value.
showActiveOnTopbooleanNoShow active/selected values at the top.
useAttributeTitlebooleanNoUse the attribute's own title instead of the configured title.

Example Request

{
  "title": "Color",
  "field": "attributeStr.color.value",
  "key": "color",
  "type": "terms",
  "active": true,
  "position": 1,
  "showCount": true,
  "showActiveOnTop": true
}

Response

Returns the created aggregation object.

Body Params
string
string
boolean
boolean
string
string
number
string
boolean
boolean
Headers
string
required

Makaira Instance ID

Response
200

OK

Language
Credentials
Bearer
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here!