Skip to main content
PUT
/
metrics
/
{id}
cURL
curl -XPUT https://api.growthbook.io/api/v1/metrics/met_123abc \
  -d '{"name": "net revenue", "description":"revenue minus lacroix spend"}' \
  -u secret_abc123DEF456:
{
  "updatedId": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://growthbook-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

If using Bearer auth, pass the Secret Key as the token:

curl https://api.growthbook.io/api/v1 \
  -H "Authorization: Bearer secret_abc123DEF456"

Path Parameters

id
string
required

The id of the requested resource

Body

application/json
managedBy
enum<string>

Where this metric must be managed from. If not set (empty string), it can be managed from anywhere. If set to "api", it can be managed via the API only. Please note that we have deprecated support for setting the managedBy property to "admin". Your existing Legacy Metrics with this value will continue to work, but we suggest migrating to Fact Metrics instead.

Available options:
,
api,
admin
owner
any
name
string

Name of the metric

description
string

Description of the metric

type
enum<string>

Type of metric. See Metrics documentation

Available options:
binomial,
count,
duration,
revenue
tags
string[]

List of tags

projects
string[]

List of project IDs for projects that can access this metric

archived
boolean
behavior
object
sql
object

Preferred way to define SQL. Only one of sql, sqlBuilder or mixpanel allowed.

sqlBuilder
object

An alternative way to specify a SQL metric, rather than a full query. Using sql is preferred to sqlBuilder. Only one of sql, sqlBuilder or mixpanel allowed

mixpanel
object

Only use for MixPanel (non-SQL) Data Sources. Only one of sql, sqlBuilder or mixpanel allowed.

Response

200 - application/json

Success

updatedId
string
required