v5

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2026-02-283466592.5 MB
Metrics (beta)

Patch metric group

Patch a metric group by key. Updating a metric group uses a JSON patch representation of the desired changes.

patch/api/v2/projects/{projectKey}/metric-groups/{metricGroupKey}

Path parameters

projectKeystring string required

The project key

The project key

metricGroupKeystring string required

The metric group key

The metric group key

Request body

opstring required

The type of operation to perform

pathstring required

A JSON Pointer string specifying the part of the document to operate on

valuestring

A JSON value used in "add", "replace", and "test" operations

Example request

[
  {
    "op": "replace",
    "path": "/exampleField",
    "value": "new example value"
  }
]

Response

Metric group response

_idstring required

The ID of this metric group

keystring required

A unique key to reference the metric group

namestring required

A human-friendly name for the metric group

kind'funnel' | 'standard' | 'guardrail' required

The type of the metric group

descriptionstring

Description of the metric group

_linksobject required

The location and content type of related resources

tagsstring[] required

Tags for the metric group

_creationDateinteger required
_lastModifiedinteger required
_versioninteger required

The version of this metric group

experimentCountinteger

The number of experiments using this metric group

activeExperimentCountinteger

The number of active experiments using this metric group

activeGuardedRolloutCountinteger

The number of active guarded rollouts using this metric group

Example response

{
  "_id": "bc3e5be1-02d2-40c7-9926-26d0aacd7aab",
  "key": "metric-group-key-123abc",
  "name": "My metric group",
  "kind": "funnel",
  "description": "Description of the metric group",
  "_links": {
    "parent": {
      "href": "/api/v2/projects/my-project",
      "type": "application/json"
    },
    "self": {
      "href": "/api/v2/projects/my-project/metric-groups/my-metric-group",
      "type": "application/json"
    }
  },
  "_access": {
    "denied": [
      {
        "reason": {
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ],
          "effect": "allow"
        }
      }
    ],
    "allowed": [
      {
        "reason": {
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ],
          "effect": "allow"
        }
      }
    ]
  },
  "tags": [
    "ops"
  ],
  "maintainer": {
    "member": {
      "_links": {
        "self": {
          "href": "/api/v2/members/569f183514f4432160000007",
          "type": "application/json"
        }
      },
      "_id": "569f183514f4432160000007",
      "firstName": "Ariel",
      "lastName": "Flores",
      "role": "admin",
      "email": "ariel@acme.com"
    },
    "team": {
      "customRoleKeys": [
        "access-to-test-projects"
      ],
      "key": "team-key-123abc",
      "name": "QA Team"
    }
  },
  "metrics": [
    {
      "key": "metric-key-123abc",
      "_versionId": "version-id-123abc",
      "name": "Example metric",
      "kind": "custom",
      "isNumeric": true,
      "unitAggregationType": "sum",
      "eventKey": "event-key-123abc",
      "_links": {
        "self": {
          "href": "/api/v2/metrics/my-project/my-metric",
          "type": "application/json"
        }
      },
      "nameInGroup": "Step 1",
      "randomizationUnits": [
        "user"
      ]
    }
  ],
  "_version": 1,
  "experiments": [
    {
      "key": "experiment-key-123abc",
      "name": "Example experiment",
      "environmentId": "1234a56b7c89d012345e678f",
      "environmentKey": "production",
      "_links": {
        "parent": {
          "href": "/api/v2/projects/my-project/environments/my-environment",
          "type": "application/json"
        },
        "self": {
          "href": "/api/v2/projects/my-project/environments/my-environment/experiments/example-experiment",
          "type": "application/json"
        }
      }
    }
  ]
}