Create Metric
Changed onCreates a metric. Set localMetric to attach it to an experiment or gate as a local metric. Warehouse-native dimension filters and breakdown columns use warehouseNative.
Request
- Base URLhttps://statsigapi.net
- URLhttps://statsigapi.net/console/v1/metrics
- AuthAPI key in header STATSIG-API-KEY
Request body
Example request
{
"name": "metricName",
"type": "sum",
"unitTypes": [
"stableID",
"userID"
],
"metricEvents": [
{
"name": "event1",
"type": "value"
}
],
"metricComponentMetrics": [],
"directionality": "increase",
"rollupTimeWindow": "custom",
"customRollUpStart": 1,
"customRollUpEnd": 1,
"percentile": 0.95,
"funnelEventList": [
{
"name": "event1",
"type": "event_dau"
}
],
"warehouseNative": {
"metricDimensionLimits": [
{
"limit": 10
}
],
"loadingWindow": 90
},
"localMetric": {
"configName": "purchase_experiment",
"section": "primary",
"clusterUnitType": "user_id"
}
}Response
Create metric response
Example response
{
"message": "Metric created successfully.",
"data": {
"id": "TestMetricCapi::sum",
"name": "TestMetricCapi",
"directionality": "increase",
"type": "sum",
"description": "Capi Metric",
"isPermanent": false,
"isReadOnly": false,
"isHidden": false,
"isVerified": false,
"tags": [],
"creatorName": "CONSOLE API",
"creatorEmail": null,
"createdTime": 1720218271796,
"owner": {
"name": "John Doe",
"ownerID": "user123",
"ownerType": "USER",
"ownerName": "John Doe",
"ownerEmail": "owner123@test.com"
},
"lineage": {
"events": [
"add_to_cart"
],
"metrics": []
},
"team": "Console Team",
"unitTypes": [
"userID"
],
"metricEvents": [
{
"name": "add_to_cart",
"type": "metadata",
"criteria": []
}
],
"permalink": "https://console.statsig.com/company_id/metrics/metrics_catalog/TestMetricCapi/sum"
}
}Changes
- info
added the new optional request property
- info
added the optional property
//to the response with the status
- info
- breaking
removed the enum value
undefinedof the request property - breaking
the
/request property type changed fromnumbertointeger, and format fromdoubletoint64 - breaking
the
/request property type changed fromnumbertointeger, and format fromdoubletoint64 - breaking
the
/request property type changed fromnumbertointeger, and format fromdoubletoint64 - breaking
the
/request property type changed fromnumbertointeger, and format fromdoubletoint64 - breaking
the
/request property type changed fromnumbertointeger, and format fromdoubletoint64 - breaking
the
/request property type changed fromnumbertointeger, and format fromdoubletoint64 - breaking
the
/request property type changed fromnumbertointeger, and format fromdoubletoint64 - breaking
the
/request property type changed fromnumbertointeger, and format fromdoubletoint64 - breaking
removed the required property
///from the response with the status - warning
the
/request property's exclusiveMinimum was set totrue - warning
the
/request property's exclusiveMinimum was set totrue - warning
the
/request property's exclusiveMinimum was set totrue - warning
the
/request property's max was set to1.00 - warning
the
/request property's min was set to0.00 - warning
the
/request property's min was set to0.00 - warning
the
/request property's min was set to0.00 - warning
the
/request property's min was set to0.00 - warning
the
/request property's min was set to0.00 - warning
the
/request property's min was set to0.00 - warning
the
/request property's min was set to0.00 - warning
the
/request property's min was set to0.00 - warning
the
/request property's min was set to0.00 - warning
the
/request property's min was set to0.00
- breaking