Allows you to create a billable metric out of the raw ingested events.
Request
{
"name": "Amex Consumer",
"description": "No. of Amex Consumer Cards",
"eventName": "transactions",
"filterGroups": [
{
"operator": "and",
"filters": [
{
"field": "card_scheme",
"operator": "equal",
"value": "amex"
},
{
"field": "card_offering",
"operator": "equal",
"value": "consumer"
}
]
}
],
"aggregation": {
"method": "sum",
"field": "txn_value"
}
}
The name of the billable metric. This should be clear and concise to represent the usage you are tracking.
A detailed explanation of what the metric measures, such as the number of specific customer transactions.
The name of the event that triggers the metric. This event represents a customer action or transaction.
An array of filter groups used to refine which events contribute to the metric. Filters allow you to narrow down events based on specific properties.
The logical operator for the group (e.g., “and”, “or”) that combines the filters.
An array of individual filters within the group.
The event property to filter by.
The condition to apply (e.g., “equal”, “contains”).
The value that the event property must match.
The aggregation settings for the metric. This defines how event data is calculated to produce the final metric value.
The aggregation method to apply (e.g., “count”, “sum”, “average”, “min”, “max”).
The event property to aggregate. This is used when the aggregation method requires a numeric field.
Response
The unique identifier for the metric.
A brief description of what the metric measures.
The event that triggers the metric.
An array of filter groups applied to the metric to narrow down the events counted.
The logical operator (e.g., “and”) used to combine the filters within the group.
An array of individual filters within the group.
The event property to filter by.
The condition to apply (e.g., “equal”).
The value that the event property must match.
The aggregation settings that define how the events are calculated to produce the metric value.
The aggregation method to apply (e.g., “sum”).
The event property that is aggregated.
The timestamp when the metric was created.
The timestamp when the metric was last updated.
The unique identifier for the organization associated with the metric.
{
"id": "mtr_02zBU3PJ3hJurtFSxDD3Ol",
"description": "No. of Amex Consumer Cards",
"name": "Amex Consumer",
"eventName": "transactions",
"filters": [
{
"operator": "and",
"filters": [
{
"field": "card_scheme",
"operator": "equal",
"value": "amex"
},
{
"field": "card_offering",
"operator": "equal",
"value": "consumer"
}
]
}
],
"aggregation": {
"method": "sum",
"field": "txn_value"
},
"createdAt": "2025-02-24T12:09:05.350876Z",
"updatedAt": "2025-02-24T12:09:05.350877Z",
"organizationID": "8641473c-2d34-46c6-b712-c893934fc8fb"
}