---
title: Update a tag indexing rule exemption
description: Update the reason for an explicit tag indexing rule exemption.
breadcrumbs: Docs > API > Update a tag indexing rule exemption
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Update a tag indexing rule exemption

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                                                |
| ----------------- | ------------------------------------------------------------------------------------------- |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v2/metrics/{metric_name}/tag-indexing-rule-exemptions     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v2/metrics/{metric_name}/tag-indexing-rule-exemptions |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v2/metrics/{metric_name}/tag-indexing-rule-exemptions |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v2/metrics/{metric_name}/tag-indexing-rule-exemptions      |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v2/metrics/{metric_name}/tag-indexing-rule-exemptions |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v2/metrics/{metric_name}/tag-indexing-rule-exemptions |
| uk1.datadoghq.com | PUT https://api.uk1.datadoghq.com/api/v2/metrics/{metric_name}/tag-indexing-rule-exemptions |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v2/metrics/{metric_name}/tag-indexing-rule-exemptions      |
| us2.ddog-gov.com  | PUT https://api.us2.ddog-gov.com/api/v2/metrics/{metric_name}/tag-indexing-rule-exemptions  |

### Overview

Update the reason for an explicit tag indexing rule exemption. The exemption's `created_at` and
`created_by_handle` values remain unchanged. Returns 404 when the metric has no explicit exemption or has
only a legacy tag configuration. Requires the `Manage Tags for Metrics` permission.

This endpoint requires the `metric_tags_write` permission.

OAuth apps require the `metric_tags_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#metrics) to access this endpoint.

### Arguments

#### Path Parameters

| Field                    | Type   | Description             |
| ------------------------ | ------ | ----------------------- |
| metric_name [*required*] | string | The name of the metric. |

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                   | Type   | Description                                                                                                                                  |
| ------------ | ----------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object | Data object for updating a tag indexing rule exemption.                                                                                      |
| data         | attributes [*required*] | object | Attributes for updating a tag indexing rule exemption.                                                                                       |
| attributes   | reason [*required*]     | string | The updated reason the metric is exempt from tag indexing rules.                                                                             |
| data         | type [*required*]       | enum   | The tag indexing rule exemption resource type. Allowed enum values: `tag_indexing_rule_exemptions`. Default: `tag_indexing_rule_exemptions`. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "reason": "This metric must remain exempt because of its query requirements."
    },
    "type": "tag_indexing_rule_exemptions"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response containing a tag indexing rule exemption.

| Parent field | Field                      | Type      | Description                                                                                                                                                                                                                                                                                                                                                                             |
| ------------ | -------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data                       | object    | A tag indexing rule exemption resource object.                                                                                                                                                                                                                                                                                                                                          |
| data         | attributes                 | object    | Attributes of a tag indexing rule exemption.                                                                                                                                                                                                                                                                                                                                            |
| attributes   | created_at                 | date-time | Timestamp when the exemption was created. Read-only.                                                                                                                                                                                                                                                                                                                                    |
| attributes   | created_by_handle          | string    | Handle of the user who created the exemption. Read-only.                                                                                                                                                                                                                                                                                                                                |
| attributes   | estimated_change_in_volume | int64     | Estimated change in indexed cardinality or points if the exemption is removed and the matching tag indexing rule applies to the metric. A negative value indicates a reduction in indexed volume, a positive value indicates an increase, and zero indicates no change. A `null` value indicates that the estimate is unavailable. Read-only.                                           |
| attributes   | kind                       | string    | Discriminates between an explicit exemption (`exemption`) and a pre-existing legacy tag configuration acting as an implicit exclusion (`legacy_tag_configuration`).                                                                                                                                                                                                                     |
| attributes   | missing_indexed_tags       | [string]  | Tag keys used to query this metric in monitors, dashboards, notebooks, and SLOs that the matching rule would remove or not include if the exemption is removed. Read-only.                                                                                                                                                                                                              |
| attributes   | reason                     | string    | The reason the metric is exempt from tag indexing rules.                                                                                                                                                                                                                                                                                                                                |
| attributes   | volume_status              | enum      | Indicates whether `estimated_change_in_volume` is available and, if not, why. `ok` indicates a fresh estimate. `unindexed_tags` indicates that the matching rule uses tags that are not indexed for the metric. `unavailable` indicates that the estimate is stale, was not computed, or could not be retrieved. Read-only. Allowed enum values: `ok`, `unindexed_tags`, `unavailable`. |
| data         | id                         | string    | The metric name, used as the resource ID.                                                                                                                                                                                                                                                                                                                                               |
| data         | type                       | enum      | The tag indexing rule exemption resource type. Allowed enum values: `tag_indexing_rule_exemptions`. Default: `tag_indexing_rule_exemptions`.                                                                                                                                                                                                                                            |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-15T12:00:00.000Z",
      "created_by_handle": "user@datadoghq.com",
      "estimated_change_in_volume": 45,
      "kind": "exemption",
      "missing_indexed_tags": [
        "service"
      ],
      "reason": "This metric has a pre-existing tag configuration.",
      "volume_status": "unavailable"
    },
    "id": "dd.test.metric",
    "type": "tag_indexing_rule_exemptions"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too Many Requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export metric_name="dist.http.endpoint.request"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PUT "https://api.${DD_SITE}/api/v2/metrics/${metric_name}/tag-indexing-rule-exemptions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "reason": "This metric must remain exempt because of its query requirements."
    },
    "type": "tag_indexing_rule_exemptions"
  }
}
EOF
```
{% /tab %}
{% /tabs %}
