> ## 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:
        - 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:
                allOf:
                  - $ref: '#/components/schemas/Aggregator'
                  - type: object
        '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.
              threshold_value:
                type: number
                description: The threshold value.
              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.
        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
        - 'null'
      properties:
        id:
          type: string
        entity:
          type: string
        operation:
          type: string
          enum:
            - count
            - sum
        property:
          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
        threshold_value:
          type: number
        comparison_operator:
          type: string
          enum:
            - gte
            - lte
      required:
        - id
        - name
        - threshold_value
        - comparison_operator
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````