---
title: "Update metric collection"
method: PATCH
path: "/api/v2/experiments/metric-collections/{metric_collection_id}"
tags: ["Experiments"]
---

# Update metric collection

`PATCH /api/v2/experiments/metric-collections/{metric_collection_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/experiments/metric-collections/{metric_collection_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_metrics_write`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/experiments/metric-collections/:metric_collection_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update metric collection.

## Path parameters

- `metric_collection_id` string, uuid, required: The UUID of the metric collection.

## Request body

- ExperimentsPatchMetricCollectionV2Request: Request to update the metric collection.
  - `data` ExperimentsPatchMetricCollectionV2RequestData, required: JSON:API resource containing the metric collection identity and fields.
    - `attributes` ExperimentsPatchMetricCollectionV2RequestDataAttributes: Fields supplied to update the metric collection.
      - `description` string, nullable: Text that explains the metric collection.
      - `is_guardrail` boolean: Whether the collection is used for guardrail metrics.
      - `metrics` ExperimentsCreateMetricCollectionV2RequestDataAttributesMetricsItems[]: Metrics included in this collection.
        - `metric_id` string, uuid, required: Identifier of the metric to include in the collection.
      - `name` string: Display name of the metric collection.
    - `id` string: ID of the metric collection.
    - `type` 'metric-collections', required: Metric collections resource type.

## Response `200`

OK

- ExperimentsMetricCollectionV2DTO: Response containing the metric collection.
  - `data` ExperimentsMetricCollectionV2DTOData, required: JSON:API resource containing the metric collection identity and fields.
    - `attributes` ExperimentsMetricCollectionV2DTODataAttributes: Details of the metric collection.
      - `created_at` string, date-time: Time when this resource was created.
      - `description` string, nullable: Text that explains the metric collection.
      - `is_guardrail` boolean: Whether the collection is used for guardrail metrics.
      - `metric_count` integer: Number of metrics in this collection.
      - `metrics` ExperimentsMetricCollectionV2DTODataAttributesMetricsItems[]: Metrics included in this collection.
        - `metric_id` string: ID of the metric represented by this entry.
        - `metric_name` string: Display name of the metric represented by this entry.
      - `name` string: Display name of the metric collection.
      - `updated_at` string, date-time: Time when this resource was last updated.
    - `id` string, uuid, required: ID of the metric collection.
    - `type` 'metric-collections', required: Metric collections resource type.

## 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)
