Skip to main content
POST
/
v1
/
meters
curl --request POST \
  --url https://api.monk.com/v1/meters \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "API_CALLS",
  "displayName": "API Calls",
  "aggregationType": "COUNT",
  "eventTypeFilter": {
    "include": [
      "api_call"
    ]
  }
}
'
{
  "data": {
    "id": "<string>",
    "code": "<string>",
    "displayName": "<string>",
    "description": "<string>",
    "aggregationType": "SUM",
    "status": "active",
    "eventTypeFilter": {
      "include": [
        "<string>"
      ],
      "exclude": [
        "<string>"
      ]
    },
    "propertyFilters": [
      {}
    ],
    "aggregationKey": "<string>",
    "groupKeys": [
      "<string>"
    ],
    "sql": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}
Scope: meters:write

Authorizations

Authorization
string
header
required

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

Body

application/json
code
string
required

Unique code (uppercase, letters, numbers, underscores)

displayName
string
required
description
string
aggregationType
enum<string>
default:SUM
Available options:
SUM,
COUNT,
MAX,
MIN
eventTypeFilter
object
propertyFilters
object[]
aggregationKey
string

Property key to aggregate. Required for SUM, MAX, MIN.

groupKeys
string[]

Event property keys to GROUP BY for dimensional billing. Produces one aggregated row per unique combination of these property values. Used with rate cards to determine per-dimension pricing.

sql
string

Custom ClickHouse SQL. Overrides structured fields.

Response

Meter created

data
object