> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperline.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Update aggregator

> Update the details of an existing aggregator.



## OpenAPI

````yaml put /v1/aggregators/{id}
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v1/aggregators/{id}:
    put:
      tags:
        - Usage > Aggregators
      summary: Update aggregator
      description: Update the details of an existing aggregator.
      operationId: updateAggregator
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAggregator'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Aggregator'
        '404':
          description: Aggregator not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
      security:
        - bearer: []
components:
  schemas:
    UpdateAggregator:
      type: object
      properties:
        entity:
          type: string
          description: The billable event entity to aggregate.
          example: api_calls
        type:
          type: string
          enum:
            - metered
            - licensed
          default: metered
          description: The type of aggregator.
        where:
          type:
            - object
            - 'null'
          properties:
            conditional:
              type: string
              enum:
                - and
                - or
            fields:
              type: array
              items:
                allOf:
                  - type: object
                    properties:
                      property:
                        type: string
                    required:
                      - property
                  - oneOf:
                      - type: object
                        properties:
                          operator:
                            type: string
                            enum:
                              - isNull
                              - isNotNull
                        required:
                          - operator
                      - type: object
                        properties:
                          operator:
                            type: string
                            enum:
                              - in
                              - notIn
                          value:
                            type: string
                        required:
                          - operator
                          - value
                      - type: object
                        properties:
                          operator:
                            type: string
                            enum:
                              - gte
                              - gt
                              - lt
                              - lte
                          value:
                            type: number
                        required:
                          - operator
                          - value
                      - type: object
                        properties:
                          operator:
                            type: string
                            enum:
                              - equals
                              - notEqual
                          value:
                            anyOf:
                              - type: string
                              - type: number
                              - type: boolean
                        required:
                          - operator
                          - value
          required:
            - conditional
            - fields
          description: Filter conditions for the aggregation.
        name:
          type: string
          description: Name of the aggregator.
        description:
          type:
            - string
            - 'null'
          description: Description of the aggregator.
        allow_negative_values:
          type: boolean
          default: false
          description: Whether the aggregator can produce negative values.
        aggregate_on_customers_enabled:
          type: boolean
          default: false
          description: Whether the aggregator should aggregate on customers.
        custom_event_name:
          type: string
          description: Custom event name for the aggregator.
        exposed_event_keys:
          type: array
          items:
            type: string
          description: Event keys exposed by the aggregator.
        unit_name:
          type:
            - string
            - 'null'
          description: >-
            Display name of the unit being measured (e.g. 'user', 'request').
            Used as fallback for products attached to this aggregator.
          example: user
        default_interval_count:
          type: integer
          description: Default interval count for usage periods.
        default_interval_period:
          type: string
          enum:
            - days
            - weeks
            - months
            - years
          description: Default interval period for usage periods.
        thresholds:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Threshold ID. Required when updating an existing threshold.
              name:
                type: string
                description: Name of the threshold.
              type:
                type: string
                enum:
                  - fixed
                  - committed_count
                  - top_tier
                  - current_tier
                description: >-
                  Threshold type, cannot be changed once created. Defaults to
                  `fixed`.

                  - `fixed`: `threshold_value` is an absolute usage value.

                  - `committed_count`: `threshold_value` is a percentage (e.g.
                  `180` for 180%) of the committed count of each customer
                  subscription using this aggregator, checked per subscription
                  on current-period usage. Must be above 0; only `gte` is
                  supported. Subscriptions without a committed count are
                  skipped.

                  - `top_tier`: `threshold_value` is a percentage (e.g. `80` for
                  80%) of the upper bound of the last bounded tier (where the
                  open-ended top tier starts, if any) of each customer
                  subscription's volume or bulk price, using the tiers of the
                  usage's aggregator filter. Checked per subscription on
                  current-period usage. Must be above 0; only `gte` is
                  supported. Subscriptions without a volume or bulk price are
                  skipped.

                  - `current_tier`: `threshold_value` is a percentage (e.g. `80`
                  for 80%) of the upper bound of the tier the usage currently
                  falls in (where the next tier starts) on each customer
                  subscription's volume or bulk price, using the tiers of the
                  usage's aggregator filter. Fires once per tier as usage
                  climbs, and never while usage is in the top tier. Checked per
                  subscription on current-period usage. Must be above 0; only
                  `gte` is supported. Subscriptions without a volume or bulk
                  price are skipped.
              threshold_value:
                type: number
                description: >-
                  The threshold value: an absolute usage value for `fixed`, a
                  percentage for `committed_count`, `top_tier` and
                  `current_tier`.
              comparison_operator:
                type: string
                enum:
                  - gte
                  - lte
                default: gte
                description: The comparison operator for the threshold.
            required:
              - threshold_value
          description: Thresholds for the aggregator. Replaces existing thresholds.
        formula_sql:
          type: string
          description: Read-only formula expression; not accepted on public writes.
          deprecated: true
        operation:
          type: string
          enum:
            - count
            - sum
          description: The aggregation operation to perform.
        property:
          type: string
          description: The property to sum. Required when operation is 'sum'.
    Aggregator:
      type: object
      properties:
        id:
          type: string
        entity:
          type: string
        operation:
          type: string
          enum:
            - count
            - sum
            - sql_formula
        property:
          type:
            - string
            - 'null'
        formula_sql:
          type:
            - string
            - 'null'
        where:
          type:
            - object
            - 'null'
          properties:
            conditional:
              type: string
              enum:
                - and
                - or
            fields:
              type: array
              items:
                allOf:
                  - type: object
                    properties:
                      property:
                        type: string
                    required:
                      - property
                  - oneOf:
                      - type: object
                        properties:
                          operator:
                            type: string
                            enum:
                              - isNull
                              - isNotNull
                        required:
                          - operator
                      - type: object
                        properties:
                          operator:
                            type: string
                            enum:
                              - in
                              - notIn
                          value:
                            type: string
                        required:
                          - operator
                          - value
                      - type: object
                        properties:
                          operator:
                            type: string
                            enum:
                              - gte
                              - gt
                              - lt
                              - lte
                          value:
                            type: number
                        required:
                          - operator
                          - value
                      - type: object
                        properties:
                          operator:
                            type: string
                            enum:
                              - equals
                              - notEqual
                          value:
                            anyOf:
                              - type: string
                              - type: number
                              - type: boolean
                        required:
                          - operator
                          - value
          required:
            - conditional
            - fields
        type:
          type: string
          enum:
            - metered
            - licensed
        name:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        allow_negative_values:
          type: boolean
        aggregate_on_customers_enabled:
          type: boolean
        default_interval_count:
          type:
            - integer
            - 'null'
        default_interval_period:
          type:
            - string
            - 'null'
          enum:
            - days
            - weeks
            - months
            - years
        custom_event_name:
          type:
            - string
            - 'null'
        exposed_event_keys:
          type: array
          items:
            type: string
        unit_name:
          type:
            - string
            - 'null'
        thresholds:
          type: array
          items:
            $ref: '#/components/schemas/AggregatorThreshold'
        created_at:
          type: string
          format: date
        updated_at:
          type: string
          format: date
      required:
        - id
        - entity
        - operation
        - property
        - where
        - type
        - name
        - description
        - allow_negative_values
        - aggregate_on_customers_enabled
        - default_interval_count
        - default_interval_period
        - custom_event_name
        - exposed_event_keys
        - unit_name
        - thresholds
        - created_at
        - updated_at
    AggregatorThreshold:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          type: string
          enum:
            - fixed
            - committed_count
            - top_tier
            - current_tier
          description: >-
            Threshold type. `fixed`: the threshold value is an absolute usage
            value. `committed_count`, `top_tier` and `current_tier`: the
            threshold value is a percentage of the subscription's committed
            count, top tier or current tier.
        threshold_value:
          type: number
        comparison_operator:
          type: string
          enum:
            - gte
            - lte
      required:
        - id
        - name
        - type
        - threshold_value
        - comparison_operator
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.