Create a metric definition (draft)
Auth: session ADMIN role, or ApiKeyAuth with scope metrics:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”projectId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
description
string
eventName
required
string
aggregation
required
Metric aggregation DSL. aggregator is one of METRIC_AGGREGATORS (count/sum/max/unique/…); non-count aggregators require fieldPath. fieldPaths are allowlist-validated.
object
aggregator
required
string
fieldPath
string
filter
object
conditions
required
Array<object>
object
field
required
string
op
required
One of FILTER_OPS.
string
value
required
groupBy
object
keys
required
Array<string>
window
object
type
required
string
days
integer
Responses
Section titled “Responses”{ metric }
Media typeapplication/json
object
metric
object
key
additional properties
any
Validation failed
Media typeapplication/json
Validation error envelope (Zod). issues/details present on schema failures.
object
error
required
string
issues
Array<object>
object
key
additional properties
any
details
Array<object>
object
key
additional properties
any
Examplegenerated
{ "error": "example", "issues": [ {} ], "details": [ {} ]}