Update a metric
https://statsigapi.net/console/v1/metrics/{id}Authorizations
STATSIG-API-KEYstringrequiredapiKey (header)
Path parameters
idstringrequiredid
Body
application/jsonnamestringThe name of the metric, serving as its primary identifier.
descriptionstringA detailed description of the metric, providing insights into its purpose and application.
tagsstring[]An array of tags associated with the metric, used for categorization and easier retrieval.
isVerifiedbooleanFlag to mark the metric as verified, ensuring it is deemed trustworthy within the organization.
isReadOnlybooleanSpecifies if the metric definition can only be edited via the Console API, enhancing control over modifications.
isPermanentbooleanDetermines if the metric is permanent, preventing it from being deleted or modified inadvertently.
warehouseNativeobjectOptional configuration for metrics utilizing Warehouse Native features, defining specific behaviors and criteria.
Show child attributes
aggregationstringAllowed: count┃sum┃mean┃daily_participation┃ratio┃funnel┃count_distinct┃percentile
metricSourceNamestringDeprecated: use metricSources instead. If provided, this will overwrite all metric sources. For Count, Sum, Mean, User Count aggregation types: the name of metric source
criteriaobject[]Deprecated: use metricSources instead. If provided with metricSourceName, this will overwrite all metric sources. Filtering criteria for the metric source
type[]stringrequiredType of event criterion for filtering metrics. Options include value, metadata, user, and user_custom; in Warehouse Native, this should always be metadata.
column[]stringOptional column specifying which data attribute to filter on.
condition[]stringrequiredsql_filter, start_withs, ends_with, after_exposure, and before_exposure are only applicable in Warehouse Native
values[]string[]Optional array of values for the criterion to match against.
nullVacuousOverride[]booleanIf true, overrides null values in criterion evaluation.
metricSourcesobject[]List of metric sources for this metric.
metricSourceName[]stringrequiredcriteria[]unknown[]requiredFiltering criteria for the metric source
valueColumn[]stringwaitForCohortWindowbooleandenominatorCriteriaunknown[]Filtering criteria for the denominator metric source for a ratio, or the start event for a retention metric if useSecondaryRetentionEvent is set
denominatorAggregationstringAllowed: count┃sum┃mean┃daily_participation┃ratio┃funnel┃count_distinct┃percentile
denominatorCustomRollupEndnumberCustom end window for ratio denominator unit count metrics with "custom" rollup time window. Measured in days or minutes depending on the "denominatorCustomRollupMeasureInMinutes" flag.
denominatorCustomRollupStartnumberCustom start window for ratio denominator unit count metrics with "custom" rollup time window. Measured in days or minutes depending on the "denominatorCustomRollupMeasureInMinutes" flag.
denominatorMetricSourceNamestringName of the metric source for the denominator of a ratio, or the start event for a retention metric if useSecondaryRetentionEvent is set
denominatorRollupTimeWindowstringRollup-mode for ratio denominator unit count metrics. Allowed values: "daily" for daily participation rate, "max" for one-time event, "custom" for a custom attribution window
denominatorValueColumnstringColumn name for the denominator’s value.
funnelCalculationWindownumberDuration for counting funnel events in days.
funnelCountDistinctstringAllowed: users┃sessions for distinct count method in funnel events.
funnelEventsobject[]List of funnel events with associated criteria and identifiers.
criteria[]unknown[]Optional array of criteria to filter the funnel events, defined by various types and conditions.
metricSourceName[]stringOptional name of the metric source associated with the funnel event.
name[]stringOptional step name for the funnel event, can be null if not specified.
sessionIdentifierField[]stringName of column which being used as session identifier. Funnel event with the same metric source
funnelStartCriteriastringAllowed: start_event┃exposure to determine funnel start criteria.
metricDimensionColumnsstring[]Specify metadata columns for breaking down metric analysis.
metricDimensionLimitsobject[]Per-dimension breakdown limits; values beyond the limit are grouped into OTHER.
name[]stringrequiredName of the metadata dimension to apply a breakdown limit.
limit[]integerrequiredMaximum number of values to retain for this dimension (0-100).
metricBakeDaysnumberNumber of days for metric baking; specify duration for analysis.
loadingWindownumberLookback window in days for loading metric data. Defaults to 90 days.
numeratorAggregationstringAggregation type for numerator; Allowed: count┃sum┃mean┃daily_participation┃ratio┃funnel┃count_distinct┃percentile.
valueColumnstringDeprecated: use metricSources instead. If provided with metricSourceName, this will overwrite all metric sources. Column name representing the metric’s value.
valueThresholdnumberThreshold value for filtering metrics.
allowNullRatioDenominatorbooleanInclude units which do not have a denominator. Only applicable to ratios.
funnelStrictOrderingbooleanfunnelUseExposureAsFirstEventbooleanfunnelTimestampAllowanceMsnumberfunnelTimeToConvertbooleanwinsorizationHighnumberHigh threshold for winsorization; must be between 0 and 1.
winsorizationLownumberLow threshold for winsorization; must be between 0 and 1.
winsorizationHighDenominatornumberwinsorizationLowDenominatornumbercupedAttributionWindownumberAttribution window for CUPED adjustments in days.
rollupTimeWindowstringRollup-mode for unit count metrics. Allowed values: "daily" for daily participation rate, "max" for one-time event, "custom" for a custom attribution window
customRollUpStartnumberCustom start window for unit count metrics with "custom" rollup time window, or for other metrics with the "Use Cohort Window in Experiments" option on enabled. Measured in days or minutes depending on the "customRollupMeasureInMinutes" flag.
customRollUpEndnumberCustom end window for unit count metrics with "custom" rollup time window, or for other metrics with the "Use Cohort Window in Experiments" option on enabled. Measured in days or minutes depending on the "customRollupMeasureInMinutes" flag.
onlyIncludeUsersWithConversionEventbooleanFlag to include only users with a conversion event in the metric.
denominatorCustomRollupMeasureInMinutesbooleanFlag to measure the denominator custom rollup window in minutes instead of days.
customRollupMeasureInMinutesbooleanFlag to measure the custom rollup window in minutes instead of days.
percentilenumberPercentile value for statistical calculations.
useLogTransformbooleanUse log transform for the metric.
useSecondaryRetentionEventbooleanUse a different start and completion event for retention calculations.
retentionEndnumberRetention end in days.
retentionLengthnumberRetention lookback window in days.
logTransformBasenumberLog transform base to be used for the metric.
capnumberMaximum cap for metric values.
surrogateMetricMSEnumberMean Squared Error for surrogate metric.
componentsobject[]Components for composite metrics, defining each component of the formula
operator[]stringrequiredOperator for this component
aggregation[]stringAggregation type for this component
metricSourceName[]stringMetric source name for this component
name[]stringOptional name for this component
criteria[]unknown[]Optional filtering criteria for this component
valueColumn[]stringValue column for this component
unitTypesstring[]Array of unit types that the metric can utilize, such as stableID, userID, or other custom identifiers.
percentilenumberUpdated percentile value for percentile metrics.
scheduledReloadHourintegerWarehouse Native only - UTC hour at which to run scheduled metric reloads.
scheduledReloadDaysinteger[]Warehouse Native only - days on which to run scheduled metric reloads from 0 to 6, 0 meaning Sunday. Null to run reloads on all days.
teamstringOptional field indicating the team name responsible for the metric, aiding in accountability and management.
teamIDstringOptional field indicating the team ID responsible for the metric, aiding in accountability and management.
directionalitystringIndicates the desired change direction for the metric. Use "increase" for positive changes and "decrease" for negative changes.
dryRunbooleanSkips persisting updates to the metric (used to validate that inputs are correct)
ownerobjectShow child attributes
emailstringEmail of the updated owner responsible for the metric’s management.
ownerIDstringID of the updated owner responsible for the metric’s management.
Response
application/jsonmessagestringrequiredA simple string explaining the result of the operation.
dataobjectrequiredShow child attributes
namestringrequiredThe name of the metric, serving as its primary identifier.
typestringrequiredThe type of the metric, defining its aggregation method and characteristics.
isVerifiedbooleanMarks the metric as verified, indicating trustworthiness within the organization.
isReadOnlybooleanSet to true to make the metric definition editable only through the Console API.
unitTypesstring[]Array of unit types associated with the metric, such as stableID or userID.
metricEventsobject[]An array of event definitions used to compute the metric. For ratio metrics, each event must use count or count_distinct aggregation.
name[]stringrequiredThe name of the metric event.
type[]stringAggregation type for the metric event. Allowed values: count, count_distinct, value, metadata. For ratio metrics, only count and count_distinct are valid. Do not confuse with criteria[].type, which is a filter condition type.
metadataKey[]stringThe key for associated metadata, if applicable.
criteria[]object[]Filtering criteria for the metric event, including conditions and values to refine the event data.
type[]stringrequiredType of event criterion for filtering metrics. Options include value, metadata, user, and user_custom; in Warehouse Native, this should always be metadata.
column[]stringOptional column specifying which data attribute to filter on.
condition[]stringrequiredsql_filter, start_withs, ends_with, after_exposure, and before_exposure are only applicable in Warehouse Native
values[]string[]Optional array of values for the criterion to match against.
nullVacuousOverride[]booleanIf true, overrides null values in criterion evaluation.
metricComponentMetricsobject[]List of input metrics used to calculate the new metric for composite types.
name[]stringrequiredtype[]stringrequireddescriptionstringAn optional description providing additional context about the metric.
directionalitystringrequiredSpecifies the desired directionality for the metric, indicating whether an increase or decrease is favorable.
tagsstring[]Optional tags for categorizing the metric and improving searchability.
isPermanentbooleanIndicates whether the metric is permanent and should not be deleted.
rollupTimeWindowstringTime window for the metric rollup. Specify "custom" for a customized time window.
customRollUpStartnumberCustom time window start date in days since exposure.
customRollUpEndnumberCustom time window end date in days since exposure.
percentilenumberPercentile value for percentile metrics.
funnelEventListobject[]List of events used to create funnel metrics.
name[]stringrequiredThe name of the funnel event used in the metric.
type[]stringrequiredThe type of funnel event, specifying how the event is tracked.
funnelCountDistinctstringSpecifies whether to count events or distinct users for the funnel metric.
warehouseNativeobjectDefines warehouse native metrics for advanced configurations.
aggregationstringAllowed: count┃sum┃mean┃daily_participation┃ratio┃funnel┃count_distinct┃percentile
metricSourceNamestringDeprecated: use metricSources instead. If provided, this will overwrite all metric sources. For Count, Sum, Mean, User Count aggregation types: the name of metric source
criteriaunknown[]Deprecated: use metricSources instead. If provided with metricSourceName, this will overwrite all metric sources. Filtering criteria for the metric source
metricSourcesobject[]List of metric sources for this metric.
metricSourceName[]stringrequiredcriteria[]unknown[]requiredFiltering criteria for the metric source
valueColumn[]stringwaitForCohortWindowbooleandenominatorCriteriaunknown[]Filtering criteria for the denominator metric source for a ratio, or the start event for a retention metric if useSecondaryRetentionEvent is set
denominatorAggregationstringAllowed: count┃sum┃mean┃daily_participation┃ratio┃funnel┃count_distinct┃percentile
denominatorCustomRollupEndnumberCustom end window for ratio denominator unit count metrics with "custom" rollup time window. Measured in days or minutes depending on the "denominatorCustomRollupMeasureInMinutes" flag.
denominatorCustomRollupStartnumberCustom start window for ratio denominator unit count metrics with "custom" rollup time window. Measured in days or minutes depending on the "denominatorCustomRollupMeasureInMinutes" flag.
denominatorMetricSourceNamestringName of the metric source for the denominator of a ratio, or the start event for a retention metric if useSecondaryRetentionEvent is set
denominatorRollupTimeWindowstringRollup-mode for ratio denominator unit count metrics. Allowed values: "daily" for daily participation rate, "max" for one-time event, "custom" for a custom attribution window
denominatorValueColumnstringColumn name for the denominator’s value.
funnelCalculationWindownumberDuration for counting funnel events in days.
funnelCountDistinctstringAllowed: users┃sessions for distinct count method in funnel events.
funnelEventsobject[]List of funnel events with associated criteria and identifiers.
criteria[]unknown[]Optional array of criteria to filter the funnel events, defined by various types and conditions.
metricSourceName[]stringOptional name of the metric source associated with the funnel event.
name[]stringOptional step name for the funnel event, can be null if not specified.
sessionIdentifierField[]stringName of column which being used as session identifier. Funnel event with the same metric source
funnelStartCriteriastringAllowed: start_event┃exposure to determine funnel start criteria.
metricDimensionColumnsstring[]Specify metadata columns for breaking down metric analysis.
metricDimensionLimitsobject[]Per-dimension breakdown limits; values beyond the limit are grouped into OTHER.
name[]stringrequiredName of the metadata dimension to apply a breakdown limit.
limit[]integerrequiredMaximum number of values to retain for this dimension (0-100).
metricBakeDaysnumberNumber of days for metric baking; specify duration for analysis.
loadingWindownumberLookback window in days for loading metric data. Defaults to 90 days.
numeratorAggregationstringAggregation type for numerator; Allowed: count┃sum┃mean┃daily_participation┃ratio┃funnel┃count_distinct┃percentile.
valueColumnstringDeprecated: use metricSources instead. If provided with metricSourceName, this will overwrite all metric sources. Column name representing the metric’s value.
valueThresholdnumberThreshold value for filtering metrics.
allowNullRatioDenominatorbooleanInclude units which do not have a denominator. Only applicable to ratios.
funnelStrictOrderingbooleanfunnelUseExposureAsFirstEventbooleanfunnelTimestampAllowanceMsnumberfunnelTimeToConvertbooleanwinsorizationHighnumberHigh threshold for winsorization; must be between 0 and 1.
winsorizationLownumberLow threshold for winsorization; must be between 0 and 1.
winsorizationHighDenominatornumberwinsorizationLowDenominatornumbercupedAttributionWindownumberAttribution window for CUPED adjustments in days.
rollupTimeWindowstringRollup-mode for unit count metrics. Allowed values: "daily" for daily participation rate, "max" for one-time event, "custom" for a custom attribution window
customRollUpStartnumberCustom start window for unit count metrics with "custom" rollup time window, or for other metrics with the "Use Cohort Window in Experiments" option on enabled. Measured in days or minutes depending on the "customRollupMeasureInMinutes" flag.
customRollUpEndnumberCustom end window for unit count metrics with "custom" rollup time window, or for other metrics with the "Use Cohort Window in Experiments" option on enabled. Measured in days or minutes depending on the "customRollupMeasureInMinutes" flag.
onlyIncludeUsersWithConversionEventbooleanFlag to include only users with a conversion event in the metric.
denominatorCustomRollupMeasureInMinutesbooleanFlag to measure the denominator custom rollup window in minutes instead of days.
customRollupMeasureInMinutesbooleanFlag to measure the custom rollup window in minutes instead of days.
percentilenumberPercentile value for statistical calculations.
useLogTransformbooleanUse log transform for the metric.
useSecondaryRetentionEventbooleanUse a different start and completion event for retention calculations.
retentionEndnumberRetention end in days.
retentionLengthnumberRetention lookback window in days.
logTransformBasenumberLog transform base to be used for the metric.
capnumberMaximum cap for metric values.
surrogateMetricMSEnumberMean Squared Error for surrogate metric.
componentsobject[]Components for composite metrics, defining each component of the formula
operator[]stringrequiredOperator for this component
aggregation[]stringAggregation type for this component
metricSourceName[]stringMetric source name for this component
name[]stringOptional name for this component
criteria[]unknown[]Optional filtering criteria for this component
valueColumn[]stringValue column for this component
teamstringThe team associated with the metric, applicable for enterprise environments.
teamIDstringThe team ID associated with the metric, applicable for enterprise environments.
dryRunbooleanSkips persisting the metric (used to validate that inputs are correct)
idstringrequiredUnique identifier for the metric, used for referencing within the system.
isHiddenbooleanIndicates if the metric is hidden from the user interface.
lineageobjectrequiredeventsstring[]requiredList of event names that contribute to the metric’s calculation.
metricsstring[]requiredList of metric names that are part of this metric’s lineage.
creatorNamestringName of the person who created the metric, if available.
creatorEmailstringEmail address of the metric creator for contact purposes.
createdTimenumberTimestamp indicating when the metric was created.
lastModifierIDstringID of the last modifier.
lastModifiedTimenumberTime of the last modification to this metric.
lastModifierEmailstringEmail of the last modifier.
lastModifierNamestringName of the last modifier.
scheduledReloadHourintegerWarehouse Native only - UTC hour at which to run scheduled metric reloads.
scheduledReloadDaysinteger[]Warehouse Native only - days on which to run scheduled metric reloads from 0 to 6, 0 meaning Sunday. Null to run reloads on all days.
ownerobjectownerIDstringID of the owner
ownerTypestringType of the owner (e.g., SDK_KEY or USER)
ownerNamestringThe name of the owner. This field is optional.
ownerEmailstringThe email of the owner. This field is optional.
namestringrequiredThe name of the owner.
permalinkstringrequiredA permalink to this metric in the Statsig Console.
statusintegerrequiredmessagestringrequiredstatusintegerrequiredmessagestringrequiredWas this helpful?