---
title: Update case custom attribute
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Case Management
---

# Update case custom attribute{% #update-case-custom-attribute %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                                       |
| ----------------- | -------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key} |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key} |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key}     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key} |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/cases/{case_id}/custom_attributes/{custom_attribute_key} |

### Overview

Update case custom attribute

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



### Arguments

#### Path Parameters

| Name                                   | Type   | Description                 |
| -------------------------------------- | ------ | --------------------------- |
| case_id [*required*]              | string | Case's UUID or key          |
| custom_attribute_key [*required*] | string | Case Custom attribute's key |

### Request

#### Body Data (required)

Update case custom attribute payload

{% tab title="Model" %}

| Parent field | Field                        | Type          | Description                                                                                                                                    |
| ------------ | ---------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object        | Case update custom attribute                                                                                                                   |
| data         | attributes [*required*] | object        | A typed value for a custom attribute on a specific case.                                                                                       |
| attributes   | is_multi [*required*]   | boolean       | If true, value must be an array                                                                                                                |
| attributes   | type [*required*]       | enum          | The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: `URL,TEXT,NUMBER,SELECT` |
| attributes   | value [*required*]      |  <oneOf> | The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.                   |
| value        | Option 1                     | string        | A string value for a TEXT, URL, or SELECT-type custom attribute.                                                                               |
| value        | Option 2                     | [string]      | An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.                                                        |
| value        | Option 3                     | double        | A numeric value for a NUMBER-type custom attribute.                                                                                            |
| value        | Option 4                     | [number]      | An array of numeric values for a multi-value NUMBER-type custom attribute.                                                                     |
| data         | type [*required*]       | enum          | JSON:API resource type for cases. Allowed enum values: `case`                                                                                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "is_multi": false,
      "type": "NUMBER",
      "value": {
        "description": "",
        "type": ""
      }
    },
    "type": "case"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Case response

