Update a draft metric definition
Auth: session ADMIN role, or ApiKeyAuth with scope metrics:write. Only draft metrics are mutable.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”projectId
required
string
metricId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
Draft-only update; all fields optional.
object
name
string
description
string
eventName
string
aggregation
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
key
additional properties
any
Metric_not_found
Media typeapplication/json
object
error
required
Human-readable error message.
string
message
string
Examplegenerated
{ "error": "example", "message": "example"}Active_version_immutable / archived_metric_immutable
Media typeapplication/json
object
error
string
detail
string
Examplegenerated
{ "error": "example", "detail": "example"}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": [ {} ]}Update_failed
Media typeapplication/json
object
error
required
Human-readable error message.
string
message
string
Examplegenerated
{ "error": "example", "message": "example"}