---
title: Update an incident type
description: Update an incident type.
breadcrumbs: Docs > API > Update an incident type
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# Update an incident type

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in public beta.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                                         |
| ----------------- | ------------------------------------------------------------------------------------ |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/incidents/config/types/{incident_type_id}      |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |
| uk1.datadoghq.com | PATCH https://api.uk1.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/incidents/config/types/{incident_type_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/incidents/config/types/{incident_type_id}  |

### Overview

Update an incident type.

This endpoint requires the `incident_settings_write` permission.

OAuth apps require the `incident_settings_write` authorization [scope](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/scopes.md#incidents) to access this endpoint.

### Arguments

#### Path Parameters

| Field                         | Type   | Description                    |
| ----------------------------- | ------ | ------------------------------ |
| incident_type_id [*required*] | string | The UUID of the incident type. |

### Request

#### Body Data (required)

Incident type payload.

{% tabs %}
{% tab label="Model" %}
| Parent field  | Field                        | Type    | Description                                                                                                                                                                                                                                                           |
| ------------- | ---------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|               | data [*required*]            | object  | Incident type data for a patch request.                                                                                                                                                                                                                               |
| data          | attributes [*required*]      | object  | Incident type's attributes for updates.                                                                                                                                                                                                                               |
| attributes    | configuration                | object  | The incident-type-scoped behavior settings. All fields are optional on update. Any field omitted from a PATCH request keeps its current value. This object is read-only on the incident type resource itself and is only mutated through the update (PATCH) endpoint. |
| configuration | allow_incident_deletion      | boolean | Whether incidents of this type can be deleted. Default: `false`.                                                                                                                                                                                                      |
| configuration | allow_workflows              | boolean | Whether automation workflows can be triggered for incidents of this type. Default: `true`.                                                                                                                                                                            |
| configuration | create_message               | string  | An optional message shown to users when they declare an incident of this type.                                                                                                                                                                                        |
| configuration | editable_timestamps          | boolean | Whether responders can edit incident timestamps for incidents of this type. Default: `false`.                                                                                                                                                                         |
| configuration | private_incidents            | boolean | Whether responders can create private incidents of this type. This is an opt-in setting, distinct from `private_incidents_by_default`, which controls whether incidents are created private automatically. Default: `false`.                                          |
| configuration | private_incidents_by_default | boolean | Whether incidents of this type are created as private by default. Default: `false`.                                                                                                                                                                                   |
| configuration | slug_source                  | enum    | When set to `servicenow`, incidents will display the ServiceNow record ID instead of the public ID. If no ServiceNow integration exists, the public ID will be displayed. Allowed enum values: `default`, `servicenow`. Default: `default`.                           |
| configuration | test_incidents               | boolean | Whether incidents of this type are treated as test incidents. Default: `true`.                                                                                                                                                                                        |
| attributes    | description                  | string  | Text that describes the incident type.                                                                                                                                                                                                                                |
| attributes    | is_default                   | boolean | When true, this incident type will be used as the default type when an incident type is not specified.                                                                                                                                                                |
| attributes    | name                         | string  | The name of the incident type.                                                                                                                                                                                                                                        |
| data          | id [*required*]              | string  | The incident type's ID.                                                                                                                                                                                                                                               |
| data          | type [*required*]            | enum    | Incident type resource type. Allowed enum values: `incident_types`. Default: `incident_types`.                                                                                                                                                                        |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "attributes": {
      "name": "Security Incident-updated"
    },
    "type": "incident_types"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Incident type response data.

| Parent field                  | Field                         | Type      | Description                                                                                                                                                                                                                                                           |
| ----------------------------- | ----------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]             | object    | Incident type response data.                                                                                                                                                                                                                                          |
| data                          | attributes                    | object    | Incident type's attributes.                                                                                                                                                                                                                                           |
| attributes                    | configuration                 | object    | The incident-type-scoped behavior settings. All fields are optional on update. Any field omitted from a PATCH request keeps its current value. This object is read-only on the incident type resource itself and is only mutated through the update (PATCH) endpoint. |
| configuration                 | allow_incident_deletion       | boolean   | Whether incidents of this type can be deleted. Default: `false`.                                                                                                                                                                                                      |
| configuration                 | allow_workflows               | boolean   | Whether automation workflows can be triggered for incidents of this type. Default: `true`.                                                                                                                                                                            |
| configuration                 | create_message                | string    | An optional message shown to users when they declare an incident of this type.                                                                                                                                                                                        |
| configuration                 | editable_timestamps           | boolean   | Whether responders can edit incident timestamps for incidents of this type. Default: `false`.                                                                                                                                                                         |
| configuration                 | private_incidents             | boolean   | Whether responders can create private incidents of this type. This is an opt-in setting, distinct from `private_incidents_by_default`, which controls whether incidents are created private automatically. Default: `false`.                                          |
| configuration                 | private_incidents_by_default  | boolean   | Whether incidents of this type are created as private by default. Default: `false`.                                                                                                                                                                                   |
| configuration                 | slug_source                   | enum      | When set to `servicenow`, incidents will display the ServiceNow record ID instead of the public ID. If no ServiceNow integration exists, the public ID will be displayed. Allowed enum values: `default`, `servicenow`. Default: `default`.                           |
| configuration                 | test_incidents                | boolean   | Whether incidents of this type are treated as test incidents. Default: `true`.                                                                                                                                                                                        |
| attributes                    | createdAt                     | date-time | Timestamp when the incident type was created. Read-only.                                                                                                                                                                                                              |
| attributes                    | createdBy                     | string    | A unique identifier that represents the user that created the incident type. Read-only.                                                                                                                                                                               |
| attributes                    | description                   | string    | Text that describes the incident type.                                                                                                                                                                                                                                |
| attributes                    | is_default                    | boolean   | If true, this incident type will be used as the default incident type if a type is not specified during the creation of incident resources. Default: `false`.                                                                                                         |
| attributes                    | lastModifiedBy                | string    | A unique identifier that represents the user that last modified the incident type. Read-only.                                                                                                                                                                         |
| attributes                    | modifiedAt                    | date-time | Timestamp when the incident type was last modified. Read-only.                                                                                                                                                                                                        |
| attributes                    | name [*required*]             | string    | The name of the incident type.                                                                                                                                                                                                                                        |
| attributes                    | prefix                        | string    | The string that will be prepended to the incident title across the Datadog app. Read-only.                                                                                                                                                                            |
| data                          | id [*required*]               | string    | The incident type's ID.                                                                                                                                                                                                                                               |
| data                          | relationships                 | object    | The incident type's resource relationships.                                                                                                                                                                                                                           |
| relationships                 | created_by_user               | object    | Relationship to user.                                                                                                                                                                                                                                                 |
| created_by_user               | data [*required*]             | object    | Relationship to user object.                                                                                                                                                                                                                                          |
| data                          | id [*required*]               | string    | A unique identifier that represents the user.                                                                                                                                                                                                                         |
| data                          | type [*required*]             | enum      | Users resource type. Allowed enum values: `users`. Default: `users`.                                                                                                                                                                                                  |
| relationships                 | google_meet_configuration     | object    | A reference to a Google Meet Configuration resource.                                                                                                                                                                                                                  |
| google_meet_configuration     | data [*required*]             | object    | The Google Meet configuration relationship data object.                                                                                                                                                                                                               |
| data                          | id [*required*]               | string    | The unique identifier of the Google Meet configuration.                                                                                                                                                                                                               |
| data                          | type [*required*]             | string    | The type of the Google Meet configuration.                                                                                                                                                                                                                            |
| relationships                 | last_modified_by_user         | object    | Relationship to user.                                                                                                                                                                                                                                                 |
| last_modified_by_user         | data [*required*]             | object    | Relationship to user object.                                                                                                                                                                                                                                          |
| data                          | id [*required*]               | string    | A unique identifier that represents the user.                                                                                                                                                                                                                         |
| data                          | type [*required*]             | enum      | Users resource type. Allowed enum values: `users`. Default: `users`.                                                                                                                                                                                                  |
| relationships                 | microsoft_teams_configuration | object    | A reference to a Microsoft Teams Configuration resource.                                                                                                                                                                                                              |
| microsoft_teams_configuration | data [*required*]             | object    | The Microsoft Teams configuration relationship data object.                                                                                                                                                                                                           |
| data                          | id [*required*]               | string    | The unique identifier of the Microsoft Teams configuration.                                                                                                                                                                                                           |
| data                          | type [*required*]             | string    | The type of the Microsoft Teams configuration.                                                                                                                                                                                                                        |
| relationships                 | zoom_configuration            | object    | A reference to a Zoom configuration resource.                                                                                                                                                                                                                         |
| zoom_configuration            | data [*required*]             | object    | The Zoom configuration relationship data object.                                                                                                                                                                                                                      |
| data                          | id [*required*]               | string    | The unique identifier of the Zoom configuration.                                                                                                                                                                                                                      |
| data                          | type [*required*]             | string    | The type of the Zoom configuration.                                                                                                                                                                                                                                   |
| data                          | type [*required*]             | enum      | Incident type resource type. Allowed enum values: `incident_types`. Default: `incident_types`.                                                                                                                                                                        |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "configuration": {
        "allow_incident_deletion": false,
        "allow_workflows": true,
        "create_message": "Create an incident here",
        "editable_timestamps": false,
        "private_incidents": false,
        "private_incidents_by_default": false,
        "slug_source": "default",
        "test_incidents": true
      },
      "createdAt": "2019-09-19T10:00:00.000Z",
      "createdBy": "00000000-0000-0000-0000-000000000000",
      "description": "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
      "is_default": false,
      "lastModifiedBy": "00000000-0000-0000-0000-000000000000",
      "modifiedAt": "2019-09-19T10:00:00.000Z",
      "name": "Security Incident",
      "prefix": "IR"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "google_meet_configuration": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "google_meet_configurations"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "microsoft_teams_configuration": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "microsoft_teams_configurations"
        }
      },
      "zoom_configuration": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "zoom_configurations"
        }
      }
    },
    "type": "incident_types"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="401" %}
