post
https://{yourinstance}.makaira.io/aggregation
Create a new aggregation
Creates a new filter aggregation (facet).
Requires authentication.
Request
POST /aggregation
Headers
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Content-Type | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Display title shown in the filter UI. |
field | string | Yes | The document field to aggregate (e.g. color, size, price). |
key | string | Yes | Machine-readable key used in search requests. |
type | string | Yes | Aggregation type (e.g. terms, range). |
active | boolean | No | Whether this aggregation is active. Defaults to true. |
position | number | No | Display order position. |
sorting | string | No | Sort order for aggregation values. |
showCount | boolean | No | Show document count next to each value. |
showActiveOnTop | boolean | No | Show active/selected values at the top. |
useAttributeTitle | boolean | No | Use 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.
200OK

