POST
/
console
/
v1
/
metrics
/
{id}
curl --request POST \
  --url https://statsigapi.net/console/v1/metrics/{id} \
  --header 'Content-Type: application/json' \
  --header 'STATSIG-API-KEY: <api-key>' \
  --data '{
  "description": "<string>",
  "tags": [
    "<string>"
  ],
  "isVerified": true,
  "isReadOnly": true,
  "isPermanent": true,
  "warehouseNative": {
    "aggregation": "count",
    "metricSourceName": "<string>",
    "criteria": [
      {
        "type": "value",
        "column": "<string>",
        "condition": "in",
        "values": [
          "<string>"
        ],
        "nullVacuousOverride": true
      }
    ],
    "waitForCohortWindow": true,
    "denominatorCriteria": [
      {
        "type": "value",
        "column": "<string>",
        "condition": "in",
        "values": [
          "<string>"
        ],
        "nullVacuousOverride": true
      }
    ],
    "denominatorAggregation": "count",
    "denominatorCustomRollupEnd": 123,
    "denominatorCustomRollupStart": 123,
    "denominatorMetricSourceName": "<string>",
    "denominatorRollupTimeWindow": "<string>",
    "denominatorValueColumn": "<string>",
    "funnelCalculationWindow": 123,
    "funnelCountDistinct": "sessions",
    "funnelEvents": [
      {
        "criteria": [
          {
            "type": "value",
            "column": "<string>",
            "condition": "in",
            "values": [
              "<string>"
            ],
            "nullVacuousOverride": true
          }
        ],
        "metricSourceName": "<string>",
        "name": "<string>",
        "sessionIdentifierField": "<string>"
      }
    ],
    "funnelStartCriteria": "start_event",
    "metricDimensionColumns": [
      "<string>"
    ],
    "metricBakeDays": 123,
    "numeratorAggregation": "count",
    "valueColumn": "<string>",
    "winsorizationHigh": 0.5,
    "winsorizationLow": 0.5,
    "cupedAttributionWindow": 123,
    "onlyIncludeUsersWithConversionEvent": true,
    "percentile": 123,
    "valueThreshold": 123,
    "cap": 123,
    "rollupTimeWindow": "<string>",
    "customRollUpStart": 123,
    "customRollUpEnd": 123,
    "allowNullRatioDenominator": true
  },
  "unitTypes": [
    "<string>"
  ],
  "team": "<string>",
  "teamID": "<string>",
  "directionality": "increase",
  "dryRun": true
}'
{
  "message": "Metric updated successfully.",
  "data": {
    "id": "TestMetricCapi::sum",
    "name": "TestMetricCapi",
    "directionality": "increase",
    "type": "sum",
    "description": "new description",
    "isPermanent": false,
    "isReadOnly": false,
    "isHidden": false,
    "isVerified": false,
    "tags": [],
    "creatorName": "CONSOLE API",
    "creatorEmail": null,
    "createdTime": 1720218271796,
    "owner": {
      "name": "CONSOLE API"
    },
    "lineage": {
      "events": [
        "add_to_cart"
      ],
      "metrics": []
    },
    "team": "Console Team",
    "unitTypes": [
      "userID"
    ],
    "metricEvents": [
      {
        "name": "add_to_cart",
        "type": "value",
        "criteria": []
      }
    ]
  }
}

Authorizations

STATSIG-API-KEY
string
header
required

Headers

x-respect-review-settings
string

Optional header to respect review settings for mutation endpoints.

Path Parameters

id
string
required

id

Body

application/json
description
string

A detailed description of the metric, providing insights into its purpose and application.

tags
string[]

An array of tags associated with the metric, used for categorization and easier retrieval.

isVerified
boolean

Flag to mark the metric as verified, ensuring it is deemed trustworthy within the organization.

isReadOnly
boolean

Specifies if the metric definition can only be edited via the Console API, enhancing control over modifications.

isPermanent
boolean

Determines if the metric is permanent, preventing it from being deleted or modified inadvertently.

warehouseNative
object

Optional configuration for metrics utilizing Warehouse Native features, defining specific behaviors and criteria.

unitTypes
string[]

Array of unit types that the metric can utilize, such as stableID, userID, or other custom identifiers.

team
string | null

Optional field indicating the team name responsible for the metric, aiding in accountability and management.

teamID
string | null

Optional field indicating the team ID responsible for the metric, aiding in accountability and management.

directionality
enum<string>
default:increase

Indicates the desired change direction for the metric. Use "increase" for positive changes and "decrease" for negative changes.

Available options:
increase,
decrease
Example:

"increase"

dryRun
boolean

Skips persisting updates to the metric (used to validate that inputs are correct)

Response

200
application/json
Update metric response
message
string
required

A simple string explaining the result of the operation.

data
object
required

A single result.