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

Upsert a Cloud Cost Management tag description

PUThttps://api.datadoghq.com/api/v2/cost/tag_descriptions/{tag_key}https://api.us3.datadoghq.com/api/v2/cost/tag_descriptions/{tag_key}https://api.us5.datadoghq.com/api/v2/cost/tag_descriptions/{tag_key}https://api.datadoghq.eu/api/v2/cost/tag_descriptions/{tag_key}https://api.ap1.datadoghq.com/api/v2/cost/tag_descriptions/{tag_key}https://api.ap2.datadoghq.com/api/v2/cost/tag_descriptions/{tag_key}https://api.uk1.datadoghq.com/api/v2/cost/tag_descriptions/{tag_key}https://api.ddog-gov.com/api/v2/cost/tag_descriptions/{tag_key}https://api.us2.ddog-gov.com/api/v2/cost/tag_descriptions/{tag_key}

Overview

Create or update a Cloud Cost Management tag key description. The new description and optional cloud scoping are supplied in the request body. Omit cloud to set a cross-cloud default for the tag key.

This endpoint requires the cloud_cost_management_write permission.

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

Arguments

Path Parameters

Name
Type
Description
tag_key [required]
string

The tag key whose description is being upserted.

Request

Body Data (required)

Field
Type
Description
data [required]
object

Resource envelope carrying the tag key description being upserted. The id is informational; the authoritative tag key is taken from the URL path.

Response

No Content

Code Example

Upsert a Cloud Cost Management tag description
# Path parameters
export tag_key="CHANGE_ME"

# 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/cost/tag_descriptions/${tag_key}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cloud": "aws",
      "description": "AWS account that owns this cost."
    },
    "id": "account_id",
    "type": "cost_tag_description"
  }
}
EOF
# Path parameters
export tag_key="CHANGE_ME"

# 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/cost/tag_descriptions/${tag_key}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cloud": "aws",
      "description": "AWS account that owns this cost."
    },
    "id": "account_id",
    "type": "cost_tag_description"
  }
}
EOF
# Path parameters
export tag_key="CHANGE_ME"

# 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/cost/tag_descriptions/${tag_key}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cloud": "aws",
      "description": "AWS account that owns this cost."
    },
    "id": "account_id",
    "type": "cost_tag_description"
  }
}
EOF
# Path parameters
export tag_key="CHANGE_ME"

# 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/cost/tag_descriptions/${tag_key}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cloud": "aws",
      "description": "AWS account that owns this cost."
    },
    "id": "account_id",
    "type": "cost_tag_description"
  }
}
EOF
# Path parameters
export tag_key="CHANGE_ME"

# 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/cost/tag_descriptions/${tag_key}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cloud": "aws",
      "description": "AWS account that owns this cost."
    },
    "id": "account_id",
    "type": "cost_tag_description"
  }
}
EOF
# Path parameters
export tag_key="CHANGE_ME"

# 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/cost/tag_descriptions/${tag_key}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cloud": "aws",
      "description": "AWS account that owns this cost."
    },
    "id": "account_id",
    "type": "cost_tag_description"
  }
}
EOF
# Path parameters
export tag_key="CHANGE_ME"

# 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/cost/tag_descriptions/${tag_key}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cloud": "aws",
      "description": "AWS account that owns this cost."
    },
    "id": "account_id",
    "type": "cost_tag_description"
  }
}
EOF
# Path parameters
export tag_key="CHANGE_ME"

# 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/cost/tag_descriptions/${tag_key}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cloud": "aws",
      "description": "AWS account that owns this cost."
    },
    "id": "account_id",
    "type": "cost_tag_description"
  }
}
EOF
# Path parameters
export tag_key="CHANGE_ME"

# 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/cost/tag_descriptions/${tag_key}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cloud": "aws",
      "description": "AWS account that owns this cost."
    },
    "id": "account_id",
    "type": "cost_tag_description"
  }
}
EOF