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

# aggregatedEventsByCustomer

> Get aggregated events by customer



**query** `aggregatedEventsByCustomer(input: AggregatedEventsByCustomerInput!): AggregatedEventsByCustomer!`

## Arguments

**`input`**: `AggregatedEventsByCustomerInput!` (required)

Input parameters for aggregating events by customer

## Returns

`AggregatedEventsByCustomer!`

**`aggregatedUsage`**: `[CustomerAggregatedUsage!]!`

Aggregated usage data for the customer

## Examples

```graphql Query
query AggregatedEventsByCustomer($input: AggregatedEventsByCustomerInput!) {
  aggregatedEventsByCustomer(input: $input) {
    aggregatedUsage {
      customerId
      usage
    }
  }
}
```

```json Variables
{
  "input": {
    "aggregation": {
      "function": "AVG"
    },
    "environmentId": "value",
    "filters": [
      {
        "conditions": [
          {
            "field": "string",
            "operation": "CONTAINS"
          }
        ]
      }
    ]
  }
}
```

```json Response
{
  "data": {
    "aggregatedEventsByCustomer": {
      "aggregatedUsage": [
        {
          "customerId": "string",
          "usage": 1.5
        }
      ]
    }
  }
}
```


## Related topics

- [AggregatedEventsByCustomer](https://docs.stigg.io/graphql-reference/types/AggregatedEventsByCustomer.md)
- [AggregatedEventsByCustomerInput](https://docs.stigg.io/graphql-reference/types/AggregatedEventsByCustomerInput.md)
- [CustomerAggregatedUsage](https://docs.stigg.io/graphql-reference/types/CustomerAggregatedUsage.md)
- [Metering architecture](https://docs.stigg.io/documentation/high-availability-and-scale/byoc/metering-architecture.md)
- [Networking, security, and data flow](https://docs.stigg.io/documentation/high-availability-and-scale/byoc/networking-and-security.md)


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