v2

latestOpenAPI 3.0.02026-08-073221853.1 MB
Metrics
Metrics

Update a metric

post/console/v1/metrics/{id}

Path parameters

idstring required

id

Request body

namestring

The name of the metric, serving as its primary identifier.

descriptionstring

A 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.

isVerifiedboolean

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

isReadOnlyboolean

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

isPermanentboolean

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

unitTypesstring[]

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

percentilenumber double

Updated percentile value for percentile metrics.

scheduledReloadHourinteger nullable

Warehouse Native only - UTC hour at which to run scheduled metric reloads.

scheduledReloadDaysinteger[] nullable

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.

teamstring nullable

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

teamIDstring nullable

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

directionality'increase' | 'decrease'

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

dryRunboolean

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

Example request

{
  "name": "metricName",
  "warehouseNative": {
    "metricDimensionLimits": [
      {
        "limit": 10
      }
    ],
    "loadingWindow": 90
  },
  "percentile": 0.95,
  "directionality": "increase",
  "owner": {
    "ownerID": "user123",
    "ownerType": "USER",
    "ownerName": "John Doe",
    "ownerEmail": "owner123@test.com"
  }
}

Response

Update metric response

messagestring required

A simple string explaining the result of the operation.

Example response

{
  "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": "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": "value",
        "criteria": []
      }
    ],
    "permalink": "https://console.statsig.com/company_id/metrics/metrics_catalog/TestMetricCapi/sum"
  }
}