For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/api/latest/metrics/update-a-tag-indexing-rule.md. A documentation index is available at /llms.txt.
Language
Datadog site

Update a tag indexing rule

WARNINGNote: The Tag Indexing Rules feature is currently in Preview. If you have any feedback, contact Datadog support.
PUThttps://api.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.us3.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.us5.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.datadoghq.eu/api/v2/metrics/tag-indexing-rules/{id}https://api.ap1.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.ap2.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.uk1.datadoghq.com/api/v2/metrics/tag-indexing-rules/{id}https://api.ddog-gov.com/api/v2/metrics/tag-indexing-rules/{id}https://api.us2.ddog-gov.com/api/v2/metrics/tag-indexing-rules/{id}

Overview

Partially update a tag indexing rule. Fields omitted from the request body are left unchanged. Setting rule_order to a value already used by another rule returns 409; use the reorder endpoint for atomic re-sequencing. Requires the Manage Tags for Metrics permission.

This endpoint requires the metric_tags_write permission.

OAuth apps require the metric_tags_write authorization scope to access this endpoint.

Arguments

Path Parameters

Name
Type
Description
id [required]
string

ID of the tag indexing rule.

Request

Body Data (required)

Field
Type
Description
data [required]
object

Data object for updating a tag indexing rule.

Response

OK

Response containing a single tag indexing rule.

Field
Type
Description
data
object

A tag indexing rule resource object.

Code Example

# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.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/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "my-updated-rule",
      "tags": [
        "env",
        "service",
        "version"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.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/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "my-updated-rule",
      "tags": [
        "env",
        "service",
        "version"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.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/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "my-updated-rule",
      "tags": [
        "env",
        "service",
        "version"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# 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/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "my-updated-rule",
      "tags": [
        "env",
        "service",
        "version"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.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/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "my-updated-rule",
      "tags": [
        "env",
        "service",
        "version"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.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/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "my-updated-rule",
      "tags": [
        "env",
        "service",
        "version"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.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/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "my-updated-rule",
      "tags": [
        "env",
        "service",
        "version"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="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/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "my-updated-rule",
      "tags": [
        "env",
        "service",
        "version"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF
# Path parameters
export id="00000000-0000-0000-0000-000000000001"

# Set your Datadog site and credentials
export DD_SITE="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/tag-indexing-rules/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "my-updated-rule",
      "tags": [
        "env",
        "service",
        "version"
      ]
    },
    "type": "tag_indexing_rules"
  }
}
EOF