---
title: "Update a RUM-based metric"
method: PATCH
path: "/api/v2/rum/config/metrics/{metric_id}"
tags: ["Rum Metrics"]
---

# Update a RUM-based metric

`PATCH /api/v2/rum/config/metrics/{metric_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/rum/config/metrics/{metric_id}`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Update a specific RUM-based metric from your organization.
Returns the RUM-based metric object from the request body when the request is successful.

## Path parameters

- `metric_id` string, required

## Request body

- RumMetricUpdateRequest: The new RUM-based metric body.
  - `data` RumMetricUpdateData, required: The new RUM-based metric properties.
    - `attributes` RumMetricUpdateAttributes, required: The RUM-based metric properties that will be updated.
      - `compute` RumMetricUpdateCompute: The compute rule to compute the RUM-based metric.
        - `include_percentiles` boolean: Toggle to include or exclude percentile aggregations for distribution metrics. Only present when `aggregation_type` is `distribution`.
      - `filter` RumMetricFilter: The RUM-based metric filter. Events matching this filter will be aggregated in this metric.
        - `query` string, required: The search query - following the RUM search syntax.
      - `group_by` RumMetricGroupBy[]: The rules for the group by.
        - `path` string, required: The path to the value the RUM-based metric will be aggregated over.
        - `tag_name` string: Eventual name of the tag that gets created. By default, `path` is used as the tag name.
    - `id` string: The name of the RUM-based metric.
    - `type` 'rum_metrics', required: The type of the resource. The value should always be rum_metrics.

## Response `200`

OK

- RumMetricResponse: The RUM-based metric object.
  - `data` RumMetricResponseData: The RUM-based metric properties.
    - `attributes` RumMetricResponseAttributes: The object describing a Datadog RUM-based metric.
      - `compute` RumMetricResponseCompute: The compute rule to compute the RUM-based metric.
        - `aggregation_type` 'count' | 'distribution': The type of aggregation to use.
        - `include_percentiles` boolean: Toggle to include or exclude percentile aggregations for distribution metrics. Only present when `aggregation_type` is `distribution`.
        - `path` string: The path to the value the RUM-based metric will aggregate on. Only present when `aggregation_type` is `distribution`.
      - `event_type` 'session' | 'view' | 'action' | 'error' | 'resource' | 'long_task' | 'vital': The type of RUM events to filter on.
      - `filter` RumMetricResponseFilter: The RUM-based metric filter. RUM events matching this filter will be aggregated in this metric.
        - `query` string: The search query - following the RUM search syntax.
      - `group_by` RumMetricResponseGroupBy[]: The rules for the group by.
        - `path` string: The path to the value the RUM-based metric will be aggregated over.
        - `tag_name` string: Eventual name of the tag that gets created. By default, `path` is used as the tag name.
      - `uniqueness` RumMetricResponseUniqueness: The rule to count updatable events. Is only set if `event_type` is `session` or `view`.
        - `when` 'match' | 'end': When to count updatable events. `match` when the event is first seen, or `end` when the event is complete.
    - `id` string: The name of the RUM-based metric.
    - `type` 'rum_metrics': The type of the resource. The value should always be rum_metrics.

## Other responses

- `400`: Bad Request
- `403`: Not Authorized
- `404`: Not Found
- `409`: Conflict
- `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/da68bf029e4c?raw)
