POST
/
v1
/
billable-metrics
/
create
Create a billable metric
curl --request POST \
  --url https://api.metronome.com/v1/billable-metrics/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "CPU Hours",
  "event_type_filter": {
    "in_values": [
      "cpu_usage"
    ]
  },
  "property_filters": [
    {
      "name": "cpu_hours",
      "exists": true
    },
    {
      "name": "region",
      "exists": true,
      "in_values": [
        "EU",
        "NA"
      ]
    },
    {
      "name": "machine_type",
      "exists": true,
      "in_values": [
        "slow",
        "fast"
      ]
    }
  ],
  "aggregation_type": "SUM",
  "aggregation_key": "cpu_hours",
  "group_keys": [
    [
      "region"
    ],
    [
      "machine_type"
    ]
  ]
}'
{
  "data": {
    "id": "58fb0650-e54a-4d17-93cb-ba8e56c32c65"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The details of the billable metric to create.

The body is of type object.

Response

200 - application/json

Success

The response is of type object.