| Parent field         | Field                        | Type          | Description                                                                                                                                                                                           |
| -------------------- | ---------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                      | data                         | object        | A case                                                                                                                                                                                                |
| data                 | attributes [*required*] | object        | Case resource attributes                                                                                                                                                                              |
| attributes           | archived_at                  | date-time     | Timestamp of when the case was archived                                                                                                                                                               |
| attributes           | attributes                   | object        | Key-value pairs of case attributes. Each key maps to an array of string values, used for flexible metadata such as labels or tags.                                                                    |
| additionalProperties | <any-key>                    | [string]      |
| attributes           | closed_at                    | date-time     | Timestamp of when the case was closed                                                                                                                                                                 |
| attributes           | created_at                   | date-time     | Timestamp of when the case was created                                                                                                                                                                |
| attributes           | custom_attributes            | object        | Case custom attributes                                                                                                                                                                                |
| additionalProperties | <any-key>                    | object        | A typed value for a custom attribute on a specific case.                                                                                                                                              |
| <any-key>            | is_multi [*required*]   | boolean       | If true, value must be an array                                                                                                                                                                       |
| <any-key>            | type [*required*]       | enum          | The data type of the custom attribute, which determines the allowed values and UI input control. Allowed enum values: `URL,TEXT,NUMBER,SELECT`                                                        |
| <any-key>            | value [*required*]      |  <oneOf> | The value of a custom attribute. The accepted format depends on the attribute's type and whether it accepts multiple values.                                                                          |
| value                | Option 1                     | string        | A string value for a TEXT, URL, or SELECT-type custom attribute.                                                                                                                                      |
| value                | Option 2                     | [string]      | An array of string values for a multi-value TEXT, URL, or SELECT-type custom attribute.                                                                                                               |
| value                | Option 3                     | double        | A numeric value for a NUMBER-type custom attribute.                                                                                                                                                   |
| value                | Option 4                     | [number]      | An array of numeric values for a multi-value NUMBER-type custom attribute.                                                                                                                            |
| attributes           | description                  | string        | Description                                                                                                                                                                                           |
| attributes           | jira_issue                   | object        | Jira issue attached to case                                                                                                                                                                           |
| jira_issue           | result                       | object        | Jira issue information                                                                                                                                                                                |
| result               | issue_id                     | string        | Jira issue ID                                                                                                                                                                                         |
| result               | issue_key                    | string        | Jira issue key                                                                                                                                                                                        |
| result               | issue_url                    | string        | Jira issue URL                                                                                                                                                                                        |
| result               | project_key                  | string        | Jira project key                                                                                                                                                                                      |
| jira_issue           | status                       | enum          | Case status Allowed enum values: `IN_PROGRESS,COMPLETED,FAILED`                                                                                                                                       |
| attributes           | key                          | string        | Key                                                                                                                                                                                                   |
| attributes           | modified_at                  | date-time     | Timestamp of when the case was last modified                                                                                                                                                          |
| attributes           | priority                     | enum          | Case priority Allowed enum values: `NOT_DEFINED,P1,P2,P3,P4,P5`                                                                                                                                       |
| attributes           | service_now_ticket           | object        | ServiceNow ticket attached to case                                                                                                                                                                    |
| service_now_ticket   | result                       | object        | ServiceNow ticket information                                                                                                                                                                         |
| result               | sys_target_link              | string        | Link to the Incident created on ServiceNow                                                                                                                                                            |
| service_now_ticket   | status                       | enum          | Case status Allowed enum values: `IN_PROGRESS,COMPLETED,FAILED`                                                                                                                                       |
| attributes           | status                       | enum          | **DEPRECATED**: Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. Allowed enum values: `OPEN,IN_PROGRESS,CLOSED` |
| attributes           | status_group                 | enum          | Status group of the case. Allowed enum values: `SG_OPEN,SG_IN_PROGRESS,SG_CLOSED`                                                                                                                     |
| attributes           | status_name                  | string        | Status of the case. Must be one of the existing statuses for the case's type.                                                                                                                         |
| attributes           | title                        | string        | Title                                                                                                                                                                                                 |
| attributes           | type                         | enum          | **DEPRECATED**: Case type Allowed enum values: `STANDARD`                                                                                                                                             |
| attributes           | type_id                      | string        | Case type UUID                                                                                                                                                                                        |
| data                 | id [*required*]         | string        | Case's identifier                                                                                                                                                                                     |
| data                 | relationships                | object        | Resources related to a case                                                                                                                                                                           |
| relationships        | assignee                     | object        | Relationship to user.                                                                                                                                                                                 |
| assignee             | data [*required*]       | object        | Relationship to user object.                                                                                                                                                                          |
| data                 | id [*required*]         | string        | A unique identifier that represents the user.                                                                                                                                                         |
| data                 | type [*required*]       | enum          | User resource type. Allowed enum values: `user`                                                                                                                                                       |
| relationships        | created_by                   | object        | Relationship to user.                                                                                                                                                                                 |
| created_by           | data [*required*]       | object        | Relationship to user object.                                                                                                                                                                          |
| data                 | id [*required*]         | string        | A unique identifier that represents the user.                                                                                                                                                         |
| data                 | type [*required*]       | enum          | User resource type. Allowed enum values: `user`                                                                                                                                                       |
| relationships        | modified_by                  | object        | Relationship to user.                                                                                                                                                                                 |
| modified_by          | data [*required*]       | object        | Relationship to user object.                                                                                                                                                                          |
| data                 | id [*required*]         | string        | A unique identifier that represents the user.                                                                                                                                                         |
| data                 | type [*required*]       | enum          | User resource type. Allowed enum values: `user`                                                                                                                                                       |
| relationships        | project                      | object        | Relationship to project.                                                                                                                                                                              |
| project              | data [*required*]       | object        | Relationship to project object.                                                                                                                                                                       |
| data                 | id [*required*]         | string        | A unique identifier that represents the project.                                                                                                                                                      |
| data                 | type [*required*]       | enum          | Project resource type. Allowed enum values: `project`                                                                                                                                                 |
| data                 | type [*required*]       | enum          | JSON:API resource type for cases. Allowed enum values: `case`                                                                                                                                         |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2019-09-19T10:00:00.000Z",
      "custom_attributes": {
        "<any-key>": {
          "is_multi": false,
          "type": "NUMBER",
          "value": {
            "description": "",
            "type": ""
          }
        }
      },
      "description": "string",
      "jira_issue": {
        "result": {
          "issue_id": "string",
          "issue_key": "string",
          "issue_url": "string",
          "project_key": "string"
        },
        "status": "COMPLETED"
      },
      "key": "CASEM-4523",
      "modified_at": "2019-09-19T10:00:00.000Z",
      "priority": "NOT_DEFINED",
      "service_now_ticket": {
        "result": {
          "sys_target_link": "string"
        },
        "status": "COMPLETED"
      },
      "status": "OPEN",
      "status_group": "SG_OPEN",
      "status_name": "Open",
      "title": "Memory leak investigation on API",
      "type": "STANDARD",
      "type_id": "3b010bde-09ce-4449-b745-71dd5f861963"
    },
    "id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001",
    "relationships": {
      "assignee": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "project": {
        "data": {
          "id": "e555e290-ed65-49bd-ae18-8acbfcf18db7",
          "type": "project"
        }
      }
    },
    "type": "case"
  }
}
```

{% /tab %}

{% /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="401" %}
Unauthorized
{% 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="404" %}
Not Found
{% 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 case_id="f98a5a5b-e0ff-45d4-b2f5-afe6e74de504" export custom_attribute_key="aws_region" \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/cases/${case_id}/custom_attributes/${custom_attribute_key}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "is_multi": false,
      "type": "NUMBER",
      "value": 42
    },
    "type": "case"
  }
}
EOF 
                
##### 

```python
"""
Update case custom attribute returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
from datadog_api_client.v2.model.case_resource_type import CaseResourceType
from datadog_api_client.v2.model.case_update_custom_attribute import CaseUpdateCustomAttribute
from datadog_api_client.v2.model.case_update_custom_attribute_request import CaseUpdateCustomAttributeRequest
from datadog_api_client.v2.model.custom_attribute_type import CustomAttributeType
from datadog_api_client.v2.model.custom_attribute_value import CustomAttributeValue

# there is a valid "case" with a custom "case_type" in the system
CASE_WITH_TYPE_ID = environ["CASE_WITH_TYPE_ID"]

# there is a valid "custom_attribute" in the system
CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = environ["CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY"]

body = CaseUpdateCustomAttributeRequest(
    data=CaseUpdateCustomAttribute(
        attributes=CustomAttributeValue(
            type=CustomAttributeType.TEXT,
            is_multi=True,
            value=["Abba", "The Cure"],
        ),
        type=CaseResourceType.CASE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CaseManagementApi(api_client)
    response = api_instance.update_case_custom_attribute(
        case_id=CASE_WITH_TYPE_ID, custom_attribute_key=CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY, body=body
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Update case custom attribute returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new

# there is a valid "case" with a custom "case_type" in the system
CASE_WITH_TYPE_ID = ENV["CASE_WITH_TYPE_ID"]

# there is a valid "custom_attribute" in the system
CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = ENV["CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY"]

body = DatadogAPIClient::V2::CaseUpdateCustomAttributeRequest.new({
  data: DatadogAPIClient::V2::CaseUpdateCustomAttribute.new({
    attributes: DatadogAPIClient::V2::CustomAttributeValue.new({
      type: DatadogAPIClient::V2::CustomAttributeType::TEXT,
      is_multi: true,
      value: [
        "Abba",
        "The Cure",
      ],
    }),
    type: DatadogAPIClient::V2::CaseResourceType::CASE,
  }),
})
p api_instance.update_case_custom_attribute(CASE_WITH_TYPE_ID, CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY, body)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Update case custom attribute returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	// there is a valid "case" with a custom "case_type" in the system
	CaseWithTypeID := os.Getenv("CASE_WITH_TYPE_ID")

	// there is a valid "custom_attribute" in the system
	CustomAttributeAttributesKey := os.Getenv("CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY")

	body := datadogV2.CaseUpdateCustomAttributeRequest{
		Data: datadogV2.CaseUpdateCustomAttribute{
			Attributes: datadogV2.CustomAttributeValue{
				Type:    datadogV2.CUSTOMATTRIBUTETYPE_TEXT,
				IsMulti: true,
				Value: datadogV2.CustomAttributeValuesUnion{
					CustomAttributeMultiStringValue: &[]string{
						"Abba",
						"The Cure",
					}},
			},
			Type: datadogV2.CASERESOURCETYPE_CASE,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCaseManagementApi(apiClient)
	resp, r, err := api.UpdateCaseCustomAttribute(ctx, CaseWithTypeID, CustomAttributeAttributesKey, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CaseManagementApi.UpdateCaseCustomAttribute`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CaseManagementApi.UpdateCaseCustomAttribute`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Update case custom attribute returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CaseManagementApi;
import com.datadog.api.client.v2.model.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;
import com.datadog.api.client.v2.model.CaseUpdateCustomAttribute;
import com.datadog.api.client.v2.model.CaseUpdateCustomAttributeRequest;
import com.datadog.api.client.v2.model.CustomAttributeType;
import com.datadog.api.client.v2.model.CustomAttributeValue;
import com.datadog.api.client.v2.model.CustomAttributeValuesUnion;
import java.util.Arrays;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

    // there is a valid "case" with a custom "case_type" in the system
    String CASE_WITH_TYPE_ID = System.getenv("CASE_WITH_TYPE_ID");

    // there is a valid "custom_attribute" in the system
    String CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = System.getenv("CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY");

    CaseUpdateCustomAttributeRequest body =
        new CaseUpdateCustomAttributeRequest()
            .data(
                new CaseUpdateCustomAttribute()
                    .attributes(
                        new CustomAttributeValue()
                            .type(CustomAttributeType.TEXT)
                            .isMulti(true)
                            .value(
                                CustomAttributeValuesUnion.fromStringList(
                                    Arrays.asList("Abba", "The Cure"))))
                    .type(CaseResourceType.CASE));

    try {
      CaseResponse result =
          apiInstance.updateCaseCustomAttribute(
              CASE_WITH_TYPE_ID, CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CaseManagementApi#updateCaseCustomAttribute");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Update case custom attribute returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseResourceType;
use datadog_api_client::datadogV2::model::CaseUpdateCustomAttribute;
use datadog_api_client::datadogV2::model::CaseUpdateCustomAttributeRequest;
use datadog_api_client::datadogV2::model::CustomAttributeType;
use datadog_api_client::datadogV2::model::CustomAttributeValue;
use datadog_api_client::datadogV2::model::CustomAttributeValuesUnion;

#[tokio::main]
async fn main() {
    // there is a valid "case" with a custom "case_type" in the system
    let case_with_type_id = std::env::var("CASE_WITH_TYPE_ID").unwrap();

    // there is a valid "custom_attribute" in the system
    let custom_attribute_attributes_key = std::env::var("CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY").unwrap();
    let body = CaseUpdateCustomAttributeRequest::new(CaseUpdateCustomAttribute::new(
        CustomAttributeValue::new(
            true,
            CustomAttributeType::TEXT,
            CustomAttributeValuesUnion::CustomAttributeMultiStringValue(vec![
                "Abba".to_string(),
                "The Cure".to_string(),
            ]),
        ),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api
        .update_case_custom_attribute(
            case_with_type_id.clone(),
            custom_attribute_attributes_key.clone(),
            body,
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Update case custom attribute returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.CaseManagementApi(configuration);

// there is a valid "case" with a custom "case_type" in the system
const CASE_WITH_TYPE_ID = process.env.CASE_WITH_TYPE_ID as string;

// there is a valid "custom_attribute" in the system
const CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY = process.env
  .CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY as string;

const params: v2.CaseManagementApiUpdateCaseCustomAttributeRequest = {
  body: {
    data: {
      attributes: {
        type: "TEXT",
        isMulti: true,
        value: ["Abba", "The Cure"],
      },
      type: "case",
    },
  },
  caseId: CASE_WITH_TYPE_ID,
  customAttributeKey: CUSTOM_ATTRIBUTE_ATTRIBUTES_KEY,
};

apiInstance
  .updateCaseCustomAttribute(params)
  .then((data: v2.CaseResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}
