---
title: Upsert a Cloud Cost Management tag description
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Cloud Cost Management
---

# Upsert a Cloud Cost Management tag description{% #upsert-a-cloud-cost-management-tag-description %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                             |
| ----------------- | ------------------------------------------------------------------------ |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v2/cost/tag_descriptions/{tag_key} |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v2/cost/tag_descriptions/{tag_key} |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v2/cost/tag_descriptions/{tag_key}      |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v2/cost/tag_descriptions/{tag_key}      |
| us2.ddog-gov.com  | PUT https://api.us2.ddog-gov.com/api/v2/cost/tag_descriptions/{tag_key}  |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v2/cost/tag_descriptions/{tag_key}     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v2/cost/tag_descriptions/{tag_key} |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.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](https://docs.datadoghq.com/api/latest/scopes.md#cloud-cost-management) 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)



{% tab title="Model" %}

| Parent field | 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. |
| data         | attributes [*required*]  | object | Mutable attributes set when creating or updating a Cloud Cost Management tag key description.                                                       |
| attributes   | cloud                         | string | Cloud provider this description applies to (for example, `aws`). Omit to set the cross-cloud default for the tag key.                               |
| attributes   | description [*required*] | string | The human-readable description for the tag key.                                                                                                     |
| data         | id                            | string | Identifier of the tag key the description applies to. Matches the `tag_key` path parameter.                                                         |
| data         | type [*required*]        | enum   | Type of the Cloud Cost Management tag description resource. Allowed enum values: `cost_tag_description`                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "cloud": "aws",
      "description": "AWS account that owns this cost."
    },
    "id": "account_id",
    "type": "cost_tag_description"
  }
}
```

{% /tab %}

### Response

{% tab title="204" %}
No Content
{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Path parameters export tag_key="CHANGE_ME" \# Curl command curl -X PUT "https://api.datadoghq.com/api/v2/cost/tag_descriptions/${tag_key}" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "cloud": "aws",
      "description": "AWS account that owns this cost."
    },
    "id": "account_id",
    "type": "cost_tag_description"
  }
}
EOF 
                
{% /tab %}
