---
title: "Update experiment metric group"
method: PATCH
path: "/api/v2/experiments/{experiment_id}/metric-groups/{metric_group_id}"
tags: ["Experiments"]
---

# Update experiment metric group

`PATCH /api/v2/experiments/{experiment_id}/metric-groups/{metric_group_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/experiments/{experiment_id}/metric-groups/{metric_group_id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `product_analytics_experiments_write`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/experiments/:experiment_id/metric-groups/:metric_group_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update a non-decision metric group. Omitted attributes are unchanged; a supplied metrics array is the complete ordered replacement. Decision groups remain managed through the experiment resource. This operation does not synchronously recompute results.

## Path parameters

- `experiment_id` string, uuid, required: The UUID of the experiment.
- `metric_group_id` string, uuid, required: The UUID of the metric group.

## Request body

- ExperimentsPatchExperimentMetricGroupV2Request: Request to update the experiment metric group.
  - `data` ExperimentsPatchExperimentMetricGroupV2RequestData, required: JSON:API resource containing the experiment metric group identity and fields.
    - `attributes` ExperimentsPatchExperimentMetricGroupV2RequestDataAttributes: Fields supplied to update the experiment metric group.
      - `metrics` ExperimentsCreateExperimentMetricGroupV2RequestDataAttributesMetricsItems[]: Metrics included in this group.
        - `metric_id` string, uuid, required: Identifier of the metric to include in the group.
      - `migration_metadata` unknown
      - `name` string: Display name of the experiment metric group.
    - `id` string, uuid: ID of the experiment metric group.
    - `type` 'experiment-metric-groups', required: Experiment metric groups resource type.

## Response `200`

OK

- ExperimentsExperimentMetricGroupMutationV2: Response containing the saved experiment metric group and result refresh information.
  - `data` ExperimentsExperimentMetricGroupMutationV2Data, required: Experiment metric group resource with its identifier and metric selection.
    - `attributes` ExperimentsExperimentMetricGroupV2DTODataAttributes: Name, purpose, and selected metrics of an experiment metric group.
      - `is_decision` boolean: Whether this group contains the experiment decision metrics.
      - `metrics` ExperimentsExperimentMetricGroupMutationV2DataAttributesMetricsItems[]: Metrics selected for this experiment metric group.
        - `is_primary` boolean, required: Whether this is the experiment primary metric.
        - `metric_id` string, required: Identifier of the metric in the group.
        - `metric_name` string, required: Display name of the metric in the group.
      - `migration_metadata` unknown
      - `name` string: Display name of the experiment metric group.
    - `id` string, uuid, required: Identifier of the experiment metric group.
    - `type` 'experiment-metric-groups', required: Experiment metric groups resource type.
  - `meta` ExperimentsPatchExperimentV2MetaDTO: Refresh requirements and warnings returned by an experiment update.
    - `needs_pipeline_refresh` boolean, required: Whether this edit needs a full or non-full pipeline run. This operation does not start the run. A later false value does not clear a refresh required by an earlier edit.
    - `refresh_endpoint` string: POST to this endpoint after finishing your edits. The full_refresh query parameter selects the required run type. Across multiple edits any full_refresh=true requirement takes priority.
    - `warnings` ExperimentsPatchExperimentV2MetaDTOWarningsItems[]: Warnings returned after the experiment update.
      - `code` string, required: Code that identifies the warning.
      - `detail` string, required: Explanation of the warning and its effect on the update.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `415`: Request body sent with a media type other than application/json or application/vnd.api+json.
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
