---
updatedAt: 2026-04-28T09:31:16.000Z
agentTools:
  projectIndex: https://docs.makaira.io/llms.txt
---

# Update aggregation

Update an aggregation by ID

Updates an existing filter aggregation.

Requires authentication.

## Request

**`PUT /aggregation/{id}`**

### Path Parameters

| Parameter | Type    | Required | Description                          |
| --------- | ------- | -------- | ------------------------------------ |
| `id`      | integer | Yes      | The ID of the aggregation to update. |

### Headers

| Header          | Value              |
| --------------- | ------------------ |
| `Authorization` | `Bearer <token>`   |
| `Content-Type`  | `application/json` |

### Request Body

Accepts the same fields as the create endpoint. See [Create aggregation](post-aggregation) for field descriptions.

## Response

Returns the updated aggregation object.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Makaira API",
    "version": "1.0",
    "contact": {
      "name": "Makaira GmbH",
      "url": "https://www.makaira.io/",
      "email": "support@makaira.io"
    },
    "description": "API of the powerful Makaira Search/Recommendation and Marketing Suite"
  },
  "servers": [
    {
      "url": "https://{yourinstance}.makaira.io"
    }
  ],
  "paths": {
    "/aggregation/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/parameters/instance"
        }
      ],
      "put": {
        "summary": "",
        "tags": [
          "Aggregations"
        ],
        "operationId": "put-aggregation-id",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "field": {
                    "type": "string"
                  },
                  "useAttributeTitle": {
                    "type": "boolean"
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "type": {
                    "type": "string"
                  },
                  "key": {
                    "type": "string"
                  },
                  "position": {
                    "type": "number"
                  },
                  "sorting": {
                    "type": "string"
                  },
                  "showCount": {
                    "type": "boolean"
                  },
                  "showActiveOnTop": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "description": "Update an aggregation by ID"
      }
    }
  },
  "components": {
    "parameters": {
      "instance": {
        "in": "header",
        "name": "X-Makaira-Instance",
        "required": true,
        "description": "Makaira Instance ID",
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authentication by JSON Web Token\n"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```