Unauthorized

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export incident_type_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, 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 PATCH "https://api.${DD_SITE}/api/v2/incidents/config/types/${incident_type_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "attributes": {
      "name": "Security Incident-updated"
    },
    "type": "incident_types"
  }
}
EOF
```
{% /tab %}

{% tab label="Go" %}
```go
// Update an incident type 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 "incident_type" in the system
	IncidentTypeDataID := os.Getenv("INCIDENT_TYPE_DATA_ID")

	body := datadogV2.IncidentTypePatchRequest{
		Data: datadogV2.IncidentTypePatchData{
			Id: IncidentTypeDataID,
			Attributes: datadogV2.IncidentTypeUpdateAttributes{
				Name: datadog.PtrString("Security Incident-updated"),
			},
			Type: datadogV2.INCIDENTTYPETYPE_INCIDENT_TYPES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateIncidentType", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.UpdateIncidentType(ctx, IncidentTypeDataID, body)

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

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

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
```
{% /tab %}

{% tab label="Java" %}
```java
// Update an incident type returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;
import com.datadog.api.client.v2.model.IncidentTypePatchData;
import com.datadog.api.client.v2.model.IncidentTypePatchRequest;
import com.datadog.api.client.v2.model.IncidentTypeResponse;
import com.datadog.api.client.v2.model.IncidentTypeType;
import com.datadog.api.client.v2.model.IncidentTypeUpdateAttributes;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
    defaultClient.setUnstableOperationEnabled("v2.updateIncidentType", true);
    IncidentsApi apiInstance = new IncidentsApi(defaultClient);

    // there is a valid "incident_type" in the system
    String INCIDENT_TYPE_DATA_ATTRIBUTES_NAME = System.getenv("INCIDENT_TYPE_DATA_ATTRIBUTES_NAME");
    String INCIDENT_TYPE_DATA_ID = System.getenv("INCIDENT_TYPE_DATA_ID");

    IncidentTypePatchRequest body =
        new IncidentTypePatchRequest()
            .data(
                new IncidentTypePatchData()
                    .id(INCIDENT_TYPE_DATA_ID)
                    .attributes(
                        new IncidentTypeUpdateAttributes().name("Security Incident-updated"))
                    .type(IncidentTypeType.INCIDENT_TYPES));

    try {
      IncidentTypeResponse result = apiInstance.updateIncidentType(INCIDENT_TYPE_DATA_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#updateIncidentType");
      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://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
```
{% /tab %}

{% tab label="Python" %}
```python
"""
Update an incident type returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from datadog_api_client.v2.model.incident_type_patch_data import IncidentTypePatchData
from datadog_api_client.v2.model.incident_type_patch_request import IncidentTypePatchRequest
from datadog_api_client.v2.model.incident_type_type import IncidentTypeType
from datadog_api_client.v2.model.incident_type_update_attributes import IncidentTypeUpdateAttributes

# there is a valid "incident_type" in the system
INCIDENT_TYPE_DATA_ATTRIBUTES_NAME = environ["INCIDENT_TYPE_DATA_ATTRIBUTES_NAME"]
INCIDENT_TYPE_DATA_ID = environ["INCIDENT_TYPE_DATA_ID"]

body = IncidentTypePatchRequest(
    data=IncidentTypePatchData(
        id=INCIDENT_TYPE_DATA_ID,
        attributes=IncidentTypeUpdateAttributes(
            name="Security Incident-updated",
        ),
        type=IncidentTypeType.INCIDENT_TYPES,
    ),
)

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["update_incident_type"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.update_incident_type(incident_type_id=INCIDENT_TYPE_DATA_ID, body=body)

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
```
{% /tab %}

{% tab label="Ruby" %}
```ruby
# Update an incident type returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
  config.unstable_operations["v2.update_incident_type".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new

# there is a valid "incident_type" in the system
INCIDENT_TYPE_DATA_ATTRIBUTES_NAME = ENV["INCIDENT_TYPE_DATA_ATTRIBUTES_NAME"]
INCIDENT_TYPE_DATA_ID = ENV["INCIDENT_TYPE_DATA_ID"]

body = DatadogAPIClient::V2::IncidentTypePatchRequest.new({
  data: DatadogAPIClient::V2::IncidentTypePatchData.new({
    id: INCIDENT_TYPE_DATA_ID,
    attributes: DatadogAPIClient::V2::IncidentTypeUpdateAttributes.new({
      name: "Security Incident-updated",
    }),
    type: DatadogAPIClient::V2::IncidentTypeType::INCIDENT_TYPES,
  }),
})
p api_instance.update_incident_type(INCIDENT_TYPE_DATA_ID, body)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
```
{% /tab %}

{% tab label="Rust" %}
```rust
// Update an incident type returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentTypePatchData;
use datadog_api_client::datadogV2::model::IncidentTypePatchRequest;
use datadog_api_client::datadogV2::model::IncidentTypeType;
use datadog_api_client::datadogV2::model::IncidentTypeUpdateAttributes;

#[tokio::main]
async fn main() {
    // there is a valid "incident_type" in the system
    let incident_type_data_id = std::env::var("INCIDENT_TYPE_DATA_ID").unwrap();
    let body = IncidentTypePatchRequest::new(IncidentTypePatchData::new(
        IncidentTypeUpdateAttributes::new().name("Security Incident-updated".to_string()),
        incident_type_data_id.clone(),
        IncidentTypeType::INCIDENT_TYPES,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.update_incident_type", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident_type(incident_type_data_id.clone(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
```
{% /tab %}

{% tab label="TypeScript" %}
```typescript
/**
 * Update an incident type returns "OK" response
 */

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

const configuration = client.createConfiguration({
  authMethods: {
    AuthZ: {
      accessToken: process.env.DD_BEARER_TOKEN as string,
    },
  },
});
configuration.unstableOperations["v2.updateIncidentType"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiUpdateIncidentTypeRequest = {
  body: {
    data: {
      id: INCIDENT_TYPE_DATA_ID,
      attributes: {
        name: "Security Incident-updated",
      },
      type: "incident_types",
    },
  },
  incidentTypeId: INCIDENT_TYPE_DATA_ID,
};

apiInstance
  .updateIncidentType(params)
  .then((data: v2.IncidentTypeResponse) => {
    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://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"
```
{% /tab %}
{% /tabs %}
