# Update an aggregation rule

Update an aggregation rule

Endpoint: PUT /v1/aggregation-rules/{aggregation-rule-id}
Version: 1.0
Security: x-api-key

## Header parameters:

  - `Harness-Account` (string)
    Identifier field of the account the resource is scoped to.

## Path parameters:

  - `aggregation-rule-id` (string, required)
    Aggregation Rule Identifier

## Request fields (application/json):

  - `aggregation_rule` (object)

  - `aggregation_rule.identifier` (string, required)

  - `aggregation_rule.name` (string, required)

  - `aggregation_rule.description` (string)

  - `aggregation_rule.field_for_agg` (string, required)
    Field to aggregate

  - `aggregation_rule.agg_formula` (string, required)
    Enum: "SUM", "AVG", "COUNT", "MAX", "MIN", "MEDIAN"

  - `aggregation_rule.scopes_to_aggregate_at` (array, required)
    Enum: "ACCOUNT", "ORGANIZATION", "PROJECT", "SYSTEM", "TEAM"

  - `aggregation_rule.entity_selection_criteria` (object)

  - `aggregation_rule.entity_selection_criteria.scopes` (array)
    Scope identifiers of selected entities (e.g., org/project)

  - `aggregation_rule.entity_selection_criteria.kind` (string)

  - `aggregation_rule.entity_selection_criteria.type` (string)

  - `aggregation_rule.entity_selection_criteria.owners` (array)

  - `aggregation_rule.entity_selection_criteria.tags` (array)

  - `aggregation_rule.entity_selection_criteria.lifecycles` (array)

  - `aggregation_rule.last_computed_status` (string)
    Enum: "CALCULATING", "ERROR", "SUCCESS"

  - `aggregation_rule.last_computed_at` (integer)

  - `aggregation_rule.last_error_message` (string)

## Response 200 fields (application/json):

  - `status` (string, required)


