Update metric

Patch a metric by key. Updating a metric uses a JSON patch representation of the desired changes. To learn more, read Updates.

Path parameters

projectKeystringRequired
The project key
metricKeystringRequired
The metric key

Headers

AuthorizationstringRequired

Request

This endpoint expects a list of objects.
opstringRequired
The type of operation to perform
pathstringRequired
A JSON Pointer string specifying the part of the document to operate on
valueanyOptional

Response

Metric response
_idstring
The ID of this metric
_versionIdstring
The version ID of the metric
keystring
A unique key to reference the metric
namestring

A human-friendly name for the metric

kindenum
The kind of event the metric tracks
Allowed values:
tagslist of strings
Tags for the metric
_creationDatelong
Timestamp of when the metric was created
experimentCountintegerOptional
The number of experiments using this metric
metricGroupCountintegerOptional
The number of metric groups using this metric
_attachedFlagCountintegerOptional
The number of feature flags currently attached to this metric
_siteobjectOptional
Details on how to access the metric in the LaunchDarkly UI
_accessobjectOptional
Details on the allowed and denied actions for this metric
lastModifiedobjectOptional
maintainerIdstringOptional
The ID of the member who maintains this metric
_maintainerobjectOptional
Details on the member who maintains this metric
descriptionstringOptional
Description of the metric
categorystringOptional
The category of the metric
isNumericbooleanOptional

For custom metrics, whether to track numeric changes in value against a baseline (true) or to track a conversion when an end user takes an action (false).

successCriteriaenumOptional
For custom metrics, the success criteria
Allowed values:
unitstringOptional
For numeric custom metrics, the unit of measure
eventKeystringOptional
For custom metrics, the event key to use in your code
randomizationUnitslist of stringsOptional
An array of randomization units allowed for this metric
filtersobjectOptional
The filters narrowing down the audience based on context attributes or event properties.
unitAggregationTypeenumOptional
The method by which multiple unit event values are aggregated
Allowed values:
analysisTypeenumOptional
The method for analyzing metric events
Allowed values:
percentileValueintegerOptional

The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when analysisType is percentile.

eventDefaultobjectOptional
experimentslist of objectsOptional
Experiments that use this metric, including those using a metric group that contains this metric
metricGroupslist of objectsOptional
Metric groups that use this metric
isActivebooleanOptional
Whether the metric is active
_attachedFeatureslist of objectsOptional
Details on the flags attached to this metric
_versionintegerOptional
Version of the metric
selectorstringOptional
For click metrics, the CSS selectors
urlslist of maps from strings to anyOptional
For click and pageview metrics, the target URLs

Errors