For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/tag-rules/list-tag-rules.md. A documentation index is available at /llms.txt.
Language
Datadog site

List tag rules

WARNINGNote: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
GEThttps://api.datadoghq.com/api/v2/governance/tag_ruleshttps://api.us3.datadoghq.com/api/v2/governance/tag_ruleshttps://api.us5.datadoghq.com/api/v2/governance/tag_ruleshttps://api.datadoghq.eu/api/v2/governance/tag_ruleshttps://api.ap1.datadoghq.com/api/v2/governance/tag_ruleshttps://api.ap2.datadoghq.com/api/v2/governance/tag_ruleshttps://api.uk1.datadoghq.com/api/v2/governance/tag_ruleshttps://api.ddog-gov.com/api/v2/governance/tag_ruleshttps://api.us2.ddog-gov.com/api/v2/governance/tag_rules

Overview

Retrieve all tag rules for the organization. Optionally include disabled or deleted rules, filter by telemetry source, and include each rule's current compliance score via the include=score query parameter.

This endpoint requires any of the following permissions:

  • telemetry_rules_read
  • metrics_read

Arguments

Query Strings

Name
Type
Description
include_disabled
boolean

Whether to include rules that are currently disabled. Defaults to false.

include_deleted
boolean

Whether to include rules that have been soft-deleted. Defaults to false.

include
enum

Comma-separated list of related resources to include alongside each rule in the response. Currently the only supported value is score.

Allowed enum values: score
filter[source]
enum

Restrict the result set to rules whose source matches the given value.

Allowed enum values: logs, spans, metrics, rum, feed
ts_start
integer

Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to a recent window appropriate for the source.

ts_end
integer

End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than ts_start.

Response

OK

A page of tag rules.

Field
Type
Description
data [required]
[object]

An array of tag rule data objects.

included
[object]

Related resources fetched alongside the primary tag rules. Populated when an include query parameter is supplied.

Code Example

List tag rules
# 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 GET "https://api.${DD_SITE}/api/v2/governance/tag_rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# 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 GET "https://api.${DD_SITE}/api/v2/governance/tag_rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# 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 GET "https://api.${DD_SITE}/api/v2/governance/tag_rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# 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 GET "https://api.${DD_SITE}/api/v2/governance/tag_rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# 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 GET "https://api.${DD_SITE}/api/v2/governance/tag_rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# 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 GET "https://api.${DD_SITE}/api/v2/governance/tag_rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# 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 GET "https://api.${DD_SITE}/api/v2/governance/tag_rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# 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 GET "https://api.${DD_SITE}/api/v2/governance/tag_rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# 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 GET "https://api.${DD_SITE}/api/v2/governance/tag_rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"