# Source: https://docs.datadoghq.com/api/latest/incidents.md

---
title: Incidents
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Incidents
---

# Incidents

Manage incident response, as well as associated attachments, metadata, and todos. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information.

## Create an incident{% #create-an-incident %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                        |
| ----------------- | --------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/incidents |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/incidents |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/incidents      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/incidents      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/incidents     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/incidents |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/incidents |

### Overview

Create an incident. This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Request

#### Body Data (required)

Incident payload.

{% tab title="Model" %}

| Parent field         | Field                               | Type            | Description                                                                                                                    |
| -------------------- | ----------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|                      | data [*required*]              | object          | Incident data for a create request.                                                                                            |
| data                 | attributes [*required*]        | object          | The incident's attributes for a create request.                                                                                |
| attributes           | customer_impact_scope               | string          | Required if `customer_impacted:"true"`. A summary of the impact customers experienced during the incident.                     |
| attributes           | customer_impacted [*required*] | boolean         | A flag indicating whether the incident caused customer impact.                                                                 |
| attributes           | fields                              | object          | A condensed view of the user-defined fields for which to create initial selections.                                            |
| additionalProperties | <any-key>                           |  <oneOf>   | Dynamic fields for which selections can be made, with field names as keys.                                                     |
| <any-key>            | Option 1                            | object          | A field with a single value selected.                                                                                          |
| Option 1             | type                                | enum            | Type of the single value field definitions. Allowed enum values: `dropdown,textbox`                                            |
| Option 1             | value                               | string          | The single value selected for this field.                                                                                      |
| <any-key>            | Option 2                            | object          | A field with potentially multiple values selected.                                                                             |
| Option 2             | type                                | enum            | Type of the multiple value field definitions. Allowed enum values: `multiselect,textarray,metrictag,autocomplete`              |
| Option 2             | value                               | [string]        | The multiple values selected for this field.                                                                                   |
| attributes           | incident_type_uuid                  | string          | A unique identifier that represents an incident type. The default incident type will be used if this property is not provided. |
| attributes           | initial_cells                       | [ <oneOf>] | An array of initial timeline cells to be placed at the beginning of the incident timeline.                                     |
| initial_cells        | Option 1                            | object          | Timeline cell data for Markdown timeline cells for a create request.                                                           |
| Option 1             | cell_type [*required*]         | enum            | Type of the Markdown timeline cell. Allowed enum values: `markdown`                                                            |
| Option 1             | content [*required*]           | object          | The Markdown timeline cell contents.                                                                                           |
| content              | content                             | string          | The Markdown content of the cell.                                                                                              |
| Option 1             | important                           | boolean         | A flag indicating whether the timeline cell is important and should be highlighted.                                            |
| attributes           | is_test                             | boolean         | A flag indicating whether the incident is a test incident.                                                                     |
| attributes           | notification_handles                | [object]        | Notification handles that will be notified of the incident at creation.                                                        |
| notification_handles | display_name                        | string          | The name of the notified handle.                                                                                               |
| notification_handles | handle                              | string          | The handle used for the notification. This includes an email address, Slack channel, or workflow.                              |
| attributes           | title [*required*]             | string          | The title of the incident, which summarizes what happened.                                                                     |
| data                 | relationships                       | object          | The relationships the incident will have with other resources once created.                                                    |
| relationships        | commander_user [*required*]    | object          | Relationship to user.                                                                                                          |
| commander_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`                                                                              |
| data                 | type [*required*]              | enum            | Incident resource type. Allowed enum values: `incidents`                                                                       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "type": "incidents",
    "attributes": {
      "title": "Example-Incident",
      "customer_impacted": false,
      "fields": {
        "state": {
          "type": "dropdown",
          "value": "resolved"
        }
      }
    },
    "relationships": {
      "commander_user": {
        "data": {
          "type": "users",
          "id": "string"
        }
      }
    }
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
CREATED
{% tab title="Model" %}
Response with an incident.

| Parent field          | Field                           | Type            | Description                                                                                                                                             |
| --------------------- | ------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                       | data [*required*]          | object          | Incident data from a response.                                                                                                                          |
| data                  | attributes                      | object          | The incident's attributes from a response.                                                                                                              |
| attributes            | archived                        | date-time       | Timestamp of when the incident was archived.                                                                                                            |
| attributes            | case_id                         | int64           | The incident case id.                                                                                                                                   |
| attributes            | created                         | date-time       | Timestamp when the incident was created.                                                                                                                |
| attributes            | customer_impact_duration        | int64           | Length of the incident's customer impact in seconds. Equals the difference between `customer_impact_start` and `customer_impact_end`.                   |
| attributes            | customer_impact_end             | date-time       | Timestamp when customers were no longer impacted by the incident.                                                                                       |
| attributes            | customer_impact_scope           | string          | A summary of the impact customers experienced during the incident.                                                                                      |
| attributes            | customer_impact_start           | date-time       | Timestamp when customers began being impacted by the incident.                                                                                          |
| attributes            | customer_impacted               | boolean         | A flag indicating whether the incident caused customer impact.                                                                                          |
| attributes            | declared                        | date-time       | Timestamp when the incident was declared.                                                                                                               |
| attributes            | declared_by                     | object          | Incident's non Datadog creator.                                                                                                                         |
| declared_by           | image_48_px                     | string          | Non Datadog creator `48px` image.                                                                                                                       |
| declared_by           | name                            | string          | Non Datadog creator name.                                                                                                                               |
| attributes            | declared_by_uuid                | string          | UUID of the user who declared the incident.                                                                                                             |
| attributes            | detected                        | date-time       | Timestamp when the incident was detected.                                                                                                               |
| attributes            | fields                          | object          | A condensed view of the user-defined fields attached to incidents.                                                                                      |
| additionalProperties  | <any-key>                       |  <oneOf>   | Dynamic fields for which selections can be made, with field names as keys.                                                                              |
| <any-key>             | Option 1                        | object          | A field with a single value selected.                                                                                                                   |
| Option 1              | type                            | enum            | Type of the single value field definitions. Allowed enum values: `dropdown,textbox`                                                                     |
| Option 1              | value                           | string          | The single value selected for this field.                                                                                                               |
| <any-key>             | Option 2                        | object          | A field with potentially multiple values selected.                                                                                                      |
| Option 2              | type                            | enum            | Type of the multiple value field definitions. Allowed enum values: `multiselect,textarray,metrictag,autocomplete`                                       |
| Option 2              | value                           | [string]        | The multiple values selected for this field.                                                                                                            |
| attributes            | incident_type_uuid              | string          | A unique identifier that represents an incident type.                                                                                                   |
| attributes            | is_test                         | boolean         | A flag indicating whether the incident is a test incident.                                                                                              |
| attributes            | modified                        | date-time       | Timestamp when the incident was last modified.                                                                                                          |
| attributes            | non_datadog_creator             | object          | Incident's non Datadog creator.                                                                                                                         |
| non_datadog_creator   | image_48_px                     | string          | Non Datadog creator `48px` image.                                                                                                                       |
| non_datadog_creator   | name                            | string          | Non Datadog creator name.                                                                                                                               |
| attributes            | notification_handles            | [object]        | Notification handles that will be notified of the incident during update.                                                                               |
| notification_handles  | display_name                    | string          | The name of the notified handle.                                                                                                                        |
| notification_handles  | handle                          | string          | The handle used for the notification. This includes an email address, Slack channel, or workflow.                                                       |
| attributes            | public_id                       | int64           | The monotonically increasing integer ID for the incident.                                                                                               |
| attributes            | resolved                        | date-time       | Timestamp when the incident's state was last changed from active or stable to resolved or completed.                                                    |
| attributes            | severity                        | enum            | The incident severity. Allowed enum values: `UNKNOWN,SEV-0,SEV-1,SEV-2,SEV-3,SEV-4,SEV-5`                                                               |
| attributes            | state                           | string          | The state incident.                                                                                                                                     |
| attributes            | time_to_detect                  | int64           | The amount of time in seconds to detect the incident. Equals the difference between `customer_impact_start` and `detected`.                             |
| attributes            | time_to_internal_response       | int64           | The amount of time in seconds to call incident after detection. Equals the difference of `detected` and `created`.                                      |
| attributes            | time_to_repair                  | int64           | The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between `customer_impact_end` and `detected`. |
| attributes            | time_to_resolve                 | int64           | The amount of time in seconds to resolve the incident after it was created. Equals the difference between `created` and `resolved`.                     |
| attributes            | title [*required*]         | string          | The title of the incident, which summarizes what happened.                                                                                              |
| attributes            | visibility                      | string          | The incident visibility status.                                                                                                                         |
| data                  | id [*required*]            | string          | The incident's ID.                                                                                                                                      |
| data                  | relationships                   | object          | The incident's relationships from a response.                                                                                                           |
| relationships         | attachments                     | object          | A relationship reference for attachments.                                                                                                               |
| attachments           | data [*required*]          | [object]        | An array of incident attachments.                                                                                                                       |
| data                  | id [*required*]            | string          | A unique identifier that represents the attachment.                                                                                                     |
| data                  | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments`                                                                      |
| relationships         | commander_user                  | object          | Relationship to user.                                                                                                                                   |
| commander_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`                                                                                                       |
| 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`                                                                                                       |
| relationships         | declared_by_user                | object          | Relationship to user.                                                                                                                                   |
| declared_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`                                                                                                       |
| relationships         | impacts                         | object          | Relationship to impacts.                                                                                                                                |
| impacts               | data [*required*]          | [object]        | An array of incident impacts.                                                                                                                           |
| data                  | id [*required*]            | string          | A unique identifier that represents the impact.                                                                                                         |
| data                  | type [*required*]          | enum            | The incident impacts type. Allowed enum values: `incident_impacts`                                                                                      |
| relationships         | integrations                    | object          | A relationship reference for multiple integration metadata objects.                                                                                     |
| integrations          | data [*required*]          | [object]        | Integration metadata relationship array                                                                                                                 |
| data                  | id [*required*]            | string          | A unique identifier that represents the integration metadata.                                                                                           |
| data                  | type [*required*]          | enum            | Integration metadata resource type. Allowed enum values: `incident_integrations`                                                                        |
| 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`                                                                                                       |
| relationships         | responders                      | object          | Relationship to incident responders.                                                                                                                    |
| responders            | data [*required*]          | [object]        | An array of incident responders.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the responder.                                                                                                      |
| data                  | type [*required*]          | enum            | The incident responders type. Allowed enum values: `incident_responders`                                                                                |
| relationships         | user_defined_fields             | object          | Relationship to incident user defined fields.                                                                                                           |
| user_defined_fields   | data [*required*]          | [object]        | An array of user defined fields.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the responder.                                                                                                      |
| data                  | type [*required*]          | enum            | The incident user defined fields type. Allowed enum values: `user_defined_field`                                                                        |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                                                                                                |
|                       | included                        | [ <oneOf>] | Included related resources that the user requested.                                                                                                     |
| included              | Option 1                        | object          | User object returned by the API.                                                                                                                        |
| Option 1              | attributes                      | object          | Attributes of user object returned by the API.                                                                                                          |
| attributes            | email                           | string          | Email of the user.                                                                                                                                      |
| attributes            | handle                          | string          | Handle of the user.                                                                                                                                     |
| attributes            | icon                            | string          | URL of the user's icon.                                                                                                                                 |
| attributes            | name                            | string          | Name of the user.                                                                                                                                       |
| attributes            | uuid                            | string          | UUID of the user.                                                                                                                                       |
| Option 1              | id                              | string          | ID of the user.                                                                                                                                         |
| Option 1              | type                            | enum            | Users resource type. Allowed enum values: `users`                                                                                                       |
| included              | Option 2                        | object          | Attachment data from a response.                                                                                                                        |
| Option 2              | attributes [*required*]    | object          | The attachment's attributes.                                                                                                                            |
| attributes            | attachment                      | object          | The attachment object.                                                                                                                                  |
| attachment            | documentUrl                     | string          | The URL of the attachment.                                                                                                                              |
| attachment            | title                           | string          | The title of the attachment.                                                                                                                            |
| attributes            | attachment_type                 | enum            | The type of the attachment. Allowed enum values: `postmortem,link`                                                                                      |
| attributes            | modified                        | date-time       | Timestamp when the attachment was last modified.                                                                                                        |
| Option 2              | id [*required*]            | string          | The unique identifier of the attachment.                                                                                                                |
| Option 2              | relationships [*required*] | object          | The attachment's resource relationships.                                                                                                                |
| relationships         | incident                        | object          | Relationship to incident.                                                                                                                               |
| incident              | data [*required*]          | object          | Relationship to incident object.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the incident.                                                                                                       |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                                                                                                |
| 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`                                                                                                       |
| Option 2              | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments`                                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived": "2019-09-19T10:00:00.000Z",
      "case_id": "integer",
      "created": "2019-09-19T10:00:00.000Z",
      "customer_impact_duration": "integer",
      "customer_impact_end": "2019-09-19T10:00:00.000Z",
      "customer_impact_scope": "An example customer impact scope",
      "customer_impact_start": "2019-09-19T10:00:00.000Z",
      "customer_impacted": false,
      "declared": "2019-09-19T10:00:00.000Z",
      "declared_by": {
        "image_48_px": "string",
        "name": "string"
      },
      "declared_by_uuid": "string",
      "detected": "2019-09-19T10:00:00.000Z",
      "fields": {
        "<any-key>": "undefined"
      },
      "incident_type_uuid": "00000000-0000-0000-0000-000000000000",
      "is_test": false,
      "modified": "2019-09-19T10:00:00.000Z",
      "non_datadog_creator": {
        "image_48_px": "string",
        "name": "string"
      },
      "notification_handles": [
        {
          "display_name": "Jane Doe",
          "handle": "@test.user@test.com"
        }
      ],
      "public_id": 1,
      "resolved": "2019-09-19T10:00:00.000Z",
      "severity": "UNKNOWN",
      "state": "string",
      "time_to_detect": "integer",
      "time_to_internal_response": "integer",
      "time_to_repair": "integer",
      "time_to_resolve": "integer",
      "title": "A test incident title",
      "visibility": "string"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "attachments": {
        "data": [
          {
            "id": "00000000-0000-abcd-1000-000000000000",
            "type": "incident_attachments"
          }
        ]
      },
      "commander_user": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      },
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "declared_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "impacts": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_impacts"
          }
        ]
      },
      "integrations": {
        "data": [
          {
            "id": "00000000-abcd-0001-0000-000000000000",
            "type": "incident_integrations"
          }
        ]
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "responders": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_responders"
          }
        ]
      },
      "user_defined_fields": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "user_defined_field"
          }
        ]
      }
    },
    "type": "incidents"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                          \# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents" \
-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": {
    "type": "incidents",
    "attributes": {
      "title": "Example-Incident",
      "customer_impacted": false,
      "fields": {
        "state": {
          "type": "dropdown",
          "value": "resolved"
        }
      }
    },
    "relationships": {
      "commander_user": {
        "data": {
          "type": "users",
          "id": "string"
        }
      }
    }
  }
}
EOF
                        
##### 

```go
// Create an incident returns "CREATED" 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 "user" in the system
	UserDataID := os.Getenv("USER_DATA_ID")

	body := datadogV2.IncidentCreateRequest{
		Data: datadogV2.IncidentCreateData{
			Type: datadogV2.INCIDENTTYPE_INCIDENTS,
			Attributes: datadogV2.IncidentCreateAttributes{
				Title:            "Example-Incident",
				CustomerImpacted: false,
				Fields: map[string]datadogV2.IncidentFieldAttributes{
					"state": datadogV2.IncidentFieldAttributes{
						IncidentFieldAttributesSingleValue: &datadogV2.IncidentFieldAttributesSingleValue{
							Type:  datadogV2.INCIDENTFIELDATTRIBUTESSINGLEVALUETYPE_DROPDOWN.Ptr(),
							Value: *datadog.NewNullableString(datadog.PtrString("resolved")),
						}},
				},
			},
			Relationships: &datadogV2.IncidentCreateRelationships{
				CommanderUser: *datadogV2.NewNullableNullableRelationshipToUser(&datadogV2.NullableRelationshipToUser{
					Data: *datadogV2.NewNullableNullableRelationshipToUserData(&datadogV2.NullableRelationshipToUserData{
						Type: datadogV2.USERSTYPE_USERS,
						Id:   UserDataID,
					}),
				}),
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateIncident", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.CreateIncident(ctx, body)

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

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

#### Instructions

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

```java
// Create an incident returns "CREATED" 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.IncidentCreateAttributes;
import com.datadog.api.client.v2.model.IncidentCreateData;
import com.datadog.api.client.v2.model.IncidentCreateRelationships;
import com.datadog.api.client.v2.model.IncidentCreateRequest;
import com.datadog.api.client.v2.model.IncidentFieldAttributes;
import com.datadog.api.client.v2.model.IncidentFieldAttributesSingleValue;
import com.datadog.api.client.v2.model.IncidentFieldAttributesSingleValueType;
import com.datadog.api.client.v2.model.IncidentResponse;
import com.datadog.api.client.v2.model.IncidentType;
import com.datadog.api.client.v2.model.NullableRelationshipToUser;
import com.datadog.api.client.v2.model.NullableRelationshipToUserData;
import com.datadog.api.client.v2.model.UsersType;
import java.util.Map;

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

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

    IncidentCreateRequest body =
        new IncidentCreateRequest()
            .data(
                new IncidentCreateData()
                    .type(IncidentType.INCIDENTS)
                    .attributes(
                        new IncidentCreateAttributes()
                            .title("Example-Incident")
                            .customerImpacted(false)
                            .fields(
                                Map.ofEntries(
                                    Map.entry(
                                        "state",
                                        new IncidentFieldAttributes(
                                            new IncidentFieldAttributesSingleValue()
                                                .type(
                                                    IncidentFieldAttributesSingleValueType.DROPDOWN)
                                                .value("resolved"))))))
                    .relationships(
                        new IncidentCreateRelationships()
                            .commanderUser(
                                new NullableRelationshipToUser()
                                    .data(
                                        new NullableRelationshipToUserData()
                                            .type(UsersType.USERS)
                                            .id(USER_DATA_ID)))));

    try {
      IncidentResponse result = apiInstance.createIncident(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#createIncident");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Create an incident returns "CREATED" 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_create_attributes import IncidentCreateAttributes
from datadog_api_client.v2.model.incident_create_data import IncidentCreateData
from datadog_api_client.v2.model.incident_create_relationships import IncidentCreateRelationships
from datadog_api_client.v2.model.incident_create_request import IncidentCreateRequest
from datadog_api_client.v2.model.incident_field_attributes_single_value import IncidentFieldAttributesSingleValue
from datadog_api_client.v2.model.incident_field_attributes_single_value_type import (
    IncidentFieldAttributesSingleValueType,
)
from datadog_api_client.v2.model.incident_type import IncidentType
from datadog_api_client.v2.model.nullable_relationship_to_user import NullableRelationshipToUser
from datadog_api_client.v2.model.nullable_relationship_to_user_data import NullableRelationshipToUserData
from datadog_api_client.v2.model.users_type import UsersType

# there is a valid "user" in the system
USER_DATA_ID = environ["USER_DATA_ID"]

body = IncidentCreateRequest(
    data=IncidentCreateData(
        type=IncidentType.INCIDENTS,
        attributes=IncidentCreateAttributes(
            title="Example-Incident",
            customer_impacted=False,
            fields=dict(
                state=IncidentFieldAttributesSingleValue(
                    type=IncidentFieldAttributesSingleValueType.DROPDOWN,
                    value="resolved",
                ),
            ),
        ),
        relationships=IncidentCreateRelationships(
            commander_user=NullableRelationshipToUser(
                data=NullableRelationshipToUserData(
                    type=UsersType.USERS,
                    id=USER_DATA_ID,
                ),
            ),
        ),
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_incident"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.create_incident(body=body)

    print(response)
```

#### Instructions

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

```ruby
# Create an incident returns "CREATED" response

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

# there is a valid "user" in the system
USER_DATA_ID = ENV["USER_DATA_ID"]

body = DatadogAPIClient::V2::IncidentCreateRequest.new({
  data: DatadogAPIClient::V2::IncidentCreateData.new({
    type: DatadogAPIClient::V2::IncidentType::INCIDENTS,
    attributes: DatadogAPIClient::V2::IncidentCreateAttributes.new({
      title: "Example-Incident",
      customer_impacted: false,
      fields: {
        state: DatadogAPIClient::V2::IncidentFieldAttributesSingleValue.new({
          type: DatadogAPIClient::V2::IncidentFieldAttributesSingleValueType::DROPDOWN,
          value: "resolved",
        }),
      },
    }),
    relationships: DatadogAPIClient::V2::IncidentCreateRelationships.new({
      commander_user: DatadogAPIClient::V2::NullableRelationshipToUser.new({
        data: DatadogAPIClient::V2::NullableRelationshipToUserData.new({
          type: DatadogAPIClient::V2::UsersType::USERS,
          id: USER_DATA_ID,
        }),
      }),
    }),
  }),
})
p api_instance.create_incident(body)
```

#### Instructions

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

```rust
// Create an incident returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentCreateAttributes;
use datadog_api_client::datadogV2::model::IncidentCreateData;
use datadog_api_client::datadogV2::model::IncidentCreateRelationships;
use datadog_api_client::datadogV2::model::IncidentCreateRequest;
use datadog_api_client::datadogV2::model::IncidentFieldAttributes;
use datadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValue;
use datadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValueType;
use datadog_api_client::datadogV2::model::IncidentType;
use datadog_api_client::datadogV2::model::NullableRelationshipToUser;
use datadog_api_client::datadogV2::model::NullableRelationshipToUserData;
use datadog_api_client::datadogV2::model::UsersType;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    // there is a valid "user" in the system
    let user_data_id = std::env::var("USER_DATA_ID").unwrap();
    let body = IncidentCreateRequest::new(
        IncidentCreateData::new(
            IncidentCreateAttributes::new(false, "Example-Incident".to_string()).fields(
                BTreeMap::from([(
                    "state".to_string(),
                    IncidentFieldAttributes::IncidentFieldAttributesSingleValue(Box::new(
                        IncidentFieldAttributesSingleValue::new()
                            .type_(IncidentFieldAttributesSingleValueType::DROPDOWN)
                            .value(Some("resolved".to_string())),
                    )),
                )]),
            ),
            IncidentType::INCIDENTS,
        )
        .relationships(IncidentCreateRelationships::new(Some(
            NullableRelationshipToUser::new(Some(NullableRelationshipToUserData::new(
                user_data_id.clone(),
                UsersType::USERS,
            ))),
        ))),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.create_incident(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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Create an incident returns "CREATED" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncident"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiCreateIncidentRequest = {
  body: {
    data: {
      type: "incidents",
      attributes: {
        title: "Example-Incident",
        customerImpacted: false,
        fields: {
          state: {
            type: "dropdown",
            value: "resolved",
          },
        },
      },
      relationships: {
        commanderUser: {
          data: {
            type: "users",
            id: USER_DATA_ID,
          },
        },
      },
    },
  },
};

apiInstance
  .createIncident(params)
  .then((data: v2.IncidentResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Get the details of an incident{% #get-the-details-of-an-incident %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                     |
| ----------------- | ---------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/{incident_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/{incident_id}      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/{incident_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/{incident_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/{incident_id} |

### Overview

Get the details of an incident by `incident_id`. This endpoint requires the `incident_read` permission.

OAuth apps require the `incident_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description               |
| ----------------------------- | ------ | ------------------------- |
| incident_id [*required*] | string | The UUID of the incident. |

#### Query Strings

| Name    | Type  | Description                                                                  |
| ------- | ----- | ---------------------------------------------------------------------------- |
| include | array | Specifies which types of related objects should be included in the response. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with an incident.

| Parent field          | Field                           | Type            | Description                                                                                                                                             |
| --------------------- | ------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                       | data [*required*]          | object          | Incident data from a response.                                                                                                                          |
| data                  | attributes                      | object          | The incident's attributes from a response.                                                                                                              |
| attributes            | archived                        | date-time       | Timestamp of when the incident was archived.                                                                                                            |
| attributes            | case_id                         | int64           | The incident case id.                                                                                                                                   |
| attributes            | created                         | date-time       | Timestamp when the incident was created.                                                                                                                |
| attributes            | customer_impact_duration        | int64           | Length of the incident's customer impact in seconds. Equals the difference between `customer_impact_start` and `customer_impact_end`.                   |
| attributes            | customer_impact_end             | date-time       | Timestamp when customers were no longer impacted by the incident.                                                                                       |
| attributes            | customer_impact_scope           | string          | A summary of the impact customers experienced during the incident.                                                                                      |
| attributes            | customer_impact_start           | date-time       | Timestamp when customers began being impacted by the incident.                                                                                          |
| attributes            | customer_impacted               | boolean         | A flag indicating whether the incident caused customer impact.                                                                                          |
| attributes            | declared                        | date-time       | Timestamp when the incident was declared.                                                                                                               |
| attributes            | declared_by                     | object          | Incident's non Datadog creator.                                                                                                                         |
| declared_by           | image_48_px                     | string          | Non Datadog creator `48px` image.                                                                                                                       |
| declared_by           | name                            | string          | Non Datadog creator name.                                                                                                                               |
| attributes            | declared_by_uuid                | string          | UUID of the user who declared the incident.                                                                                                             |
| attributes            | detected                        | date-time       | Timestamp when the incident was detected.                                                                                                               |
| attributes            | fields                          | object          | A condensed view of the user-defined fields attached to incidents.                                                                                      |
| additionalProperties  | <any-key>                       |  <oneOf>   | Dynamic fields for which selections can be made, with field names as keys.                                                                              |
| <any-key>             | Option 1                        | object          | A field with a single value selected.                                                                                                                   |
| Option 1              | type                            | enum            | Type of the single value field definitions. Allowed enum values: `dropdown,textbox`                                                                     |
| Option 1              | value                           | string          | The single value selected for this field.                                                                                                               |
| <any-key>             | Option 2                        | object          | A field with potentially multiple values selected.                                                                                                      |
| Option 2              | type                            | enum            | Type of the multiple value field definitions. Allowed enum values: `multiselect,textarray,metrictag,autocomplete`                                       |
| Option 2              | value                           | [string]        | The multiple values selected for this field.                                                                                                            |
| attributes            | incident_type_uuid              | string          | A unique identifier that represents an incident type.                                                                                                   |
| attributes            | is_test                         | boolean         | A flag indicating whether the incident is a test incident.                                                                                              |
| attributes            | modified                        | date-time       | Timestamp when the incident was last modified.                                                                                                          |
| attributes            | non_datadog_creator             | object          | Incident's non Datadog creator.                                                                                                                         |
| non_datadog_creator   | image_48_px                     | string          | Non Datadog creator `48px` image.                                                                                                                       |
| non_datadog_creator   | name                            | string          | Non Datadog creator name.                                                                                                                               |
| attributes            | notification_handles            | [object]        | Notification handles that will be notified of the incident during update.                                                                               |
| notification_handles  | display_name                    | string          | The name of the notified handle.                                                                                                                        |
| notification_handles  | handle                          | string          | The handle used for the notification. This includes an email address, Slack channel, or workflow.                                                       |
| attributes            | public_id                       | int64           | The monotonically increasing integer ID for the incident.                                                                                               |
| attributes            | resolved                        | date-time       | Timestamp when the incident's state was last changed from active or stable to resolved or completed.                                                    |
| attributes            | severity                        | enum            | The incident severity. Allowed enum values: `UNKNOWN,SEV-0,SEV-1,SEV-2,SEV-3,SEV-4,SEV-5`                                                               |
| attributes            | state                           | string          | The state incident.                                                                                                                                     |
| attributes            | time_to_detect                  | int64           | The amount of time in seconds to detect the incident. Equals the difference between `customer_impact_start` and `detected`.                             |
| attributes            | time_to_internal_response       | int64           | The amount of time in seconds to call incident after detection. Equals the difference of `detected` and `created`.                                      |
| attributes            | time_to_repair                  | int64           | The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between `customer_impact_end` and `detected`. |
| attributes            | time_to_resolve                 | int64           | The amount of time in seconds to resolve the incident after it was created. Equals the difference between `created` and `resolved`.                     |
| attributes            | title [*required*]         | string          | The title of the incident, which summarizes what happened.                                                                                              |
| attributes            | visibility                      | string          | The incident visibility status.                                                                                                                         |
| data                  | id [*required*]            | string          | The incident's ID.                                                                                                                                      |
| data                  | relationships                   | object          | The incident's relationships from a response.                                                                                                           |
| relationships         | attachments                     | object          | A relationship reference for attachments.                                                                                                               |
| attachments           | data [*required*]          | [object]        | An array of incident attachments.                                                                                                                       |
| data                  | id [*required*]            | string          | A unique identifier that represents the attachment.                                                                                                     |
| data                  | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments`                                                                      |
| relationships         | commander_user                  | object          | Relationship to user.                                                                                                                                   |
| commander_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`                                                                                                       |
| 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`                                                                                                       |
| relationships         | declared_by_user                | object          | Relationship to user.                                                                                                                                   |
| declared_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`                                                                                                       |
| relationships         | impacts                         | object          | Relationship to impacts.                                                                                                                                |
| impacts               | data [*required*]          | [object]        | An array of incident impacts.                                                                                                                           |
| data                  | id [*required*]            | string          | A unique identifier that represents the impact.                                                                                                         |
| data                  | type [*required*]          | enum            | The incident impacts type. Allowed enum values: `incident_impacts`                                                                                      |
| relationships         | integrations                    | object          | A relationship reference for multiple integration metadata objects.                                                                                     |
| integrations          | data [*required*]          | [object]        | Integration metadata relationship array                                                                                                                 |
| data                  | id [*required*]            | string          | A unique identifier that represents the integration metadata.                                                                                           |
| data                  | type [*required*]          | enum            | Integration metadata resource type. Allowed enum values: `incident_integrations`                                                                        |
| 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`                                                                                                       |
| relationships         | responders                      | object          | Relationship to incident responders.                                                                                                                    |
| responders            | data [*required*]          | [object]        | An array of incident responders.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the responder.                                                                                                      |
| data                  | type [*required*]          | enum            | The incident responders type. Allowed enum values: `incident_responders`                                                                                |
| relationships         | user_defined_fields             | object          | Relationship to incident user defined fields.                                                                                                           |
| user_defined_fields   | data [*required*]          | [object]        | An array of user defined fields.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the responder.                                                                                                      |
| data                  | type [*required*]          | enum            | The incident user defined fields type. Allowed enum values: `user_defined_field`                                                                        |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                                                                                                |
|                       | included                        | [ <oneOf>] | Included related resources that the user requested.                                                                                                     |
| included              | Option 1                        | object          | User object returned by the API.                                                                                                                        |
| Option 1              | attributes                      | object          | Attributes of user object returned by the API.                                                                                                          |
| attributes            | email                           | string          | Email of the user.                                                                                                                                      |
| attributes            | handle                          | string          | Handle of the user.                                                                                                                                     |
| attributes            | icon                            | string          | URL of the user's icon.                                                                                                                                 |
| attributes            | name                            | string          | Name of the user.                                                                                                                                       |
| attributes            | uuid                            | string          | UUID of the user.                                                                                                                                       |
| Option 1              | id                              | string          | ID of the user.                                                                                                                                         |
| Option 1              | type                            | enum            | Users resource type. Allowed enum values: `users`                                                                                                       |
| included              | Option 2                        | object          | Attachment data from a response.                                                                                                                        |
| Option 2              | attributes [*required*]    | object          | The attachment's attributes.                                                                                                                            |
| attributes            | attachment                      | object          | The attachment object.                                                                                                                                  |
| attachment            | documentUrl                     | string          | The URL of the attachment.                                                                                                                              |
| attachment            | title                           | string          | The title of the attachment.                                                                                                                            |
| attributes            | attachment_type                 | enum            | The type of the attachment. Allowed enum values: `postmortem,link`                                                                                      |
| attributes            | modified                        | date-time       | Timestamp when the attachment was last modified.                                                                                                        |
| Option 2              | id [*required*]            | string          | The unique identifier of the attachment.                                                                                                                |
| Option 2              | relationships [*required*] | object          | The attachment's resource relationships.                                                                                                                |
| relationships         | incident                        | object          | Relationship to incident.                                                                                                                               |
| incident              | data [*required*]          | object          | Relationship to incident object.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the incident.                                                                                                       |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                                                                                                |
| 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`                                                                                                       |
| Option 2              | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments`                                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived": "2019-09-19T10:00:00.000Z",
      "case_id": "integer",
      "created": "2019-09-19T10:00:00.000Z",
      "customer_impact_duration": "integer",
      "customer_impact_end": "2019-09-19T10:00:00.000Z",
      "customer_impact_scope": "An example customer impact scope",
      "customer_impact_start": "2019-09-19T10:00:00.000Z",
      "customer_impacted": false,
      "declared": "2019-09-19T10:00:00.000Z",
      "declared_by": {
        "image_48_px": "string",
        "name": "string"
      },
      "declared_by_uuid": "string",
      "detected": "2019-09-19T10:00:00.000Z",
      "fields": {
        "<any-key>": "undefined"
      },
      "incident_type_uuid": "00000000-0000-0000-0000-000000000000",
      "is_test": false,
      "modified": "2019-09-19T10:00:00.000Z",
      "non_datadog_creator": {
        "image_48_px": "string",
        "name": "string"
      },
      "notification_handles": [
        {
          "display_name": "Jane Doe",
          "handle": "@test.user@test.com"
        }
      ],
      "public_id": 1,
      "resolved": "2019-09-19T10:00:00.000Z",
      "severity": "UNKNOWN",
      "state": "string",
      "time_to_detect": "integer",
      "time_to_internal_response": "integer",
      "time_to_repair": "integer",
      "time_to_resolve": "integer",
      "title": "A test incident title",
      "visibility": "string"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "attachments": {
        "data": [
          {
            "id": "00000000-0000-abcd-1000-000000000000",
            "type": "incident_attachments"
          }
        ]
      },
      "commander_user": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      },
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "declared_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "impacts": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_impacts"
          }
        ]
      },
      "integrations": {
        "data": [
          {
            "id": "00000000-abcd-0001-0000-000000000000",
            "type": "incident_integrations"
          }
        ]
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "responders": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_responders"
          }
        ]
      },
      "user_defined_fields": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "user_defined_field"
          }
        ]
      }
    },
    "type": "incidents"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Get the details of an incident returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["get_incident"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.get_incident(
        incident_id=INCIDENT_DATA_ID,
    )

    print(response)
```

#### Instructions

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

```ruby
# Get the details of an incident returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]
p api_instance.get_incident(INCIDENT_DATA_ID)
```

#### Instructions

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

```go
// Get the details of an incident 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetIncident", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.GetIncident(ctx, IncidentDataID, *datadogV2.NewGetIncidentOptionalParameters())

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

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

#### Instructions

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

```java
// Get the details of an incident 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.IncidentResponse;

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

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

    try {
      IncidentResponse result = apiInstance.getIncident(INCIDENT_DATA_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#getIncident");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get the details of an incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::GetIncidentOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .get_incident(
            incident_data_id.clone(),
            GetIncidentOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get the details of an incident returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getIncident"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiGetIncidentRequest = {
  incidentId: INCIDENT_DATA_ID,
};

apiInstance
  .getIncident(params)
  .then((data: v2.IncidentResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Update an existing incident{% #update-an-existing-incident %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                       |
| ----------------- | ------------------------------------------------------------------ |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/incidents/{incident_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/incidents/{incident_id}      |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/incidents/{incident_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/incidents/{incident_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/incidents/{incident_id} |

### Overview

Updates an incident. Provide only the attributes that should be updated as this request is a partial update. This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description               |
| ----------------------------- | ------ | ------------------------- |
| incident_id [*required*] | string | The UUID of the incident. |

#### Query Strings

| Name    | Type  | Description                                                                  |
| ------- | ----- | ---------------------------------------------------------------------------- |
| include | array | Specifies which types of related objects should be included in the response. |

### Request

#### Body Data (required)

Incident Payload.

{% tab title="Model" %}

| Parent field         | Field                  | Type          | Description                                                                                                       |
| -------------------- | ---------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------- |
|                      | data [*required*] | object        | Incident data for an update request.                                                                              |
| data                 | attributes             | object        | The incident's attributes for an update request.                                                                  |
| attributes           | customer_impact_end    | date-time     | Timestamp when customers were no longer impacted by the incident.                                                 |
| attributes           | customer_impact_scope  | string        | A summary of the impact customers experienced during the incident.                                                |
| attributes           | customer_impact_start  | date-time     | Timestamp when customers began being impacted by the incident.                                                    |
| attributes           | customer_impacted      | boolean       | A flag indicating whether the incident caused customer impact.                                                    |
| attributes           | detected               | date-time     | Timestamp when the incident was detected.                                                                         |
| attributes           | fields                 | object        | A condensed view of the user-defined fields for which to update selections.                                       |
| additionalProperties | <any-key>              |  <oneOf> | Dynamic fields for which selections can be made, with field names as keys.                                        |
| <any-key>            | Option 1               | object        | A field with a single value selected.                                                                             |
| Option 1             | type                   | enum          | Type of the single value field definitions. Allowed enum values: `dropdown,textbox`                               |
| Option 1             | value                  | string        | The single value selected for this field.                                                                         |
| <any-key>            | Option 2               | object        | A field with potentially multiple values selected.                                                                |
| Option 2             | type                   | enum          | Type of the multiple value field definitions. Allowed enum values: `multiselect,textarray,metrictag,autocomplete` |
| Option 2             | value                  | [string]      | The multiple values selected for this field.                                                                      |
| attributes           | notification_handles   | [object]      | Notification handles that will be notified of the incident during update.                                         |
| notification_handles | display_name           | string        | The name of the notified handle.                                                                                  |
| notification_handles | handle                 | string        | The handle used for the notification. This includes an email address, Slack channel, or workflow.                 |
| attributes           | title                  | string        | The title of the incident, which summarizes what happened.                                                        |
| data                 | id [*required*]   | string        | The incident's ID.                                                                                                |
| data                 | relationships          | object        | The incident's relationships for an update request.                                                               |
| relationships        | commander_user         | object        | Relationship to user.                                                                                             |
| commander_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`                                                                 |
| relationships        | integrations           | object        | A relationship reference for multiple integration metadata objects.                                               |
| integrations         | data [*required*] | [object]      | Integration metadata relationship array                                                                           |
| data                 | id [*required*]   | string        | A unique identifier that represents the integration metadata.                                                     |
| data                 | type [*required*] | enum          | Integration metadata resource type. Allowed enum values: `incident_integrations`                                  |
| relationships        | postmortem             | object        | A relationship reference for postmortems.                                                                         |
| postmortem           | data [*required*] | object        | The postmortem relationship data.                                                                                 |
| data                 | id [*required*]   | string        | A unique identifier that represents the postmortem.                                                               |
| data                 | type [*required*] | enum          | Incident postmortem resource type. Allowed enum values: `incident_postmortems`                                    |
| data                 | type [*required*] | enum          | Incident resource type. Allowed enum values: `incidents`                                                          |

{% /tab %}

{% tab title="Example" %}
##### 

```json
{
  "data": {
    "id": "00000000-0000-0000-1234-000000000000",
    "type": "incidents",
    "relationships": {
      "commander_user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    }
  }
}
```

##### 

```json
{
  "data": {
    "id": "00000000-0000-0000-1234-000000000000",
    "type": "incidents",
    "relationships": {
      "commander_user": {
        "data": null
      }
    }
  }
}
```

##### 

```json
{
  "data": {
    "id": "00000000-0000-0000-1234-000000000000",
    "type": "incidents",
    "attributes": {
      "fields": {
        "state": {
          "type": "dropdown",
          "value": "resolved"
        }
      },
      "title": "A test incident title-updated"
    }
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with an incident.

| Parent field          | Field                           | Type            | Description                                                                                                                                             |
| --------------------- | ------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                       | data [*required*]          | object          | Incident data from a response.                                                                                                                          |
| data                  | attributes                      | object          | The incident's attributes from a response.                                                                                                              |
| attributes            | archived                        | date-time       | Timestamp of when the incident was archived.                                                                                                            |
| attributes            | case_id                         | int64           | The incident case id.                                                                                                                                   |
| attributes            | created                         | date-time       | Timestamp when the incident was created.                                                                                                                |
| attributes            | customer_impact_duration        | int64           | Length of the incident's customer impact in seconds. Equals the difference between `customer_impact_start` and `customer_impact_end`.                   |
| attributes            | customer_impact_end             | date-time       | Timestamp when customers were no longer impacted by the incident.                                                                                       |
| attributes            | customer_impact_scope           | string          | A summary of the impact customers experienced during the incident.                                                                                      |
| attributes            | customer_impact_start           | date-time       | Timestamp when customers began being impacted by the incident.                                                                                          |
| attributes            | customer_impacted               | boolean         | A flag indicating whether the incident caused customer impact.                                                                                          |
| attributes            | declared                        | date-time       | Timestamp when the incident was declared.                                                                                                               |
| attributes            | declared_by                     | object          | Incident's non Datadog creator.                                                                                                                         |
| declared_by           | image_48_px                     | string          | Non Datadog creator `48px` image.                                                                                                                       |
| declared_by           | name                            | string          | Non Datadog creator name.                                                                                                                               |
| attributes            | declared_by_uuid                | string          | UUID of the user who declared the incident.                                                                                                             |
| attributes            | detected                        | date-time       | Timestamp when the incident was detected.                                                                                                               |
| attributes            | fields                          | object          | A condensed view of the user-defined fields attached to incidents.                                                                                      |
| additionalProperties  | <any-key>                       |  <oneOf>   | Dynamic fields for which selections can be made, with field names as keys.                                                                              |
| <any-key>             | Option 1                        | object          | A field with a single value selected.                                                                                                                   |
| Option 1              | type                            | enum            | Type of the single value field definitions. Allowed enum values: `dropdown,textbox`                                                                     |
| Option 1              | value                           | string          | The single value selected for this field.                                                                                                               |
| <any-key>             | Option 2                        | object          | A field with potentially multiple values selected.                                                                                                      |
| Option 2              | type                            | enum            | Type of the multiple value field definitions. Allowed enum values: `multiselect,textarray,metrictag,autocomplete`                                       |
| Option 2              | value                           | [string]        | The multiple values selected for this field.                                                                                                            |
| attributes            | incident_type_uuid              | string          | A unique identifier that represents an incident type.                                                                                                   |
| attributes            | is_test                         | boolean         | A flag indicating whether the incident is a test incident.                                                                                              |
| attributes            | modified                        | date-time       | Timestamp when the incident was last modified.                                                                                                          |
| attributes            | non_datadog_creator             | object          | Incident's non Datadog creator.                                                                                                                         |
| non_datadog_creator   | image_48_px                     | string          | Non Datadog creator `48px` image.                                                                                                                       |
| non_datadog_creator   | name                            | string          | Non Datadog creator name.                                                                                                                               |
| attributes            | notification_handles            | [object]        | Notification handles that will be notified of the incident during update.                                                                               |
| notification_handles  | display_name                    | string          | The name of the notified handle.                                                                                                                        |
| notification_handles  | handle                          | string          | The handle used for the notification. This includes an email address, Slack channel, or workflow.                                                       |
| attributes            | public_id                       | int64           | The monotonically increasing integer ID for the incident.                                                                                               |
| attributes            | resolved                        | date-time       | Timestamp when the incident's state was last changed from active or stable to resolved or completed.                                                    |
| attributes            | severity                        | enum            | The incident severity. Allowed enum values: `UNKNOWN,SEV-0,SEV-1,SEV-2,SEV-3,SEV-4,SEV-5`                                                               |
| attributes            | state                           | string          | The state incident.                                                                                                                                     |
| attributes            | time_to_detect                  | int64           | The amount of time in seconds to detect the incident. Equals the difference between `customer_impact_start` and `detected`.                             |
| attributes            | time_to_internal_response       | int64           | The amount of time in seconds to call incident after detection. Equals the difference of `detected` and `created`.                                      |
| attributes            | time_to_repair                  | int64           | The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between `customer_impact_end` and `detected`. |
| attributes            | time_to_resolve                 | int64           | The amount of time in seconds to resolve the incident after it was created. Equals the difference between `created` and `resolved`.                     |
| attributes            | title [*required*]         | string          | The title of the incident, which summarizes what happened.                                                                                              |
| attributes            | visibility                      | string          | The incident visibility status.                                                                                                                         |
| data                  | id [*required*]            | string          | The incident's ID.                                                                                                                                      |
| data                  | relationships                   | object          | The incident's relationships from a response.                                                                                                           |
| relationships         | attachments                     | object          | A relationship reference for attachments.                                                                                                               |
| attachments           | data [*required*]          | [object]        | An array of incident attachments.                                                                                                                       |
| data                  | id [*required*]            | string          | A unique identifier that represents the attachment.                                                                                                     |
| data                  | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments`                                                                      |
| relationships         | commander_user                  | object          | Relationship to user.                                                                                                                                   |
| commander_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`                                                                                                       |
| 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`                                                                                                       |
| relationships         | declared_by_user                | object          | Relationship to user.                                                                                                                                   |
| declared_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`                                                                                                       |
| relationships         | impacts                         | object          | Relationship to impacts.                                                                                                                                |
| impacts               | data [*required*]          | [object]        | An array of incident impacts.                                                                                                                           |
| data                  | id [*required*]            | string          | A unique identifier that represents the impact.                                                                                                         |
| data                  | type [*required*]          | enum            | The incident impacts type. Allowed enum values: `incident_impacts`                                                                                      |
| relationships         | integrations                    | object          | A relationship reference for multiple integration metadata objects.                                                                                     |
| integrations          | data [*required*]          | [object]        | Integration metadata relationship array                                                                                                                 |
| data                  | id [*required*]            | string          | A unique identifier that represents the integration metadata.                                                                                           |
| data                  | type [*required*]          | enum            | Integration metadata resource type. Allowed enum values: `incident_integrations`                                                                        |
| 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`                                                                                                       |
| relationships         | responders                      | object          | Relationship to incident responders.                                                                                                                    |
| responders            | data [*required*]          | [object]        | An array of incident responders.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the responder.                                                                                                      |
| data                  | type [*required*]          | enum            | The incident responders type. Allowed enum values: `incident_responders`                                                                                |
| relationships         | user_defined_fields             | object          | Relationship to incident user defined fields.                                                                                                           |
| user_defined_fields   | data [*required*]          | [object]        | An array of user defined fields.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the responder.                                                                                                      |
| data                  | type [*required*]          | enum            | The incident user defined fields type. Allowed enum values: `user_defined_field`                                                                        |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                                                                                                |
|                       | included                        | [ <oneOf>] | Included related resources that the user requested.                                                                                                     |
| included              | Option 1                        | object          | User object returned by the API.                                                                                                                        |
| Option 1              | attributes                      | object          | Attributes of user object returned by the API.                                                                                                          |
| attributes            | email                           | string          | Email of the user.                                                                                                                                      |
| attributes            | handle                          | string          | Handle of the user.                                                                                                                                     |
| attributes            | icon                            | string          | URL of the user's icon.                                                                                                                                 |
| attributes            | name                            | string          | Name of the user.                                                                                                                                       |
| attributes            | uuid                            | string          | UUID of the user.                                                                                                                                       |
| Option 1              | id                              | string          | ID of the user.                                                                                                                                         |
| Option 1              | type                            | enum            | Users resource type. Allowed enum values: `users`                                                                                                       |
| included              | Option 2                        | object          | Attachment data from a response.                                                                                                                        |
| Option 2              | attributes [*required*]    | object          | The attachment's attributes.                                                                                                                            |
| attributes            | attachment                      | object          | The attachment object.                                                                                                                                  |
| attachment            | documentUrl                     | string          | The URL of the attachment.                                                                                                                              |
| attachment            | title                           | string          | The title of the attachment.                                                                                                                            |
| attributes            | attachment_type                 | enum            | The type of the attachment. Allowed enum values: `postmortem,link`                                                                                      |
| attributes            | modified                        | date-time       | Timestamp when the attachment was last modified.                                                                                                        |
| Option 2              | id [*required*]            | string          | The unique identifier of the attachment.                                                                                                                |
| Option 2              | relationships [*required*] | object          | The attachment's resource relationships.                                                                                                                |
| relationships         | incident                        | object          | Relationship to incident.                                                                                                                               |
| incident              | data [*required*]          | object          | Relationship to incident object.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the incident.                                                                                                       |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                                                                                                |
| 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`                                                                                                       |
| Option 2              | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments`                                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived": "2019-09-19T10:00:00.000Z",
      "case_id": "integer",
      "created": "2019-09-19T10:00:00.000Z",
      "customer_impact_duration": "integer",
      "customer_impact_end": "2019-09-19T10:00:00.000Z",
      "customer_impact_scope": "An example customer impact scope",
      "customer_impact_start": "2019-09-19T10:00:00.000Z",
      "customer_impacted": false,
      "declared": "2019-09-19T10:00:00.000Z",
      "declared_by": {
        "image_48_px": "string",
        "name": "string"
      },
      "declared_by_uuid": "string",
      "detected": "2019-09-19T10:00:00.000Z",
      "fields": {
        "<any-key>": "undefined"
      },
      "incident_type_uuid": "00000000-0000-0000-0000-000000000000",
      "is_test": false,
      "modified": "2019-09-19T10:00:00.000Z",
      "non_datadog_creator": {
        "image_48_px": "string",
        "name": "string"
      },
      "notification_handles": [
        {
          "display_name": "Jane Doe",
          "handle": "@test.user@test.com"
        }
      ],
      "public_id": 1,
      "resolved": "2019-09-19T10:00:00.000Z",
      "severity": "UNKNOWN",
      "state": "string",
      "time_to_detect": "integer",
      "time_to_internal_response": "integer",
      "time_to_repair": "integer",
      "time_to_resolve": "integer",
      "title": "A test incident title",
      "visibility": "string"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "attachments": {
        "data": [
          {
            "id": "00000000-0000-abcd-1000-000000000000",
            "type": "incident_attachments"
          }
        ]
      },
      "commander_user": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "users"
        }
      },
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "declared_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "impacts": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_impacts"
          }
        ]
      },
      "integrations": {
        "data": [
          {
            "id": "00000000-abcd-0001-0000-000000000000",
            "type": "incident_integrations"
          }
        ]
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "responders": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "incident_responders"
          }
        ]
      },
      "user_defined_fields": {
        "data": [
          {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "user_defined_field"
          }
        ]
      }
    },
    "type": "incidents"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                          \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}" \
-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": {
    "id": "00000000-0000-0000-1234-000000000000",
    "type": "incidents",
    "relationships": {
      "commander_user": {
        "data": {
          "id": "string",
          "type": "users"
        }
      }
    }
  }
}
EOF
                        
##### 
                          \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}" \
-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": {
    "id": "00000000-0000-0000-1234-000000000000",
    "type": "incidents",
    "relationships": {
      "commander_user": {
        "data": null
      }
    }
  }
}
EOF
                        
##### 
                          \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}" \
-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": {
    "id": "00000000-0000-0000-1234-000000000000",
    "type": "incidents",
    "attributes": {
      "fields": {
        "state": {
          "type": "dropdown",
          "value": "resolved"
        }
      },
      "title": "A test incident title-updated"
    }
  }
}
EOF
                        
##### 

```go
// Add commander to an incident 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	// there is a valid "user" in the system
	UserDataID := os.Getenv("USER_DATA_ID")

	body := datadogV2.IncidentUpdateRequest{
		Data: datadogV2.IncidentUpdateData{
			Id:   IncidentDataID,
			Type: datadogV2.INCIDENTTYPE_INCIDENTS,
			Relationships: &datadogV2.IncidentUpdateRelationships{
				CommanderUser: *datadogV2.NewNullableNullableRelationshipToUser(&datadogV2.NullableRelationshipToUser{
					Data: *datadogV2.NewNullableNullableRelationshipToUserData(&datadogV2.NullableRelationshipToUserData{
						Id:   UserDataID,
						Type: datadogV2.USERSTYPE_USERS,
					}),
				}),
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateIncident", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.UpdateIncident(ctx, IncidentDataID, body, *datadogV2.NewUpdateIncidentOptionalParameters())

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

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

##### 

```go
// Remove commander from an incident 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	body := datadogV2.IncidentUpdateRequest{
		Data: datadogV2.IncidentUpdateData{
			Id:   IncidentDataID,
			Type: datadogV2.INCIDENTTYPE_INCIDENTS,
			Relationships: &datadogV2.IncidentUpdateRelationships{
				CommanderUser: *datadogV2.NewNullableNullableRelationshipToUser(&datadogV2.NullableRelationshipToUser{
					Data: *datadogV2.NewNullableNullableRelationshipToUserData(nil),
				}),
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateIncident", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.UpdateIncident(ctx, IncidentDataID, body, *datadogV2.NewUpdateIncidentOptionalParameters())

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

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

##### 

```go
// Update an existing incident 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	body := datadogV2.IncidentUpdateRequest{
		Data: datadogV2.IncidentUpdateData{
			Id:   IncidentDataID,
			Type: datadogV2.INCIDENTTYPE_INCIDENTS,
			Attributes: &datadogV2.IncidentUpdateAttributes{
				Fields: map[string]datadogV2.IncidentFieldAttributes{
					"state": datadogV2.IncidentFieldAttributes{
						IncidentFieldAttributesSingleValue: &datadogV2.IncidentFieldAttributesSingleValue{
							Type:  datadogV2.INCIDENTFIELDATTRIBUTESSINGLEVALUETYPE_DROPDOWN.Ptr(),
							Value: *datadog.NewNullableString(datadog.PtrString("resolved")),
						}},
				},
				Title: datadog.PtrString("A test incident title-updated"),
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateIncident", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.UpdateIncident(ctx, IncidentDataID, body, *datadogV2.NewUpdateIncidentOptionalParameters())

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

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

#### Instructions

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

```java
// Add commander to an incident 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.IncidentResponse;
import com.datadog.api.client.v2.model.IncidentType;
import com.datadog.api.client.v2.model.IncidentUpdateData;
import com.datadog.api.client.v2.model.IncidentUpdateRelationships;
import com.datadog.api.client.v2.model.IncidentUpdateRequest;
import com.datadog.api.client.v2.model.NullableRelationshipToUser;
import com.datadog.api.client.v2.model.NullableRelationshipToUserData;
import com.datadog.api.client.v2.model.UsersType;

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

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

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

    IncidentUpdateRequest body =
        new IncidentUpdateRequest()
            .data(
                new IncidentUpdateData()
                    .id(INCIDENT_DATA_ID)
                    .type(IncidentType.INCIDENTS)
                    .relationships(
                        new IncidentUpdateRelationships()
                            .commanderUser(
                                new NullableRelationshipToUser()
                                    .data(
                                        new NullableRelationshipToUserData()
                                            .id(USER_DATA_ID)
                                            .type(UsersType.USERS)))));

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

##### 

```java
// Remove commander from an incident 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.IncidentResponse;
import com.datadog.api.client.v2.model.IncidentType;
import com.datadog.api.client.v2.model.IncidentUpdateData;
import com.datadog.api.client.v2.model.IncidentUpdateRelationships;
import com.datadog.api.client.v2.model.IncidentUpdateRequest;
import com.datadog.api.client.v2.model.NullableRelationshipToUser;

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

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

    IncidentUpdateRequest body =
        new IncidentUpdateRequest()
            .data(
                new IncidentUpdateData()
                    .id(INCIDENT_DATA_ID)
                    .type(IncidentType.INCIDENTS)
                    .relationships(
                        new IncidentUpdateRelationships()
                            .commanderUser(new NullableRelationshipToUser().data(null))));

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

##### 

```java
// Update an existing incident 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.IncidentFieldAttributes;
import com.datadog.api.client.v2.model.IncidentFieldAttributesSingleValue;
import com.datadog.api.client.v2.model.IncidentFieldAttributesSingleValueType;
import com.datadog.api.client.v2.model.IncidentResponse;
import com.datadog.api.client.v2.model.IncidentType;
import com.datadog.api.client.v2.model.IncidentUpdateAttributes;
import com.datadog.api.client.v2.model.IncidentUpdateData;
import com.datadog.api.client.v2.model.IncidentUpdateRequest;
import java.util.Map;

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

    // there is a valid "incident" in the system
    String INCIDENT_DATA_ATTRIBUTES_TITLE = System.getenv("INCIDENT_DATA_ATTRIBUTES_TITLE");
    String INCIDENT_DATA_ID = System.getenv("INCIDENT_DATA_ID");

    IncidentUpdateRequest body =
        new IncidentUpdateRequest()
            .data(
                new IncidentUpdateData()
                    .id(INCIDENT_DATA_ID)
                    .type(IncidentType.INCIDENTS)
                    .attributes(
                        new IncidentUpdateAttributes()
                            .fields(
                                Map.ofEntries(
                                    Map.entry(
                                        "state",
                                        new IncidentFieldAttributes(
                                            new IncidentFieldAttributesSingleValue()
                                                .type(
                                                    IncidentFieldAttributesSingleValueType.DROPDOWN)
                                                .value("resolved")))))
                            .title("A test incident title-updated")));

    try {
      IncidentResponse result = apiInstance.updateIncident(INCIDENT_DATA_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#updateIncident");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Add commander to an incident 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 import IncidentType
from datadog_api_client.v2.model.incident_update_data import IncidentUpdateData
from datadog_api_client.v2.model.incident_update_relationships import IncidentUpdateRelationships
from datadog_api_client.v2.model.incident_update_request import IncidentUpdateRequest
from datadog_api_client.v2.model.nullable_relationship_to_user import NullableRelationshipToUser
from datadog_api_client.v2.model.nullable_relationship_to_user_data import NullableRelationshipToUserData
from datadog_api_client.v2.model.users_type import UsersType

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

# there is a valid "user" in the system
USER_DATA_ID = environ["USER_DATA_ID"]

body = IncidentUpdateRequest(
    data=IncidentUpdateData(
        id=INCIDENT_DATA_ID,
        type=IncidentType.INCIDENTS,
        relationships=IncidentUpdateRelationships(
            commander_user=NullableRelationshipToUser(
                data=NullableRelationshipToUserData(
                    id=USER_DATA_ID,
                    type=UsersType.USERS,
                ),
            ),
        ),
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_incident"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.update_incident(incident_id=INCIDENT_DATA_ID, body=body)

    print(response)
```

##### 

```python
"""
Remove commander from an incident 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 import IncidentType
from datadog_api_client.v2.model.incident_update_data import IncidentUpdateData
from datadog_api_client.v2.model.incident_update_relationships import IncidentUpdateRelationships
from datadog_api_client.v2.model.incident_update_request import IncidentUpdateRequest
from datadog_api_client.v2.model.nullable_relationship_to_user import NullableRelationshipToUser

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

body = IncidentUpdateRequest(
    data=IncidentUpdateData(
        id=INCIDENT_DATA_ID,
        type=IncidentType.INCIDENTS,
        relationships=IncidentUpdateRelationships(
            commander_user=NullableRelationshipToUser(
                data=None,
            ),
        ),
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_incident"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.update_incident(incident_id=INCIDENT_DATA_ID, body=body)

    print(response)
```

##### 

```python
"""
Update an existing incident 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_field_attributes_single_value import IncidentFieldAttributesSingleValue
from datadog_api_client.v2.model.incident_field_attributes_single_value_type import (
    IncidentFieldAttributesSingleValueType,
)
from datadog_api_client.v2.model.incident_type import IncidentType
from datadog_api_client.v2.model.incident_update_attributes import IncidentUpdateAttributes
from datadog_api_client.v2.model.incident_update_data import IncidentUpdateData
from datadog_api_client.v2.model.incident_update_request import IncidentUpdateRequest

# there is a valid "incident" in the system
INCIDENT_DATA_ATTRIBUTES_TITLE = environ["INCIDENT_DATA_ATTRIBUTES_TITLE"]
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

body = IncidentUpdateRequest(
    data=IncidentUpdateData(
        id=INCIDENT_DATA_ID,
        type=IncidentType.INCIDENTS,
        attributes=IncidentUpdateAttributes(
            fields=dict(
                state=IncidentFieldAttributesSingleValue(
                    type=IncidentFieldAttributesSingleValueType.DROPDOWN,
                    value="resolved",
                ),
            ),
            title="A test incident title-updated",
        ),
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_incident"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.update_incident(incident_id=INCIDENT_DATA_ID, body=body)

    print(response)
```

#### Instructions

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

```ruby
# Add commander to an incident returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

# there is a valid "user" in the system
USER_DATA_ID = ENV["USER_DATA_ID"]

body = DatadogAPIClient::V2::IncidentUpdateRequest.new({
  data: DatadogAPIClient::V2::IncidentUpdateData.new({
    id: INCIDENT_DATA_ID,
    type: DatadogAPIClient::V2::IncidentType::INCIDENTS,
    relationships: DatadogAPIClient::V2::IncidentUpdateRelationships.new({
      commander_user: DatadogAPIClient::V2::NullableRelationshipToUser.new({
        data: DatadogAPIClient::V2::NullableRelationshipToUserData.new({
          id: USER_DATA_ID,
          type: DatadogAPIClient::V2::UsersType::USERS,
        }),
      }),
    }),
  }),
})
p api_instance.update_incident(INCIDENT_DATA_ID, body)
```

##### 

```ruby
# Remove commander from an incident returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

body = DatadogAPIClient::V2::IncidentUpdateRequest.new({
  data: DatadogAPIClient::V2::IncidentUpdateData.new({
    id: INCIDENT_DATA_ID,
    type: DatadogAPIClient::V2::IncidentType::INCIDENTS,
    relationships: DatadogAPIClient::V2::IncidentUpdateRelationships.new({
      commander_user: DatadogAPIClient::V2::NullableRelationshipToUser.new({
        data: nil,
      }),
    }),
  }),
})
p api_instance.update_incident(INCIDENT_DATA_ID, body)
```

##### 

```ruby
# Update an existing incident returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ATTRIBUTES_TITLE = ENV["INCIDENT_DATA_ATTRIBUTES_TITLE"]
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

body = DatadogAPIClient::V2::IncidentUpdateRequest.new({
  data: DatadogAPIClient::V2::IncidentUpdateData.new({
    id: INCIDENT_DATA_ID,
    type: DatadogAPIClient::V2::IncidentType::INCIDENTS,
    attributes: DatadogAPIClient::V2::IncidentUpdateAttributes.new({
      fields: {
        state: DatadogAPIClient::V2::IncidentFieldAttributesSingleValue.new({
          type: DatadogAPIClient::V2::IncidentFieldAttributesSingleValueType::DROPDOWN,
          value: "resolved",
        }),
      },
      title: "A test incident title-updated",
    }),
  }),
})
p api_instance.update_incident(INCIDENT_DATA_ID, body)
```

#### Instructions

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

```rust
// Add commander to an incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams;
use datadog_api_client::datadogV2::model::IncidentType;
use datadog_api_client::datadogV2::model::IncidentUpdateData;
use datadog_api_client::datadogV2::model::IncidentUpdateRelationships;
use datadog_api_client::datadogV2::model::IncidentUpdateRequest;
use datadog_api_client::datadogV2::model::NullableRelationshipToUser;
use datadog_api_client::datadogV2::model::NullableRelationshipToUserData;
use datadog_api_client::datadogV2::model::UsersType;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // there is a valid "user" in the system
    let user_data_id = std::env::var("USER_DATA_ID").unwrap();
    let body = IncidentUpdateRequest::new(
        IncidentUpdateData::new(incident_data_id.clone(), IncidentType::INCIDENTS).relationships(
            IncidentUpdateRelationships::new().commander_user(Some(
                NullableRelationshipToUser::new(Some(NullableRelationshipToUserData::new(
                    user_data_id.clone(),
                    UsersType::USERS,
                ))),
            )),
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident(
            incident_data_id.clone(),
            body,
            UpdateIncidentOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

##### 

```rust
// Remove commander from an incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams;
use datadog_api_client::datadogV2::model::IncidentType;
use datadog_api_client::datadogV2::model::IncidentUpdateData;
use datadog_api_client::datadogV2::model::IncidentUpdateRelationships;
use datadog_api_client::datadogV2::model::IncidentUpdateRequest;
use datadog_api_client::datadogV2::model::NullableRelationshipToUser;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let body = IncidentUpdateRequest::new(
        IncidentUpdateData::new(incident_data_id.clone(), IncidentType::INCIDENTS).relationships(
            IncidentUpdateRelationships::new()
                .commander_user(Some(NullableRelationshipToUser::new(None))),
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident(
            incident_data_id.clone(),
            body,
            UpdateIncidentOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

##### 

```rust
// Update an existing incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentOptionalParams;
use datadog_api_client::datadogV2::model::IncidentFieldAttributes;
use datadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValue;
use datadog_api_client::datadogV2::model::IncidentFieldAttributesSingleValueType;
use datadog_api_client::datadogV2::model::IncidentType;
use datadog_api_client::datadogV2::model::IncidentUpdateAttributes;
use datadog_api_client::datadogV2::model::IncidentUpdateData;
use datadog_api_client::datadogV2::model::IncidentUpdateRequest;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let body = IncidentUpdateRequest::new(
        IncidentUpdateData::new(incident_data_id.clone(), IncidentType::INCIDENTS).attributes(
            IncidentUpdateAttributes::new()
                .fields(BTreeMap::from([(
                    "state".to_string(),
                    IncidentFieldAttributes::IncidentFieldAttributesSingleValue(Box::new(
                        IncidentFieldAttributesSingleValue::new()
                            .type_(IncidentFieldAttributesSingleValueType::DROPDOWN)
                            .value(Some("resolved".to_string())),
                    )),
                )]))
                .title("A test incident title-updated".to_string()),
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident(
            incident_data_id.clone(),
            body,
            UpdateIncidentOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Add commander to an incident returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateIncident"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

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

const params: v2.IncidentsApiUpdateIncidentRequest = {
  body: {
    data: {
      id: INCIDENT_DATA_ID,
      type: "incidents",
      relationships: {
        commanderUser: {
          data: {
            id: USER_DATA_ID,
            type: "users",
          },
        },
      },
    },
  },
  incidentId: INCIDENT_DATA_ID,
};

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

##### 

```typescript
/**
 * Remove commander from an incident returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateIncident"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiUpdateIncidentRequest = {
  body: {
    data: {
      id: INCIDENT_DATA_ID,
      type: "incidents",
      relationships: {
        commanderUser: {
          data: null,
        },
      },
    },
  },
  incidentId: INCIDENT_DATA_ID,
};

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

##### 

```typescript
/**
 * Update an existing incident returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateIncident"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiUpdateIncidentRequest = {
  body: {
    data: {
      id: INCIDENT_DATA_ID,
      type: "incidents",
      attributes: {
        fields: {
          state: {
            type: "dropdown",
            value: "resolved",
          },
        },
        title: "A test incident title-updated",
      },
    },
  },
  incidentId: INCIDENT_DATA_ID,
};

apiInstance
  .updateIncident(params)
  .then((data: v2.IncidentResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Delete an existing incident{% #delete-an-existing-incident %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                        |
| ----------------- | ------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/incidents/{incident_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/incidents/{incident_id}      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/incidents/{incident_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/incidents/{incident_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/incidents/{incident_id} |

### Overview

Deletes an existing incident from the users organization. This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description               |
| ----------------------------- | ------ | ------------------------- |
| incident_id [*required*] | string | The UUID of the incident. |

### Response

{% tab title="204" %}
OK
{% /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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Delete an existing incident returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["delete_incident"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    api_instance.delete_incident(
        incident_id=INCIDENT_DATA_ID,
    )
```

#### Instructions

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

```ruby
# Delete an existing incident returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]
api_instance.delete_incident(INCIDENT_DATA_ID)
```

#### Instructions

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

```go
// Delete an existing incident returns "OK" response

package main

import (
	"context"
	"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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteIncident", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	r, err := api.DeleteIncident(ctx, IncidentDataID)

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

#### Instructions

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

```java
// Delete an existing incident returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;

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

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

    try {
      apiInstance.deleteIncident(INCIDENT_DATA_ID);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#deleteIncident");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Delete an existing incident returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncident", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.delete_incident(incident_data_id.clone()).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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Delete an existing incident returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteIncident"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiDeleteIncidentRequest = {
  incidentId: INCIDENT_DATA_ID,
};

apiInstance
  .deleteIncident(params)
  .then((data: any) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Create postmortem attachment{% #create-postmortem-attachment %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta and it's subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                              |
| ----------------- | ----------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortems |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortems |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/incidents/{incident_id}/attachments/postmortems      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/incidents/{incident_id}/attachments/postmortems      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortems     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortems |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/attachments/postmortems |

### Overview

Create a postmortem attachment for an incident.

### Arguments

#### Path Parameters

| Name                          | Type   | Description            |
| ----------------------------- | ------ | ---------------------- |
| incident_id [*required*] | string | The ID of the incident |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                        | Type     | Description                                                                        |
| ------------ | ---------------------------- | -------- | ---------------------------------------------------------------------------------- |
|              | data [*required*]       | object   | Postmortem attachment data                                                         |
| data         | attributes [*required*] | object   | Postmortem attachment attributes                                                   |
| attributes   | cells                        | [object] | The cells of the postmortem                                                        |
| cells        | attributes                   | object   | Attributes of a postmortem cell                                                    |
| attributes   | definition                   | object   | Definition of a postmortem cell                                                    |
| definition   | content                      | string   | The content of the cell in markdown format                                         |
| cells        | id                           | string   | The unique identifier of the cell                                                  |
| cells        | type                         | enum     | The postmortem cell resource type. Allowed enum values: `markdown`                 |
| attributes   | content                      | string   | The content of the postmortem                                                      |
| attributes   | postmortem_template_id       | string   | The ID of the postmortem template                                                  |
| attributes   | title                        | string   | The title of the postmortem                                                        |
| data         | type [*required*]       | enum     | The incident attachment resource type. Allowed enum values: `incident_attachments` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "cells": [
        {
          "attributes": {
            "definition": {
              "content": "## Incident Summary\nThis incident was caused by..."
            }
          },
          "id": "cell-1",
          "type": "markdown"
        }
      ],
      "content": "# Incident Report - IR-123\n[...]",
      "postmortem_template_id": "93645509-874e-45c4-adfa-623bfeaead89-123",
      "title": "Postmortem-IR-123"
    },
    "type": "incident_attachments"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
An attachment response containing the attachment data and related objects.

| Parent field          | Field                           | Type            | Description                                                                        |
| --------------------- | ------------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|                       | data                            | object          | Attachment data from a response.                                                   |
| data                  | attributes [*required*]    | object          | The attachment's attributes.                                                       |
| attributes            | attachment                      | object          | The attachment object.                                                             |
| attachment            | documentUrl                     | string          | The URL of the attachment.                                                         |
| attachment            | title                           | string          | The title of the attachment.                                                       |
| attributes            | attachment_type                 | enum            | The type of the attachment. Allowed enum values: `postmortem,link`                 |
| attributes            | modified                        | date-time       | Timestamp when the attachment was last modified.                                   |
| data                  | id [*required*]            | string          | The unique identifier of the attachment.                                           |
| data                  | relationships [*required*] | object          | The attachment's resource relationships.                                           |
| relationships         | incident                        | object          | Relationship to incident.                                                          |
| incident              | data [*required*]          | object          | Relationship to incident object.                                                   |
| data                  | id [*required*]            | string          | A unique identifier that represents the incident.                                  |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                           |
| 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`                                  |
| data                  | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments` |
|                       | included                        | [ <oneOf>] |
| included              | Option 1                        | object          | User object returned by the API.                                                   |
| Option 1              | attributes                      | object          | Attributes of user object returned by the API.                                     |
| attributes            | email                           | string          | Email of the user.                                                                 |
| attributes            | handle                          | string          | Handle of the user.                                                                |
| attributes            | icon                            | string          | URL of the user's icon.                                                            |
| attributes            | name                            | string          | Name of the user.                                                                  |
| attributes            | uuid                            | string          | UUID of the user.                                                                  |
| Option 1              | id                              | string          | ID of the user.                                                                    |
| Option 1              | type                            | enum            | Users resource type. Allowed enum values: `users`                                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "attachment": {
        "documentUrl": "https://app.datadoghq.com/notebook/123/Postmortem-IR-123",
        "title": "Postmortem IR-123"
      },
      "attachment_type": "postmortem",
      "modified": "2025-01-01T01:01:01.000000001Z"
    },
    "id": "00000000-abcd-0002-0000-000000000000",
    "relationships": {
      "incident": {
        "data": {
          "id": "00000000-0000-0000-1234-000000000000",
          "type": "incidents"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_attachments"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /tab %}

{% /tab %}

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

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "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

##### 
                  \# Path parametersexport incident_id="00000000-0000-0000-0000-000000000000"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/attachments/postmortems" \
-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": {},
    "type": "incident_attachments"
  }
}
EOF
                
{% /tab %}

## Get a list of incidents{% #get-a-list-of-incidents %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                       |
| ----------------- | -------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents |

### Overview

Get all incidents for the user's organization. This endpoint requires the `incident_read` permission.

OAuth apps require the `incident_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Query Strings

| Name         | Type    | Description                                                                  |
| ------------ | ------- | ---------------------------------------------------------------------------- |
| include      | array   | Specifies which types of related objects should be included in the response. |
| page[size]   | integer | Size for a given page. The maximum allowed value is 100.                     |
| page[offset] | integer | Specific offset to use as the beginning of the returned page.                |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with a list of incidents.

| Parent field          | Field                           | Type            | Description                                                                                                                                             |
| --------------------- | ------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                       | data [*required*]          | [object]        | An array of incidents.                                                                                                                                  |
| data                  | attributes                      | object          | The incident's attributes from a response.                                                                                                              |
| attributes            | archived                        | date-time       | Timestamp of when the incident was archived.                                                                                                            |
| attributes            | case_id                         | int64           | The incident case id.                                                                                                                                   |
| attributes            | created                         | date-time       | Timestamp when the incident was created.                                                                                                                |
| attributes            | customer_impact_duration        | int64           | Length of the incident's customer impact in seconds. Equals the difference between `customer_impact_start` and `customer_impact_end`.                   |
| attributes            | customer_impact_end             | date-time       | Timestamp when customers were no longer impacted by the incident.                                                                                       |
| attributes            | customer_impact_scope           | string          | A summary of the impact customers experienced during the incident.                                                                                      |
| attributes            | customer_impact_start           | date-time       | Timestamp when customers began being impacted by the incident.                                                                                          |
| attributes            | customer_impacted               | boolean         | A flag indicating whether the incident caused customer impact.                                                                                          |
| attributes            | declared                        | date-time       | Timestamp when the incident was declared.                                                                                                               |
| attributes            | declared_by                     | object          | Incident's non Datadog creator.                                                                                                                         |
| declared_by           | image_48_px                     | string          | Non Datadog creator `48px` image.                                                                                                                       |
| declared_by           | name                            | string          | Non Datadog creator name.                                                                                                                               |
| attributes            | declared_by_uuid                | string          | UUID of the user who declared the incident.                                                                                                             |
| attributes            | detected                        | date-time       | Timestamp when the incident was detected.                                                                                                               |
| attributes            | fields                          | object          | A condensed view of the user-defined fields attached to incidents.                                                                                      |
| additionalProperties  | <any-key>                       |  <oneOf>   | Dynamic fields for which selections can be made, with field names as keys.                                                                              |
| <any-key>             | Option 1                        | object          | A field with a single value selected.                                                                                                                   |
| Option 1              | type                            | enum            | Type of the single value field definitions. Allowed enum values: `dropdown,textbox`                                                                     |
| Option 1              | value                           | string          | The single value selected for this field.                                                                                                               |
| <any-key>             | Option 2                        | object          | A field with potentially multiple values selected.                                                                                                      |
| Option 2              | type                            | enum            | Type of the multiple value field definitions. Allowed enum values: `multiselect,textarray,metrictag,autocomplete`                                       |
| Option 2              | value                           | [string]        | The multiple values selected for this field.                                                                                                            |
| attributes            | incident_type_uuid              | string          | A unique identifier that represents an incident type.                                                                                                   |
| attributes            | is_test                         | boolean         | A flag indicating whether the incident is a test incident.                                                                                              |
| attributes            | modified                        | date-time       | Timestamp when the incident was last modified.                                                                                                          |
| attributes            | non_datadog_creator             | object          | Incident's non Datadog creator.                                                                                                                         |
| non_datadog_creator   | image_48_px                     | string          | Non Datadog creator `48px` image.                                                                                                                       |
| non_datadog_creator   | name                            | string          | Non Datadog creator name.                                                                                                                               |
| attributes            | notification_handles            | [object]        | Notification handles that will be notified of the incident during update.                                                                               |
| notification_handles  | display_name                    | string          | The name of the notified handle.                                                                                                                        |
| notification_handles  | handle                          | string          | The handle used for the notification. This includes an email address, Slack channel, or workflow.                                                       |
| attributes            | public_id                       | int64           | The monotonically increasing integer ID for the incident.                                                                                               |
| attributes            | resolved                        | date-time       | Timestamp when the incident's state was last changed from active or stable to resolved or completed.                                                    |
| attributes            | severity                        | enum            | The incident severity. Allowed enum values: `UNKNOWN,SEV-0,SEV-1,SEV-2,SEV-3,SEV-4,SEV-5`                                                               |
| attributes            | state                           | string          | The state incident.                                                                                                                                     |
| attributes            | time_to_detect                  | int64           | The amount of time in seconds to detect the incident. Equals the difference between `customer_impact_start` and `detected`.                             |
| attributes            | time_to_internal_response       | int64           | The amount of time in seconds to call incident after detection. Equals the difference of `detected` and `created`.                                      |
| attributes            | time_to_repair                  | int64           | The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between `customer_impact_end` and `detected`. |
| attributes            | time_to_resolve                 | int64           | The amount of time in seconds to resolve the incident after it was created. Equals the difference between `created` and `resolved`.                     |
| attributes            | title [*required*]         | string          | The title of the incident, which summarizes what happened.                                                                                              |
| attributes            | visibility                      | string          | The incident visibility status.                                                                                                                         |
| data                  | id [*required*]            | string          | The incident's ID.                                                                                                                                      |
| data                  | relationships                   | object          | The incident's relationships from a response.                                                                                                           |
| relationships         | attachments                     | object          | A relationship reference for attachments.                                                                                                               |
| attachments           | data [*required*]          | [object]        | An array of incident attachments.                                                                                                                       |
| data                  | id [*required*]            | string          | A unique identifier that represents the attachment.                                                                                                     |
| data                  | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments`                                                                      |
| relationships         | commander_user                  | object          | Relationship to user.                                                                                                                                   |
| commander_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`                                                                                                       |
| 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`                                                                                                       |
| relationships         | declared_by_user                | object          | Relationship to user.                                                                                                                                   |
| declared_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`                                                                                                       |
| relationships         | impacts                         | object          | Relationship to impacts.                                                                                                                                |
| impacts               | data [*required*]          | [object]        | An array of incident impacts.                                                                                                                           |
| data                  | id [*required*]            | string          | A unique identifier that represents the impact.                                                                                                         |
| data                  | type [*required*]          | enum            | The incident impacts type. Allowed enum values: `incident_impacts`                                                                                      |
| relationships         | integrations                    | object          | A relationship reference for multiple integration metadata objects.                                                                                     |
| integrations          | data [*required*]          | [object]        | Integration metadata relationship array                                                                                                                 |
| data                  | id [*required*]            | string          | A unique identifier that represents the integration metadata.                                                                                           |
| data                  | type [*required*]          | enum            | Integration metadata resource type. Allowed enum values: `incident_integrations`                                                                        |
| 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`                                                                                                       |
| relationships         | responders                      | object          | Relationship to incident responders.                                                                                                                    |
| responders            | data [*required*]          | [object]        | An array of incident responders.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the responder.                                                                                                      |
| data                  | type [*required*]          | enum            | The incident responders type. Allowed enum values: `incident_responders`                                                                                |
| relationships         | user_defined_fields             | object          | Relationship to incident user defined fields.                                                                                                           |
| user_defined_fields   | data [*required*]          | [object]        | An array of user defined fields.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the responder.                                                                                                      |
| data                  | type [*required*]          | enum            | The incident user defined fields type. Allowed enum values: `user_defined_field`                                                                        |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                                                                                                |
|                       | included                        | [ <oneOf>] | Included related resources that the user requested.                                                                                                     |
| included              | Option 1                        | object          | User object returned by the API.                                                                                                                        |
| Option 1              | attributes                      | object          | Attributes of user object returned by the API.                                                                                                          |
| attributes            | email                           | string          | Email of the user.                                                                                                                                      |
| attributes            | handle                          | string          | Handle of the user.                                                                                                                                     |
| attributes            | icon                            | string          | URL of the user's icon.                                                                                                                                 |
| attributes            | name                            | string          | Name of the user.                                                                                                                                       |
| attributes            | uuid                            | string          | UUID of the user.                                                                                                                                       |
| Option 1              | id                              | string          | ID of the user.                                                                                                                                         |
| Option 1              | type                            | enum            | Users resource type. Allowed enum values: `users`                                                                                                       |
| included              | Option 2                        | object          | Attachment data from a response.                                                                                                                        |
| Option 2              | attributes [*required*]    | object          | The attachment's attributes.                                                                                                                            |
| attributes            | attachment                      | object          | The attachment object.                                                                                                                                  |
| attachment            | documentUrl                     | string          | The URL of the attachment.                                                                                                                              |
| attachment            | title                           | string          | The title of the attachment.                                                                                                                            |
| attributes            | attachment_type                 | enum            | The type of the attachment. Allowed enum values: `postmortem,link`                                                                                      |
| attributes            | modified                        | date-time       | Timestamp when the attachment was last modified.                                                                                                        |
| Option 2              | id [*required*]            | string          | The unique identifier of the attachment.                                                                                                                |
| Option 2              | relationships [*required*] | object          | The attachment's resource relationships.                                                                                                                |
| relationships         | incident                        | object          | Relationship to incident.                                                                                                                               |
| incident              | data [*required*]          | object          | Relationship to incident object.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the incident.                                                                                                       |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                                                                                                |
| 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`                                                                                                       |
| Option 2              | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments`                                                                      |
|                       | meta                            | object          | The metadata object containing pagination metadata.                                                                                                     |
| meta                  | pagination                      | object          | Pagination properties.                                                                                                                                  |
| pagination            | next_offset                     | int64           | The index of the first element in the next page of results. Equal to page size added to the current offset.                                             |
| pagination            | offset                          | int64           | The index of the first element in the results.                                                                                                          |
| pagination            | size                            | int64           | Maximum size of pages to return.                                                                                                                        |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "archived": "2019-09-19T10:00:00.000Z",
        "case_id": "integer",
        "created": "2019-09-19T10:00:00.000Z",
        "customer_impact_duration": "integer",
        "customer_impact_end": "2019-09-19T10:00:00.000Z",
        "customer_impact_scope": "An example customer impact scope",
        "customer_impact_start": "2019-09-19T10:00:00.000Z",
        "customer_impacted": false,
        "declared": "2019-09-19T10:00:00.000Z",
        "declared_by": {
          "image_48_px": "string",
          "name": "string"
        },
        "declared_by_uuid": "string",
        "detected": "2019-09-19T10:00:00.000Z",
        "fields": {
          "<any-key>": "undefined"
        },
        "incident_type_uuid": "00000000-0000-0000-0000-000000000000",
        "is_test": false,
        "modified": "2019-09-19T10:00:00.000Z",
        "non_datadog_creator": {
          "image_48_px": "string",
          "name": "string"
        },
        "notification_handles": [
          {
            "display_name": "Jane Doe",
            "handle": "@test.user@test.com"
          }
        ],
        "public_id": 1,
        "resolved": "2019-09-19T10:00:00.000Z",
        "severity": "UNKNOWN",
        "state": "string",
        "time_to_detect": "integer",
        "time_to_internal_response": "integer",
        "time_to_repair": "integer",
        "time_to_resolve": "integer",
        "title": "A test incident title",
        "visibility": "string"
      },
      "id": "00000000-0000-0000-1234-000000000000",
      "relationships": {
        "attachments": {
          "data": [
            {
              "id": "00000000-0000-abcd-1000-000000000000",
              "type": "incident_attachments"
            }
          ]
        },
        "commander_user": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "users"
          }
        },
        "created_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "declared_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "impacts": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "incident_impacts"
            }
          ]
        },
        "integrations": {
          "data": [
            {
              "id": "00000000-abcd-0001-0000-000000000000",
              "type": "incident_integrations"
            }
          ]
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "responders": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "incident_responders"
            }
          ]
        },
        "user_defined_fields": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "user_defined_field"
            }
          ]
        }
      },
      "type": "incidents"
    }
  ],
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ],
  "meta": {
    "pagination": {
      "next_offset": 1000,
      "offset": 10,
      "size": 1000
    }
  }
}
```

{% /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

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Get a list of incidents returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

configuration = Configuration()
configuration.unstable_operations["list_incidents"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.list_incidents()

    print(response)
```

#### Instructions

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

```ruby
# Get a list of incidents returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.list_incidents".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.list_incidents()
```

#### Instructions

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

```go
// Get a list of incidents 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListIncidents", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.ListIncidents(ctx, *datadogV2.NewListIncidentsOptionalParameters())

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

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

#### Instructions

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

```java
// Get a list of incidents 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.IncidentsResponse;

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

    try {
      IncidentsResponse result = apiInstance.listIncidents();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#listIncidents");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get a list of incidents returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::ListIncidentsOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidents", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .list_incidents(ListIncidentsOptionalParams::default())
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get a list of incidents returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listIncidents"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

apiInstance
  .listIncidents()
  .then((data: v2.IncidentsResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Search for incidents{% #search-for-incidents %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                              |
| ----------------- | --------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/search |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/search |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/search      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/search      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/search     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/search |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/search |

### Overview

Search for incidents matching a certain query. This endpoint requires the `incident_read` permission.

OAuth apps require the `incident_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Query Strings

| Name                    | Type    | Description                                                                                                                                                                                                                                         |
| ----------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| include                 | enum    | Specifies which types of related objects should be included in the response.Allowed enum values: `users, attachments`                                                                                                                               |
| query [*required*] | string  | Specifies which incidents should be returned. The query can contain any number of incident facets joined by `ANDs`, along with multiple values for each of those facets joined by `OR`s. For example: `state:active AND severity:(SEV-2 OR SEV-1)`. |
| sort                    | enum    | Specifies the order of returned incidents.Allowed enum values: `created, -created`                                                                                                                                                                  |
| page[size]              | integer | Size for a given page. The maximum allowed value is 100.                                                                                                                                                                                            |
| page[offset]            | integer | Specific offset to use as the beginning of the returned page.                                                                                                                                                                                       |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with incidents and facets.

| Parent field          | Field                           | Type            | Description                                                                                                                                             |
| --------------------- | ------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                       | data [*required*]          | object          | Data returned by an incident search.                                                                                                                    |
| data                  | attributes                      | object          | Attributes returned by an incident search.                                                                                                              |
| attributes            | facets [*required*]        | object          | Facet data for incidents returned by a search query.                                                                                                    |
| facets                | commander                       | [object]        | Facet data for incident commander users.                                                                                                                |
| commander             | count                           | int32           | Count of the facet value appearing in search results.                                                                                                   |
| commander             | email                           | string          | Email of the user.                                                                                                                                      |
| commander             | handle                          | string          | Handle of the user.                                                                                                                                     |
| commander             | name                            | string          | Name of the user.                                                                                                                                       |
| commander             | uuid                            | string          | ID of the user.                                                                                                                                         |
| facets                | created_by                      | [object]        | Facet data for incident creator users.                                                                                                                  |
| created_by            | count                           | int32           | Count of the facet value appearing in search results.                                                                                                   |
| created_by            | email                           | string          | Email of the user.                                                                                                                                      |
| created_by            | handle                          | string          | Handle of the user.                                                                                                                                     |
| created_by            | name                            | string          | Name of the user.                                                                                                                                       |
| created_by            | uuid                            | string          | ID of the user.                                                                                                                                         |
| facets                | fields                          | [object]        | Facet data for incident property fields.                                                                                                                |
| fields                | aggregates                      | object          | Aggregate information for numeric incident data.                                                                                                        |
| aggregates            | max                             | double          | Maximum value of the numeric aggregates.                                                                                                                |
| aggregates            | min                             | double          | Minimum value of the numeric aggregates.                                                                                                                |
| fields                | facets [*required*]        | [object]        | Facet data for the property field of an incident.                                                                                                       |
| facets                | count                           | int32           | Count of the facet value appearing in search results.                                                                                                   |
| facets                | name                            | string          | The facet value appearing in search results.                                                                                                            |
| fields                | name [*required*]          | string          | Name of the incident property field.                                                                                                                    |
| facets                | impact                          | [object]        | Facet data for incident impact attributes.                                                                                                              |
| impact                | count                           | int32           | Count of the facet value appearing in search results.                                                                                                   |
| impact                | name                            | string          | The facet value appearing in search results.                                                                                                            |
| facets                | last_modified_by                | [object]        | Facet data for incident last modified by users.                                                                                                         |
| last_modified_by      | count                           | int32           | Count of the facet value appearing in search results.                                                                                                   |
| last_modified_by      | email                           | string          | Email of the user.                                                                                                                                      |
| last_modified_by      | handle                          | string          | Handle of the user.                                                                                                                                     |
| last_modified_by      | name                            | string          | Name of the user.                                                                                                                                       |
| last_modified_by      | uuid                            | string          | ID of the user.                                                                                                                                         |
| facets                | postmortem                      | [object]        | Facet data for incident postmortem existence.                                                                                                           |
| postmortem            | count                           | int32           | Count of the facet value appearing in search results.                                                                                                   |
| postmortem            | name                            | string          | The facet value appearing in search results.                                                                                                            |
| facets                | responder                       | [object]        | Facet data for incident responder users.                                                                                                                |
| responder             | count                           | int32           | Count of the facet value appearing in search results.                                                                                                   |
| responder             | email                           | string          | Email of the user.                                                                                                                                      |
| responder             | handle                          | string          | Handle of the user.                                                                                                                                     |
| responder             | name                            | string          | Name of the user.                                                                                                                                       |
| responder             | uuid                            | string          | ID of the user.                                                                                                                                         |
| facets                | severity                        | [object]        | Facet data for incident severity attributes.                                                                                                            |
| severity              | count                           | int32           | Count of the facet value appearing in search results.                                                                                                   |
| severity              | name                            | string          | The facet value appearing in search results.                                                                                                            |
| facets                | state                           | [object]        | Facet data for incident state attributes.                                                                                                               |
| state                 | count                           | int32           | Count of the facet value appearing in search results.                                                                                                   |
| state                 | name                            | string          | The facet value appearing in search results.                                                                                                            |
| facets                | time_to_repair                  | [object]        | Facet data for incident time to repair metrics.                                                                                                         |
| time_to_repair        | aggregates [*required*]    | object          | Aggregate information for numeric incident data.                                                                                                        |
| aggregates            | max                             | double          | Maximum value of the numeric aggregates.                                                                                                                |
| aggregates            | min                             | double          | Minimum value of the numeric aggregates.                                                                                                                |
| time_to_repair        | name [*required*]          | string          | Name of the incident property field.                                                                                                                    |
| facets                | time_to_resolve                 | [object]        | Facet data for incident time to resolve metrics.                                                                                                        |
| time_to_resolve       | aggregates [*required*]    | object          | Aggregate information for numeric incident data.                                                                                                        |
| aggregates            | max                             | double          | Maximum value of the numeric aggregates.                                                                                                                |
| aggregates            | min                             | double          | Minimum value of the numeric aggregates.                                                                                                                |
| time_to_resolve       | name [*required*]          | string          | Name of the incident property field.                                                                                                                    |
| attributes            | incidents [*required*]     | [object]        | Incidents returned by the search.                                                                                                                       |
| incidents             | data [*required*]          | object          | Incident data from a response.                                                                                                                          |
| data                  | attributes                      | object          | The incident's attributes from a response.                                                                                                              |
| attributes            | archived                        | date-time       | Timestamp of when the incident was archived.                                                                                                            |
| attributes            | case_id                         | int64           | The incident case id.                                                                                                                                   |
| attributes            | created                         | date-time       | Timestamp when the incident was created.                                                                                                                |
| attributes            | customer_impact_duration        | int64           | Length of the incident's customer impact in seconds. Equals the difference between `customer_impact_start` and `customer_impact_end`.                   |
| attributes            | customer_impact_end             | date-time       | Timestamp when customers were no longer impacted by the incident.                                                                                       |
| attributes            | customer_impact_scope           | string          | A summary of the impact customers experienced during the incident.                                                                                      |
| attributes            | customer_impact_start           | date-time       | Timestamp when customers began being impacted by the incident.                                                                                          |
| attributes            | customer_impacted               | boolean         | A flag indicating whether the incident caused customer impact.                                                                                          |
| attributes            | declared                        | date-time       | Timestamp when the incident was declared.                                                                                                               |
| attributes            | declared_by                     | object          | Incident's non Datadog creator.                                                                                                                         |
| declared_by           | image_48_px                     | string          | Non Datadog creator `48px` image.                                                                                                                       |
| declared_by           | name                            | string          | Non Datadog creator name.                                                                                                                               |
| attributes            | declared_by_uuid                | string          | UUID of the user who declared the incident.                                                                                                             |
| attributes            | detected                        | date-time       | Timestamp when the incident was detected.                                                                                                               |
| attributes            | fields                          | object          | A condensed view of the user-defined fields attached to incidents.                                                                                      |
| additionalProperties  | <any-key>                       |  <oneOf>   | Dynamic fields for which selections can be made, with field names as keys.                                                                              |
| <any-key>             | Option 1                        | object          | A field with a single value selected.                                                                                                                   |
| Option 1              | type                            | enum            | Type of the single value field definitions. Allowed enum values: `dropdown,textbox`                                                                     |
| Option 1              | value                           | string          | The single value selected for this field.                                                                                                               |
| <any-key>             | Option 2                        | object          | A field with potentially multiple values selected.                                                                                                      |
| Option 2              | type                            | enum            | Type of the multiple value field definitions. Allowed enum values: `multiselect,textarray,metrictag,autocomplete`                                       |
| Option 2              | value                           | [string]        | The multiple values selected for this field.                                                                                                            |
| attributes            | incident_type_uuid              | string          | A unique identifier that represents an incident type.                                                                                                   |
| attributes            | is_test                         | boolean         | A flag indicating whether the incident is a test incident.                                                                                              |
| attributes            | modified                        | date-time       | Timestamp when the incident was last modified.                                                                                                          |
| attributes            | non_datadog_creator             | object          | Incident's non Datadog creator.                                                                                                                         |
| non_datadog_creator   | image_48_px                     | string          | Non Datadog creator `48px` image.                                                                                                                       |
| non_datadog_creator   | name                            | string          | Non Datadog creator name.                                                                                                                               |
| attributes            | notification_handles            | [object]        | Notification handles that will be notified of the incident during update.                                                                               |
| notification_handles  | display_name                    | string          | The name of the notified handle.                                                                                                                        |
| notification_handles  | handle                          | string          | The handle used for the notification. This includes an email address, Slack channel, or workflow.                                                       |
| attributes            | public_id                       | int64           | The monotonically increasing integer ID for the incident.                                                                                               |
| attributes            | resolved                        | date-time       | Timestamp when the incident's state was last changed from active or stable to resolved or completed.                                                    |
| attributes            | severity                        | enum            | The incident severity. Allowed enum values: `UNKNOWN,SEV-0,SEV-1,SEV-2,SEV-3,SEV-4,SEV-5`                                                               |
| attributes            | state                           | string          | The state incident.                                                                                                                                     |
| attributes            | time_to_detect                  | int64           | The amount of time in seconds to detect the incident. Equals the difference between `customer_impact_start` and `detected`.                             |
| attributes            | time_to_internal_response       | int64           | The amount of time in seconds to call incident after detection. Equals the difference of `detected` and `created`.                                      |
| attributes            | time_to_repair                  | int64           | The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between `customer_impact_end` and `detected`. |
| attributes            | time_to_resolve                 | int64           | The amount of time in seconds to resolve the incident after it was created. Equals the difference between `created` and `resolved`.                     |
| attributes            | title [*required*]         | string          | The title of the incident, which summarizes what happened.                                                                                              |
| attributes            | visibility                      | string          | The incident visibility status.                                                                                                                         |
| data                  | id [*required*]            | string          | The incident's ID.                                                                                                                                      |
| data                  | relationships                   | object          | The incident's relationships from a response.                                                                                                           |
| relationships         | attachments                     | object          | A relationship reference for attachments.                                                                                                               |
| attachments           | data [*required*]          | [object]        | An array of incident attachments.                                                                                                                       |
| data                  | id [*required*]            | string          | A unique identifier that represents the attachment.                                                                                                     |
| data                  | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments`                                                                      |
| relationships         | commander_user                  | object          | Relationship to user.                                                                                                                                   |
| commander_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`                                                                                                       |
| 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`                                                                                                       |
| relationships         | declared_by_user                | object          | Relationship to user.                                                                                                                                   |
| declared_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`                                                                                                       |
| relationships         | impacts                         | object          | Relationship to impacts.                                                                                                                                |
| impacts               | data [*required*]          | [object]        | An array of incident impacts.                                                                                                                           |
| data                  | id [*required*]            | string          | A unique identifier that represents the impact.                                                                                                         |
| data                  | type [*required*]          | enum            | The incident impacts type. Allowed enum values: `incident_impacts`                                                                                      |
| relationships         | integrations                    | object          | A relationship reference for multiple integration metadata objects.                                                                                     |
| integrations          | data [*required*]          | [object]        | Integration metadata relationship array                                                                                                                 |
| data                  | id [*required*]            | string          | A unique identifier that represents the integration metadata.                                                                                           |
| data                  | type [*required*]          | enum            | Integration metadata resource type. Allowed enum values: `incident_integrations`                                                                        |
| 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`                                                                                                       |
| relationships         | responders                      | object          | Relationship to incident responders.                                                                                                                    |
| responders            | data [*required*]          | [object]        | An array of incident responders.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the responder.                                                                                                      |
| data                  | type [*required*]          | enum            | The incident responders type. Allowed enum values: `incident_responders`                                                                                |
| relationships         | user_defined_fields             | object          | Relationship to incident user defined fields.                                                                                                           |
| user_defined_fields   | data [*required*]          | [object]        | An array of user defined fields.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the responder.                                                                                                      |
| data                  | type [*required*]          | enum            | The incident user defined fields type. Allowed enum values: `user_defined_field`                                                                        |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                                                                                                |
| attributes            | total [*required*]         | int32           | Number of incidents returned by the search.                                                                                                             |
| data                  | type                            | enum            | Incident search result type. Allowed enum values: `incidents_search_results`                                                                            |
|                       | included                        | [ <oneOf>] | Included related resources that the user requested.                                                                                                     |
| included              | Option 1                        | object          | User object returned by the API.                                                                                                                        |
| Option 1              | attributes                      | object          | Attributes of user object returned by the API.                                                                                                          |
| attributes            | email                           | string          | Email of the user.                                                                                                                                      |
| attributes            | handle                          | string          | Handle of the user.                                                                                                                                     |
| attributes            | icon                            | string          | URL of the user's icon.                                                                                                                                 |
| attributes            | name                            | string          | Name of the user.                                                                                                                                       |
| attributes            | uuid                            | string          | UUID of the user.                                                                                                                                       |
| Option 1              | id                              | string          | ID of the user.                                                                                                                                         |
| Option 1              | type                            | enum            | Users resource type. Allowed enum values: `users`                                                                                                       |
| included              | Option 2                        | object          | Attachment data from a response.                                                                                                                        |
| Option 2              | attributes [*required*]    | object          | The attachment's attributes.                                                                                                                            |
| attributes            | attachment                      | object          | The attachment object.                                                                                                                                  |
| attachment            | documentUrl                     | string          | The URL of the attachment.                                                                                                                              |
| attachment            | title                           | string          | The title of the attachment.                                                                                                                            |
| attributes            | attachment_type                 | enum            | The type of the attachment. Allowed enum values: `postmortem,link`                                                                                      |
| attributes            | modified                        | date-time       | Timestamp when the attachment was last modified.                                                                                                        |
| Option 2              | id [*required*]            | string          | The unique identifier of the attachment.                                                                                                                |
| Option 2              | relationships [*required*] | object          | The attachment's resource relationships.                                                                                                                |
| relationships         | incident                        | object          | Relationship to incident.                                                                                                                               |
| incident              | data [*required*]          | object          | Relationship to incident object.                                                                                                                        |
| data                  | id [*required*]            | string          | A unique identifier that represents the incident.                                                                                                       |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                                                                                                |
| 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`                                                                                                       |
| Option 2              | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments`                                                                      |
|                       | meta                            | object          | The metadata object containing pagination metadata.                                                                                                     |
| meta                  | pagination                      | object          | Pagination properties.                                                                                                                                  |
| pagination            | next_offset                     | int64           | The index of the first element in the next page of results. Equal to page size added to the current offset.                                             |
| pagination            | offset                          | int64           | The index of the first element in the results.                                                                                                          |
| pagination            | size                            | int64           | Maximum size of pages to return.                                                                                                                        |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "facets": {
        "commander": [
          {
            "count": 5,
            "email": "datadog.user@example.com",
            "handle": "@datadog.user@example.com",
            "name": "Datadog User",
            "uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"
          }
        ],
        "created_by": [
          {
            "count": 5,
            "email": "datadog.user@example.com",
            "handle": "@datadog.user@example.com",
            "name": "Datadog User",
            "uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"
          }
        ],
        "fields": [
          {
            "aggregates": {
              "max": 1234,
              "min": 20
            },
            "facets": [
              {
                "count": 5,
                "name": "SEV-2"
              }
            ],
            "name": "Severity"
          }
        ],
        "impact": [
          {
            "count": 5,
            "name": "SEV-2"
          }
        ],
        "last_modified_by": [
          {
            "count": 5,
            "email": "datadog.user@example.com",
            "handle": "@datadog.user@example.com",
            "name": "Datadog User",
            "uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"
          }
        ],
        "postmortem": [
          {
            "count": 5,
            "name": "SEV-2"
          }
        ],
        "responder": [
          {
            "count": 5,
            "email": "datadog.user@example.com",
            "handle": "@datadog.user@example.com",
            "name": "Datadog User",
            "uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"
          }
        ],
        "severity": [
          {
            "count": 5,
            "name": "SEV-2"
          }
        ],
        "state": [
          {
            "count": 5,
            "name": "SEV-2"
          }
        ],
        "time_to_repair": [
          {
            "aggregates": {
              "max": 1234,
              "min": 20
            },
            "name": "time_to_repair"
          }
        ],
        "time_to_resolve": [
          {
            "aggregates": {
              "max": 1234,
              "min": 20
            },
            "name": "time_to_repair"
          }
        ]
      },
      "incidents": [
        {
          "data": {
            "attributes": {
              "archived": "2019-09-19T10:00:00.000Z",
              "case_id": "integer",
              "created": "2019-09-19T10:00:00.000Z",
              "customer_impact_duration": "integer",
              "customer_impact_end": "2019-09-19T10:00:00.000Z",
              "customer_impact_scope": "An example customer impact scope",
              "customer_impact_start": "2019-09-19T10:00:00.000Z",
              "customer_impacted": false,
              "declared": "2019-09-19T10:00:00.000Z",
              "declared_by": {
                "image_48_px": "string",
                "name": "string"
              },
              "declared_by_uuid": "string",
              "detected": "2019-09-19T10:00:00.000Z",
              "fields": {
                "<any-key>": "undefined"
              },
              "incident_type_uuid": "00000000-0000-0000-0000-000000000000",
              "is_test": false,
              "modified": "2019-09-19T10:00:00.000Z",
              "non_datadog_creator": {
                "image_48_px": "string",
                "name": "string"
              },
              "notification_handles": [
                {
                  "display_name": "Jane Doe",
                  "handle": "@test.user@test.com"
                }
              ],
              "public_id": 1,
              "resolved": "2019-09-19T10:00:00.000Z",
              "severity": "UNKNOWN",
              "state": "string",
              "time_to_detect": "integer",
              "time_to_internal_response": "integer",
              "time_to_repair": "integer",
              "time_to_resolve": "integer",
              "title": "A test incident title",
              "visibility": "string"
            },
            "id": "00000000-0000-0000-1234-000000000000",
            "relationships": {
              "attachments": {
                "data": [
                  {
                    "id": "00000000-0000-abcd-1000-000000000000",
                    "type": "incident_attachments"
                  }
                ]
              },
              "commander_user": {
                "data": {
                  "id": "00000000-0000-0000-0000-000000000000",
                  "type": "users"
                }
              },
              "created_by_user": {
                "data": {
                  "id": "00000000-0000-0000-2345-000000000000",
                  "type": "users"
                }
              },
              "declared_by_user": {
                "data": {
                  "id": "00000000-0000-0000-2345-000000000000",
                  "type": "users"
                }
              },
              "impacts": {
                "data": [
                  {
                    "id": "00000000-0000-0000-2345-000000000000",
                    "type": "incident_impacts"
                  }
                ]
              },
              "integrations": {
                "data": [
                  {
                    "id": "00000000-abcd-0001-0000-000000000000",
                    "type": "incident_integrations"
                  }
                ]
              },
              "last_modified_by_user": {
                "data": {
                  "id": "00000000-0000-0000-2345-000000000000",
                  "type": "users"
                }
              },
              "responders": {
                "data": [
                  {
                    "id": "00000000-0000-0000-2345-000000000000",
                    "type": "incident_responders"
                  }
                ]
              },
              "user_defined_fields": {
                "data": [
                  {
                    "id": "00000000-0000-0000-2345-000000000000",
                    "type": "user_defined_field"
                  }
                ]
              }
            },
            "type": "incidents"
          }
        }
      ],
      "total": 10
    },
    "type": "incidents_search_results"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ],
  "meta": {
    "pagination": {
      "next_offset": 1000,
      "offset": 10,
      "size": 1000
    }
  }
}
```

{% /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

##### 
                  \# Required query argumentsexport query="CHANGE_ME"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/search?query=${query}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Search for incidents returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

configuration = Configuration()
configuration.unstable_operations["search_incidents"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.search_incidents(
        query="state:(active OR stable OR resolved)",
    )

    print(response)
```

#### Instructions

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

```ruby
# Search for incidents returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.search_incidents".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.search_incidents("state:(active OR stable OR resolved)")
```

#### Instructions

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

```go
// Search for incidents 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.SearchIncidents", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.SearchIncidents(ctx, "state:(active OR stable OR resolved)", *datadogV2.NewSearchIncidentsOptionalParameters())

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

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

#### Instructions

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

```java
// Search for incidents 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.IncidentSearchResponse;

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

    try {
      IncidentSearchResponse result =
          apiInstance.searchIncidents("state:(active OR stable OR resolved)");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#searchIncidents");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Search for incidents returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::SearchIncidentsOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.SearchIncidents", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .search_incidents(
            "state:(active OR stable OR resolved)".to_string(),
            SearchIncidentsOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Search for incidents returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.searchIncidents"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiSearchIncidentsRequest = {
  query: "state:(active OR stable OR resolved)",
};

apiInstance
  .searchIncidents(params)
  .then((data: v2.IncidentSearchResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## List an incident's impacts{% #list-an-incidents-impacts %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                             |
| ----------------- | ------------------------------------------------------------------------ |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/impacts |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/impacts |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/{incident_id}/impacts      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/{incident_id}/impacts      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/{incident_id}/impacts     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/impacts |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/impacts |

### Overview

Get all impacts for an incident. This endpoint requires the `incident_read` permission.

OAuth apps require the `incident_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description               |
| ----------------------------- | ------ | ------------------------- |
| incident_id [*required*] | string | The UUID of the incident. |

#### Query Strings

| Name    | Type  | Description                                                           |
| ------- | ----- | --------------------------------------------------------------------- |
| include | array | Specifies which related resources should be included in the response. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with a list of incident impacts.

| Parent field          | Field                         | Type      | Description                                                            |
| --------------------- | ----------------------------- | --------- | ---------------------------------------------------------------------- |
|                       | data [*required*]        | [object]  | An array of incident impacts.                                          |
| data                  | attributes                    | object    | The incident impact's attributes.                                      |
| attributes            | created                       | date-time | Timestamp when the impact was created.                                 |
| attributes            | description [*required*] | string    | Description of the impact.                                             |
| attributes            | end_at                        | date-time | Timestamp when the impact ended.                                       |
| attributes            | fields                        | object    | An object mapping impact field names to field values.                  |
| attributes            | impact_type                   | string    | The type of impact.                                                    |
| attributes            | modified                      | date-time | Timestamp when the impact was last modified.                           |
| attributes            | start_at [*required*]    | date-time | Timestamp representing when the impact started.                        |
| data                  | id [*required*]          | string    | The incident impact's ID.                                              |
| data                  | relationships                 | object    | The incident impact'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`                      |
| relationships         | incident                      | object    | Relationship to incident.                                              |
| incident              | data [*required*]        | object    | Relationship to incident object.                                       |
| data                  | id [*required*]          | string    | A unique identifier that represents the incident.                      |
| data                  | type [*required*]        | enum      | Incident resource type. Allowed enum values: `incidents`               |
| 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`                      |
| data                  | type [*required*]        | enum      | Incident impact resource type. Allowed enum values: `incident_impacts` |
|                       | included                      | [object]  | Included related resources that the user requested.                    |
| included              | attributes                    | object    | Attributes of user object returned by the API.                         |
| attributes            | email                         | string    | Email of the user.                                                     |
| attributes            | handle                        | string    | Handle of the user.                                                    |
| attributes            | icon                          | string    | URL of the user's icon.                                                |
| attributes            | name                          | string    | Name of the user.                                                      |
| attributes            | uuid                          | string    | UUID of the user.                                                      |
| included              | id                            | string    | ID of the user.                                                        |
| included              | type                          | enum      | Users resource type. Allowed enum values: `users`                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created": "2025-08-29T13:17:00Z",
        "description": "Service was unavailable for external users",
        "end_at": "2025-08-29T13:17:00Z",
        "fields": {
          "customers_impacted": "all",
          "products_impacted": [
            "shopping",
            "marketing"
          ]
        },
        "impact_type": "customer",
        "modified": "2025-08-29T13:17:00Z",
        "start_at": "2025-08-28T13:17:00Z"
      },
      "id": "00000000-0000-0000-1234-000000000000",
      "relationships": {
        "created_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "incident": {
          "data": {
            "id": "00000000-0000-0000-1234-000000000000",
            "type": "incidents"
          }
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        }
      },
      "type": "incident_impacts"
    }
  ],
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/impacts" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
List an incident's impacts returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["list_incident_impacts"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.list_incident_impacts(
        incident_id=INCIDENT_DATA_ID,
    )

    print(response)
```

#### Instructions

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

```ruby
# List an incident's impacts returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]
p api_instance.list_incident_impacts(INCIDENT_DATA_ID)
```

#### Instructions

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

```go
// List an incident's impacts 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListIncidentImpacts", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.ListIncidentImpacts(ctx, IncidentDataID, *datadogV2.NewListIncidentImpactsOptionalParameters())

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

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

#### Instructions

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

```java
// List an incident's impacts 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.IncidentImpactsResponse;

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

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

    try {
      IncidentImpactsResponse result = apiInstance.listIncidentImpacts(INCIDENT_DATA_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#listIncidentImpacts");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// List an incident's impacts returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::ListIncidentImpactsOptionalParams;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidentImpacts", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .list_incident_impacts(
            incident_data_id.clone(),
            ListIncidentImpactsOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * List an incident's impacts returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listIncidentImpacts"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiListIncidentImpactsRequest = {
  incidentId: INCIDENT_DATA_ID,
};

apiInstance
  .listIncidentImpacts(params)
  .then((data: v2.IncidentImpactsResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Create an incident impact{% #create-an-incident-impact %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                              |
| ----------------- | ------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/impacts |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/impacts |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/incidents/{incident_id}/impacts      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/incidents/{incident_id}/impacts      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/incidents/{incident_id}/impacts     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/impacts |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/impacts |

### Overview

Create an impact for an incident. This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description               |
| ----------------------------- | ------ | ------------------------- |
| incident_id [*required*] | string | The UUID of the incident. |

#### Query Strings

| Name    | Type  | Description                                                           |
| ------- | ----- | --------------------------------------------------------------------- |
| include | array | Specifies which related resources should be included in the response. |

### Request

#### Body Data (required)

Incident impact payload.

{% tab title="Model" %}

| Parent field | Field                         | Type      | Description                                                            |
| ------------ | ----------------------------- | --------- | ---------------------------------------------------------------------- |
|              | data [*required*]        | object    | Incident impact data for a create request.                             |
| data         | attributes [*required*]  | object    | The incident impact's attributes for a create request.                 |
| attributes   | description [*required*] | string    | Description of the impact.                                             |
| attributes   | end_at                        | date-time | Timestamp when the impact ended.                                       |
| attributes   | fields                        | object    | An object mapping impact field names to field values.                  |
| attributes   | start_at [*required*]    | date-time | Timestamp when the impact started.                                     |
| data         | type [*required*]        | enum      | Incident impact resource type. Allowed enum values: `incident_impacts` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "description": "Service was unavailable for external users",
      "end_at": "2025-08-29T13:17:00Z",
      "fields": {
        "customers_impacted": "all",
        "products_impacted": [
          "shopping",
          "marketing"
        ]
      },
      "start_at": "2025-08-28T13:17:00Z"
    },
    "type": "incident_impacts"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
CREATED
{% tab title="Model" %}
Response with an incident impact.

| Parent field          | Field                         | Type      | Description                                                            |
| --------------------- | ----------------------------- | --------- | ---------------------------------------------------------------------- |
|                       | data [*required*]        | object    | Incident impact data from a response.                                  |
| data                  | attributes                    | object    | The incident impact's attributes.                                      |
| attributes            | created                       | date-time | Timestamp when the impact was created.                                 |
| attributes            | description [*required*] | string    | Description of the impact.                                             |
| attributes            | end_at                        | date-time | Timestamp when the impact ended.                                       |
| attributes            | fields                        | object    | An object mapping impact field names to field values.                  |
| attributes            | impact_type                   | string    | The type of impact.                                                    |
| attributes            | modified                      | date-time | Timestamp when the impact was last modified.                           |
| attributes            | start_at [*required*]    | date-time | Timestamp representing when the impact started.                        |
| data                  | id [*required*]          | string    | The incident impact's ID.                                              |
| data                  | relationships                 | object    | The incident impact'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`                      |
| relationships         | incident                      | object    | Relationship to incident.                                              |
| incident              | data [*required*]        | object    | Relationship to incident object.                                       |
| data                  | id [*required*]          | string    | A unique identifier that represents the incident.                      |
| data                  | type [*required*]        | enum      | Incident resource type. Allowed enum values: `incidents`               |
| 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`                      |
| data                  | type [*required*]        | enum      | Incident impact resource type. Allowed enum values: `incident_impacts` |
|                       | included                      | [object]  | Included related resources that the user requested.                    |
| included              | attributes                    | object    | Attributes of user object returned by the API.                         |
| attributes            | email                         | string    | Email of the user.                                                     |
| attributes            | handle                        | string    | Handle of the user.                                                    |
| attributes            | icon                          | string    | URL of the user's icon.                                                |
| attributes            | name                          | string    | Name of the user.                                                      |
| attributes            | uuid                          | string    | UUID of the user.                                                      |
| included              | id                            | string    | ID of the user.                                                        |
| included              | type                          | enum      | Users resource type. Allowed enum values: `users`                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created": "2025-08-29T13:17:00Z",
      "description": "Service was unavailable for external users",
      "end_at": "2025-08-29T13:17:00Z",
      "fields": {
        "customers_impacted": "all",
        "products_impacted": [
          "shopping",
          "marketing"
        ]
      },
      "impact_type": "customer",
      "modified": "2025-08-29T13:17:00Z",
      "start_at": "2025-08-28T13:17:00Z"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "incident": {
        "data": {
          "id": "00000000-0000-0000-1234-000000000000",
          "type": "incidents"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_impacts"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/impacts" \
-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": {
      "description": "Service was unavailable for external users",
      "start_at": "2025-08-28T13:17:00Z"
    },
    "type": "incident_impacts"
  }
}
EOF
                
##### 

```python
"""
Create an incident impact returns "CREATED" 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_impact_create_attributes import IncidentImpactCreateAttributes
from datadog_api_client.v2.model.incident_impact_create_data import IncidentImpactCreateData
from datadog_api_client.v2.model.incident_impact_create_request import IncidentImpactCreateRequest
from datadog_api_client.v2.model.incident_impact_type import IncidentImpactType
from datetime import datetime
from dateutil.tz import tzutc

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

body = IncidentImpactCreateRequest(
    data=IncidentImpactCreateData(
        type=IncidentImpactType.INCIDENT_IMPACTS,
        attributes=IncidentImpactCreateAttributes(
            start_at=datetime(2025, 9, 12, 13, 50, tzinfo=tzutc()),
            end_at=datetime(2025, 9, 12, 14, 50, tzinfo=tzutc()),
            description="Outage in the us-east-1 region",
        ),
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_incident_impact"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.create_incident_impact(incident_id=INCIDENT_DATA_ID, body=body)

    print(response)
```

#### Instructions

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

```ruby
# Create an incident impact returns "CREATED" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

body = DatadogAPIClient::V2::IncidentImpactCreateRequest.new({
  data: DatadogAPIClient::V2::IncidentImpactCreateData.new({
    type: DatadogAPIClient::V2::IncidentImpactType::INCIDENT_IMPACTS,
    attributes: DatadogAPIClient::V2::IncidentImpactCreateAttributes.new({
      start_at: "2025-09-12T13:50:00.000Z",
      end_at: "2025-09-12T14:50:00.000Z",
      description: "Outage in the us-east-1 region",
    }),
  }),
})
p api_instance.create_incident_impact(INCIDENT_DATA_ID, body)
```

#### Instructions

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

```go
// Create an incident impact returns "CREATED" response

package main

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

	"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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	body := datadogV2.IncidentImpactCreateRequest{
		Data: datadogV2.IncidentImpactCreateData{
			Type: datadogV2.INCIDENTIMPACTTYPE_INCIDENT_IMPACTS,
			Attributes: datadogV2.IncidentImpactCreateAttributes{
				StartAt:     time.Date(2025, 9, 12, 13, 50, 0, 0, time.UTC),
				EndAt:       *datadog.NewNullableTime(datadog.PtrTime(time.Date(2025, 9, 12, 14, 50, 0, 0, time.UTC))),
				Description: "Outage in the us-east-1 region",
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateIncidentImpact", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.CreateIncidentImpact(ctx, IncidentDataID, body, *datadogV2.NewCreateIncidentImpactOptionalParameters())

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

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

#### Instructions

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

```java
// Create an incident impact returns "CREATED" 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.IncidentImpactCreateAttributes;
import com.datadog.api.client.v2.model.IncidentImpactCreateData;
import com.datadog.api.client.v2.model.IncidentImpactCreateRequest;
import com.datadog.api.client.v2.model.IncidentImpactResponse;
import com.datadog.api.client.v2.model.IncidentImpactType;
import java.time.OffsetDateTime;

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

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

    IncidentImpactCreateRequest body =
        new IncidentImpactCreateRequest()
            .data(
                new IncidentImpactCreateData()
                    .type(IncidentImpactType.INCIDENT_IMPACTS)
                    .attributes(
                        new IncidentImpactCreateAttributes()
                            .startAt(OffsetDateTime.parse("2025-09-12T13:50:00.000Z"))
                            .endAt(OffsetDateTime.parse("2025-09-12T14:50:00.000Z"))
                            .description("Outage in the us-east-1 region")));

    try {
      IncidentImpactResponse result = apiInstance.createIncidentImpact(INCIDENT_DATA_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#createIncidentImpact");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Create an incident impact returns "CREATED" response
use chrono::{DateTime, Utc};
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::CreateIncidentImpactOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentImpactCreateAttributes;
use datadog_api_client::datadogV2::model::IncidentImpactCreateData;
use datadog_api_client::datadogV2::model::IncidentImpactCreateRequest;
use datadog_api_client::datadogV2::model::IncidentImpactType;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let body = IncidentImpactCreateRequest::new(IncidentImpactCreateData::new(
        IncidentImpactCreateAttributes::new(
            "Outage in the us-east-1 region".to_string(),
            DateTime::parse_from_rfc3339("2025-09-12T13:50:00+00:00")
                .expect("Failed to parse datetime")
                .with_timezone(&Utc),
        )
        .end_at(Some(
            DateTime::parse_from_rfc3339("2025-09-12T14:50:00+00:00")
                .expect("Failed to parse datetime")
                .with_timezone(&Utc),
        )),
        IncidentImpactType::INCIDENT_IMPACTS,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncidentImpact", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .create_incident_impact(
            incident_data_id.clone(),
            body,
            CreateIncidentImpactOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Create an incident impact returns "CREATED" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentImpact"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiCreateIncidentImpactRequest = {
  body: {
    data: {
      type: "incident_impacts",
      attributes: {
        startAt: new Date(2025, 9, 12, 13, 50, 0, 0),
        endAt: new Date(2025, 9, 12, 14, 50, 0, 0),
        description: "Outage in the us-east-1 region",
      },
    },
  },
  incidentId: INCIDENT_DATA_ID,
};

apiInstance
  .createIncidentImpact(params)
  .then((data: v2.IncidentImpactResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Delete an incident impact{% #delete-an-incident-impact %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                            |
| ----------------- | --------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/impacts/{impact_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/impacts/{impact_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/incidents/{incident_id}/impacts/{impact_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/incidents/{incident_id}/impacts/{impact_id}      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/incidents/{incident_id}/impacts/{impact_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/impacts/{impact_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/impacts/{impact_id} |

### Overview

Delete an incident impact. This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description                      |
| ----------------------------- | ------ | -------------------------------- |
| incident_id [*required*] | string | The UUID of the incident.        |
| impact_id [*required*]   | string | The UUID of the incident impact. |

### Response

{% tab title="204" %}
No Content
{% /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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"export impact_id="CHANGE_ME"\# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/impacts/${impact_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Delete an incident impact returns "No Content" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# the "incident" has an "incident_impact"
INCIDENT_IMPACT_DATA_ID = environ["INCIDENT_IMPACT_DATA_ID"]
INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID = environ["INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["delete_incident_impact"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    api_instance.delete_incident_impact(
        incident_id=INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID,
        impact_id=INCIDENT_IMPACT_DATA_ID,
    )
```

#### Instructions

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

```ruby
# Delete an incident impact returns "No Content" response

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

# the "incident" has an "incident_impact"
INCIDENT_IMPACT_DATA_ID = ENV["INCIDENT_IMPACT_DATA_ID"]
INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID = ENV["INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID"]
api_instance.delete_incident_impact(INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID, INCIDENT_IMPACT_DATA_ID)
```

#### Instructions

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

```go
// Delete an incident impact returns "No Content" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	// the "incident" has an "incident_impact"
	IncidentImpactDataID := os.Getenv("INCIDENT_IMPACT_DATA_ID")
	IncidentImpactDataRelationshipsIncidentDataID := os.Getenv("INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteIncidentImpact", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	r, err := api.DeleteIncidentImpact(ctx, IncidentImpactDataRelationshipsIncidentDataID, IncidentImpactDataID)

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

#### Instructions

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

```java
// Delete an incident impact returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;

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

    // the "incident" has an "incident_impact"
    String INCIDENT_IMPACT_DATA_ID = System.getenv("INCIDENT_IMPACT_DATA_ID");
    String INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID =
        System.getenv("INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID");

    try {
      apiInstance.deleteIncidentImpact(
          INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID, INCIDENT_IMPACT_DATA_ID);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#deleteIncidentImpact");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Delete an incident impact returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // the "incident" has an "incident_impact"
    let incident_impact_data_id = std::env::var("INCIDENT_IMPACT_DATA_ID").unwrap();
    let incident_impact_data_relationships_incident_data_id =
        std::env::var("INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncidentImpact", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .delete_incident_impact(
            incident_impact_data_relationships_incident_data_id.clone(),
            incident_impact_data_id.clone(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Delete an incident impact returns "No Content" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteIncidentImpact"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

// the "incident" has an "incident_impact"
const INCIDENT_IMPACT_DATA_ID = process.env.INCIDENT_IMPACT_DATA_ID as string;
const INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID = process.env
  .INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID as string;

const params: v2.IncidentsApiDeleteIncidentImpactRequest = {
  incidentId: INCIDENT_IMPACT_DATA_RELATIONSHIPS_INCIDENT_DATA_ID,
  impactId: INCIDENT_IMPACT_DATA_ID,
};

apiInstance
  .deleteIncidentImpact(params)
  .then((data: any) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Get a list of an incident's integration metadata{% #get-a-list-of-an-incidents-integration-metadata %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                |
| ----------------- | ------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/integrations      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/integrations      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations |

### Overview

Get all integration metadata for an incident. This endpoint requires the `incident_read` permission.

OAuth apps require the `incident_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description               |
| ----------------------------- | ------ | ------------------------- |
| incident_id [*required*] | string | The UUID of the incident. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with a list of incident integration metadata.

| Parent field          | Field                              | Type            | Description                                                                                                                                                                                                  |
| --------------------- | ---------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|                       | data [*required*]             | [object]        | An array of incident integration metadata.                                                                                                                                                                   |
| data                  | attributes                         | object          | Incident integration metadata's attributes for a create request.                                                                                                                                             |
| attributes            | created                            | date-time       | Timestamp when the incident todo was created.                                                                                                                                                                |
| attributes            | incident_id                        | string          | UUID of the incident this integration metadata is connected to.                                                                                                                                              |
| attributes            | integration_type [*required*] | int32           | A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.                                                                                                       |
| attributes            | metadata [*required*]         |  <oneOf>   | Incident integration metadata's metadata attribute.                                                                                                                                                          |
| metadata              | Option 1                           | object          | Incident integration metadata for the Slack integration.                                                                                                                                                     |
| Option 1              | channels [*required*]         | [object]        | Array of Slack channels in this integration metadata.                                                                                                                                                        |
| channels              | channel_id [*required*]       | string          | Slack channel ID.                                                                                                                                                                                            |
| channels              | channel_name [*required*]     | string          | Name of the Slack channel.                                                                                                                                                                                   |
| channels              | redirect_url [*required*]     | string          | URL redirecting to the Slack channel.                                                                                                                                                                        |
| channels              | team_id                            | string          | Slack team ID.                                                                                                                                                                                               |
| metadata              | Option 2                           | object          | Incident integration metadata for the Jira integration.                                                                                                                                                      |
| Option 2              | issues [*required*]           | [object]        | Array of Jira issues in this integration metadata.                                                                                                                                                           |
| issues                | account [*required*]          | string          | URL of issue's Jira account.                                                                                                                                                                                 |
| issues                | issue_key                          | string          | Jira issue's issue key.                                                                                                                                                                                      |
| issues                | issuetype_id                       | string          | Jira issue's issue type.                                                                                                                                                                                     |
| issues                | project_key [*required*]      | string          | Jira issue's project keys.                                                                                                                                                                                   |
| issues                | redirect_url                       | string          | URL redirecting to the Jira issue.                                                                                                                                                                           |
| metadata              | Option 3                           | object          | Incident integration metadata for the Microsoft Teams integration.                                                                                                                                           |
| Option 3              | teams [*required*]            | [object]        | Array of Microsoft Teams in this integration metadata.                                                                                                                                                       |
| teams                 | ms_channel_id [*required*]    | string          | Microsoft Teams channel ID.                                                                                                                                                                                  |
| teams                 | ms_channel_name [*required*]  | string          | Microsoft Teams channel name.                                                                                                                                                                                |
| teams                 | ms_tenant_id [*required*]     | string          | Microsoft Teams tenant ID.                                                                                                                                                                                   |
| teams                 | redirect_url [*required*]     | string          | URL redirecting to the Microsoft Teams channel.                                                                                                                                                              |
| attributes            | modified                           | date-time       | Timestamp when the incident todo was last modified.                                                                                                                                                          |
| attributes            | status                             | int32           | A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed. |
| data                  | id [*required*]               | string          | The incident integration metadata's ID.                                                                                                                                                                      |
| data                  | relationships                      | object          | The incident's integration relationships from a response.                                                                                                                                                    |
| 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`                                                                                                                                                            |
| 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`                                                                                                                                                            |
| data                  | type [*required*]             | enum            | Integration metadata resource type. Allowed enum values: `incident_integrations`                                                                                                                             |
|                       | included                           | [ <oneOf>] | Included related resources that the user requested.                                                                                                                                                          |
| included              | Option 1                           | object          | User object returned by the API.                                                                                                                                                                             |
| Option 1              | attributes                         | object          | Attributes of user object returned by the API.                                                                                                                                                               |
| attributes            | created_at                         | date-time       | Creation time of the user.                                                                                                                                                                                   |
| attributes            | disabled                           | boolean         | Whether the user is disabled.                                                                                                                                                                                |
| attributes            | email                              | string          | Email of the user.                                                                                                                                                                                           |
| attributes            | handle                             | string          | Handle of the user.                                                                                                                                                                                          |
| attributes            | icon                               | string          | URL of the user's icon.                                                                                                                                                                                      |
| attributes            | last_login_time                    | date-time       | The last time the user logged in.                                                                                                                                                                            |
| attributes            | mfa_enabled                        | boolean         | If user has MFA enabled.                                                                                                                                                                                     |
| attributes            | modified_at                        | date-time       | Time that the user was last modified.                                                                                                                                                                        |
| attributes            | name                               | string          | Name of the user.                                                                                                                                                                                            |
| attributes            | service_account                    | boolean         | Whether the user is a service account.                                                                                                                                                                       |
| attributes            | status                             | string          | Status of the user.                                                                                                                                                                                          |
| attributes            | title                              | string          | Title of the user.                                                                                                                                                                                           |
| attributes            | verified                           | boolean         | Whether the user is verified.                                                                                                                                                                                |
| Option 1              | id                                 | string          | ID of the user.                                                                                                                                                                                              |
| Option 1              | relationships                      | object          | Relationships of the user object returned by the API.                                                                                                                                                        |
| relationships         | org                                | object          | Relationship to an organization.                                                                                                                                                                             |
| org                   | data [*required*]             | object          | Relationship to organization object.                                                                                                                                                                         |
| data                  | id [*required*]               | string          | ID of the organization.                                                                                                                                                                                      |
| data                  | type [*required*]             | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                                                                                     |
| relationships         | other_orgs                         | object          | Relationship to organizations.                                                                                                                                                                               |
| other_orgs            | data [*required*]             | [object]        | Relationships to organization objects.                                                                                                                                                                       |
| data                  | id [*required*]               | string          | ID of the organization.                                                                                                                                                                                      |
| data                  | type [*required*]             | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                                                                                     |
| relationships         | other_users                        | object          | Relationship to users.                                                                                                                                                                                       |
| other_users           | data [*required*]             | [object]        | Relationships to user objects.                                                                                                                                                                               |
| data                  | id [*required*]               | string          | A unique identifier that represents the user.                                                                                                                                                                |
| data                  | type [*required*]             | enum            | Users resource type. Allowed enum values: `users`                                                                                                                                                            |
| relationships         | roles                              | object          | Relationship to roles.                                                                                                                                                                                       |
| roles                 | data                               | [object]        | An array containing type and the unique identifier of a role.                                                                                                                                                |
| data                  | id                                 | string          | The unique identifier of the role.                                                                                                                                                                           |
| data                  | type                               | enum            | Roles type. Allowed enum values: `roles`                                                                                                                                                                     |
| Option 1              | type                               | enum            | Users resource type. Allowed enum values: `users`                                                                                                                                                            |
|                       | meta                               | object          | The metadata object containing pagination metadata.                                                                                                                                                          |
| meta                  | pagination                         | object          | Pagination properties.                                                                                                                                                                                       |
| pagination            | next_offset                        | int64           | The index of the first element in the next page of results. Equal to page size added to the current offset.                                                                                                  |
| pagination            | offset                             | int64           | The index of the first element in the results.                                                                                                                                                               |
| pagination            | size                               | int64           | Maximum size of pages to return.                                                                                                                                                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created": "2019-09-19T10:00:00.000Z",
        "incident_id": "00000000-aaaa-0000-0000-000000000000",
        "integration_type": 1,
        "metadata": {
          "channels": [
            {
              "channel_id": "C0123456789",
              "channel_name": "#example-channel-name",
              "redirect_url": "https://slack.com/app_redirect?channel=C0123456789\u0026team=T01234567",
              "team_id": "T01234567"
            }
          ]
        },
        "modified": "2019-09-19T10:00:00.000Z",
        "status": "integer"
      },
      "id": "00000000-0000-0000-1234-000000000000",
      "relationships": {
        "created_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        }
      },
      "type": "incident_integrations"
    }
  ],
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ],
  "meta": {
    "pagination": {
      "next_offset": 1000,
      "offset": 10,
      "size": 1000
    }
  }
}
```

{% /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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/relationships/integrations" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Get a list of an incident's integration metadata returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["list_incident_integrations"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.list_incident_integrations(
        incident_id=INCIDENT_DATA_ID,
    )

    print(response)
```

#### Instructions

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

```ruby
# Get a list of an incident's integration metadata returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]
p api_instance.list_incident_integrations(INCIDENT_DATA_ID)
```

#### Instructions

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

```go
// Get a list of an incident's integration metadata 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListIncidentIntegrations", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.ListIncidentIntegrations(ctx, IncidentDataID)

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

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

#### Instructions

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

```java
// Get a list of an incident's integration metadata 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.IncidentIntegrationMetadataListResponse;

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

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

    try {
      IncidentIntegrationMetadataListResponse result =
          apiInstance.listIncidentIntegrations(INCIDENT_DATA_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#listIncidentIntegrations");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get a list of an incident's integration metadata returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidentIntegrations", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .list_incident_integrations(incident_data_id.clone())
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get a list of an incident's integration metadata returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listIncidentIntegrations"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiListIncidentIntegrationsRequest = {
  incidentId: INCIDENT_DATA_ID,
};

apiInstance
  .listIncidentIntegrations(params)
  .then((data: v2.IncidentIntegrationMetadataListResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Create an incident integration metadata{% #create-an-incident-integration-metadata %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                 |
| ----------------- | -------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/integrations      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/integrations      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations |

### Overview

Create an incident integration metadata. This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description               |
| ----------------------------- | ------ | ------------------------- |
| incident_id [*required*] | string | The UUID of the incident. |

### Request

#### Body Data (required)

Incident integration metadata payload.

{% tab title="Model" %}

| Parent field | Field                              | Type          | Description                                                                                                                                                                                                  |
| ------------ | ---------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|              | data [*required*]             | object        | Incident integration metadata data for a create request.                                                                                                                                                     |
| data         | attributes [*required*]       | object        | Incident integration metadata's attributes for a create request.                                                                                                                                             |
| attributes   | created                            | date-time     | Timestamp when the incident todo was created.                                                                                                                                                                |
| attributes   | incident_id                        | string        | UUID of the incident this integration metadata is connected to.                                                                                                                                              |
| attributes   | integration_type [*required*] | int32         | A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.                                                                                                       |
| attributes   | metadata [*required*]         |  <oneOf> | Incident integration metadata's metadata attribute.                                                                                                                                                          |
| metadata     | Option 1                           | object        | Incident integration metadata for the Slack integration.                                                                                                                                                     |
| Option 1     | channels [*required*]         | [object]      | Array of Slack channels in this integration metadata.                                                                                                                                                        |
| channels     | channel_id [*required*]       | string        | Slack channel ID.                                                                                                                                                                                            |
| channels     | channel_name [*required*]     | string        | Name of the Slack channel.                                                                                                                                                                                   |
| channels     | redirect_url [*required*]     | string        | URL redirecting to the Slack channel.                                                                                                                                                                        |
| channels     | team_id                            | string        | Slack team ID.                                                                                                                                                                                               |
| metadata     | Option 2                           | object        | Incident integration metadata for the Jira integration.                                                                                                                                                      |
| Option 2     | issues [*required*]           | [object]      | Array of Jira issues in this integration metadata.                                                                                                                                                           |
| issues       | account [*required*]          | string        | URL of issue's Jira account.                                                                                                                                                                                 |
| issues       | issue_key                          | string        | Jira issue's issue key.                                                                                                                                                                                      |
| issues       | issuetype_id                       | string        | Jira issue's issue type.                                                                                                                                                                                     |
| issues       | project_key [*required*]      | string        | Jira issue's project keys.                                                                                                                                                                                   |
| issues       | redirect_url                       | string        | URL redirecting to the Jira issue.                                                                                                                                                                           |
| metadata     | Option 3                           | object        | Incident integration metadata for the Microsoft Teams integration.                                                                                                                                           |
| Option 3     | teams [*required*]            | [object]      | Array of Microsoft Teams in this integration metadata.                                                                                                                                                       |
| teams        | ms_channel_id [*required*]    | string        | Microsoft Teams channel ID.                                                                                                                                                                                  |
| teams        | ms_channel_name [*required*]  | string        | Microsoft Teams channel name.                                                                                                                                                                                |
| teams        | ms_tenant_id [*required*]     | string        | Microsoft Teams tenant ID.                                                                                                                                                                                   |
| teams        | redirect_url [*required*]     | string        | URL redirecting to the Microsoft Teams channel.                                                                                                                                                              |
| attributes   | modified                           | date-time     | Timestamp when the incident todo was last modified.                                                                                                                                                          |
| attributes   | status                             | int32         | A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed. |
| data         | type [*required*]             | enum          | Integration metadata resource type. Allowed enum values: `incident_integrations`                                                                                                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "incident_id": "00000000-0000-0000-1234-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#new-channel",
            "team_id": "T01234567",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
          }
        ]
      }
    },
    "type": "incident_integrations"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
CREATED
{% tab title="Model" %}
Response with an incident integration metadata.

| Parent field          | Field                              | Type            | Description                                                                                                                                                                                                  |
| --------------------- | ---------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|                       | data [*required*]             | object          | Incident integration metadata from a response.                                                                                                                                                               |
| data                  | attributes                         | object          | Incident integration metadata's attributes for a create request.                                                                                                                                             |
| attributes            | created                            | date-time       | Timestamp when the incident todo was created.                                                                                                                                                                |
| attributes            | incident_id                        | string          | UUID of the incident this integration metadata is connected to.                                                                                                                                              |
| attributes            | integration_type [*required*] | int32           | A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.                                                                                                       |
| attributes            | metadata [*required*]         |  <oneOf>   | Incident integration metadata's metadata attribute.                                                                                                                                                          |
| metadata              | Option 1                           | object          | Incident integration metadata for the Slack integration.                                                                                                                                                     |
| Option 1              | channels [*required*]         | [object]        | Array of Slack channels in this integration metadata.                                                                                                                                                        |
| channels              | channel_id [*required*]       | string          | Slack channel ID.                                                                                                                                                                                            |
| channels              | channel_name [*required*]     | string          | Name of the Slack channel.                                                                                                                                                                                   |
| channels              | redirect_url [*required*]     | string          | URL redirecting to the Slack channel.                                                                                                                                                                        |
| channels              | team_id                            | string          | Slack team ID.                                                                                                                                                                                               |
| metadata              | Option 2                           | object          | Incident integration metadata for the Jira integration.                                                                                                                                                      |
| Option 2              | issues [*required*]           | [object]        | Array of Jira issues in this integration metadata.                                                                                                                                                           |
| issues                | account [*required*]          | string          | URL of issue's Jira account.                                                                                                                                                                                 |
| issues                | issue_key                          | string          | Jira issue's issue key.                                                                                                                                                                                      |
| issues                | issuetype_id                       | string          | Jira issue's issue type.                                                                                                                                                                                     |
| issues                | project_key [*required*]      | string          | Jira issue's project keys.                                                                                                                                                                                   |
| issues                | redirect_url                       | string          | URL redirecting to the Jira issue.                                                                                                                                                                           |
| metadata              | Option 3                           | object          | Incident integration metadata for the Microsoft Teams integration.                                                                                                                                           |
| Option 3              | teams [*required*]            | [object]        | Array of Microsoft Teams in this integration metadata.                                                                                                                                                       |
| teams                 | ms_channel_id [*required*]    | string          | Microsoft Teams channel ID.                                                                                                                                                                                  |
| teams                 | ms_channel_name [*required*]  | string          | Microsoft Teams channel name.                                                                                                                                                                                |
| teams                 | ms_tenant_id [*required*]     | string          | Microsoft Teams tenant ID.                                                                                                                                                                                   |
| teams                 | redirect_url [*required*]     | string          | URL redirecting to the Microsoft Teams channel.                                                                                                                                                              |
| attributes            | modified                           | date-time       | Timestamp when the incident todo was last modified.                                                                                                                                                          |
| attributes            | status                             | int32           | A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed. |
| data                  | id [*required*]               | string          | The incident integration metadata's ID.                                                                                                                                                                      |
| data                  | relationships                      | object          | The incident's integration relationships from a response.                                                                                                                                                    |
| 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`                                                                                                                                                            |
| 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`                                                                                                                                                            |
| data                  | type [*required*]             | enum            | Integration metadata resource type. Allowed enum values: `incident_integrations`                                                                                                                             |
|                       | included                           | [ <oneOf>] | Included related resources that the user requested.                                                                                                                                                          |
| included              | Option 1                           | object          | User object returned by the API.                                                                                                                                                                             |
| Option 1              | attributes                         | object          | Attributes of user object returned by the API.                                                                                                                                                               |
| attributes            | created_at                         | date-time       | Creation time of the user.                                                                                                                                                                                   |
| attributes            | disabled                           | boolean         | Whether the user is disabled.                                                                                                                                                                                |
| attributes            | email                              | string          | Email of the user.                                                                                                                                                                                           |
| attributes            | handle                             | string          | Handle of the user.                                                                                                                                                                                          |
| attributes            | icon                               | string          | URL of the user's icon.                                                                                                                                                                                      |
| attributes            | last_login_time                    | date-time       | The last time the user logged in.                                                                                                                                                                            |
| attributes            | mfa_enabled                        | boolean         | If user has MFA enabled.                                                                                                                                                                                     |
| attributes            | modified_at                        | date-time       | Time that the user was last modified.                                                                                                                                                                        |
| attributes            | name                               | string          | Name of the user.                                                                                                                                                                                            |
| attributes            | service_account                    | boolean         | Whether the user is a service account.                                                                                                                                                                       |
| attributes            | status                             | string          | Status of the user.                                                                                                                                                                                          |
| attributes            | title                              | string          | Title of the user.                                                                                                                                                                                           |
| attributes            | verified                           | boolean         | Whether the user is verified.                                                                                                                                                                                |
| Option 1              | id                                 | string          | ID of the user.                                                                                                                                                                                              |
| Option 1              | relationships                      | object          | Relationships of the user object returned by the API.                                                                                                                                                        |
| relationships         | org                                | object          | Relationship to an organization.                                                                                                                                                                             |
| org                   | data [*required*]             | object          | Relationship to organization object.                                                                                                                                                                         |
| data                  | id [*required*]               | string          | ID of the organization.                                                                                                                                                                                      |
| data                  | type [*required*]             | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                                                                                     |
| relationships         | other_orgs                         | object          | Relationship to organizations.                                                                                                                                                                               |
| other_orgs            | data [*required*]             | [object]        | Relationships to organization objects.                                                                                                                                                                       |
| data                  | id [*required*]               | string          | ID of the organization.                                                                                                                                                                                      |
| data                  | type [*required*]             | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                                                                                     |
| relationships         | other_users                        | object          | Relationship to users.                                                                                                                                                                                       |
| other_users           | data [*required*]             | [object]        | Relationships to user objects.                                                                                                                                                                               |
| data                  | id [*required*]               | string          | A unique identifier that represents the user.                                                                                                                                                                |
| data                  | type [*required*]             | enum            | Users resource type. Allowed enum values: `users`                                                                                                                                                            |
| relationships         | roles                              | object          | Relationship to roles.                                                                                                                                                                                       |
| roles                 | data                               | [object]        | An array containing type and the unique identifier of a role.                                                                                                                                                |
| data                  | id                                 | string          | The unique identifier of the role.                                                                                                                                                                           |
| data                  | type                               | enum            | Roles type. Allowed enum values: `roles`                                                                                                                                                                     |
| Option 1              | type                               | enum            | Users resource type. Allowed enum values: `users`                                                                                                                                                            |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created": "2019-09-19T10:00:00.000Z",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#example-channel-name",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789\u0026team=T01234567",
            "team_id": "T01234567"
          }
        ]
      },
      "modified": "2019-09-19T10:00:00.000Z",
      "status": "integer"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_integrations"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                          \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/relationships/integrations" \
-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": {
      "incident_id": "00000000-0000-0000-1234-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#new-channel",
            "team_id": "T01234567",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
          }
        ]
      }
    },
    "type": "incident_integrations"
  }
}
EOF
                        
##### 

```go
// Create an incident integration metadata returns "CREATED" 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	body := datadogV2.IncidentIntegrationMetadataCreateRequest{
		Data: datadogV2.IncidentIntegrationMetadataCreateData{
			Attributes: datadogV2.IncidentIntegrationMetadataAttributes{
				IncidentId:      datadog.PtrString(IncidentDataID),
				IntegrationType: 1,
				Metadata: datadogV2.IncidentIntegrationMetadataMetadata{
					SlackIntegrationMetadata: &datadogV2.SlackIntegrationMetadata{
						Channels: []datadogV2.SlackIntegrationMetadataChannelItem{
							{
								ChannelId:   "C0123456789",
								ChannelName: "#new-channel",
								TeamId:      datadog.PtrString("T01234567"),
								RedirectUrl: "https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
							},
						},
					}},
			},
			Type: datadogV2.INCIDENTINTEGRATIONMETADATATYPE_INCIDENT_INTEGRATIONS,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateIncidentIntegration", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.CreateIncidentIntegration(ctx, IncidentDataID, body)

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

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

#### Instructions

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

```java
// Create an incident integration metadata returns "CREATED" 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.IncidentIntegrationMetadataAttributes;
import com.datadog.api.client.v2.model.IncidentIntegrationMetadataCreateData;
import com.datadog.api.client.v2.model.IncidentIntegrationMetadataCreateRequest;
import com.datadog.api.client.v2.model.IncidentIntegrationMetadataMetadata;
import com.datadog.api.client.v2.model.IncidentIntegrationMetadataResponse;
import com.datadog.api.client.v2.model.IncidentIntegrationMetadataType;
import com.datadog.api.client.v2.model.SlackIntegrationMetadata;
import com.datadog.api.client.v2.model.SlackIntegrationMetadataChannelItem;
import java.util.Collections;

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

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

    IncidentIntegrationMetadataCreateRequest body =
        new IncidentIntegrationMetadataCreateRequest()
            .data(
                new IncidentIntegrationMetadataCreateData()
                    .attributes(
                        new IncidentIntegrationMetadataAttributes()
                            .incidentId(INCIDENT_DATA_ID)
                            .integrationType(1)
                            .metadata(
                                new IncidentIntegrationMetadataMetadata(
                                    new SlackIntegrationMetadata()
                                        .channels(
                                            Collections.singletonList(
                                                new SlackIntegrationMetadataChannelItem()
                                                    .channelId("C0123456789")
                                                    .channelName("#new-channel")
                                                    .teamId("T01234567")
                                                    .redirectUrl(
                                                        "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"))))))
                    .type(IncidentIntegrationMetadataType.INCIDENT_INTEGRATIONS));

    try {
      IncidentIntegrationMetadataResponse result =
          apiInstance.createIncidentIntegration(INCIDENT_DATA_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#createIncidentIntegration");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Create an incident integration metadata returns "CREATED" 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_integration_metadata_attributes import IncidentIntegrationMetadataAttributes
from datadog_api_client.v2.model.incident_integration_metadata_create_data import IncidentIntegrationMetadataCreateData
from datadog_api_client.v2.model.incident_integration_metadata_create_request import (
    IncidentIntegrationMetadataCreateRequest,
)
from datadog_api_client.v2.model.incident_integration_metadata_type import IncidentIntegrationMetadataType
from datadog_api_client.v2.model.slack_integration_metadata import SlackIntegrationMetadata
from datadog_api_client.v2.model.slack_integration_metadata_channel_item import SlackIntegrationMetadataChannelItem

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

body = IncidentIntegrationMetadataCreateRequest(
    data=IncidentIntegrationMetadataCreateData(
        attributes=IncidentIntegrationMetadataAttributes(
            incident_id=INCIDENT_DATA_ID,
            integration_type=1,
            metadata=SlackIntegrationMetadata(
                channels=[
                    SlackIntegrationMetadataChannelItem(
                        channel_id="C0123456789",
                        channel_name="#new-channel",
                        team_id="T01234567",
                        redirect_url="https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
                    ),
                ],
            ),
        ),
        type=IncidentIntegrationMetadataType.INCIDENT_INTEGRATIONS,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_incident_integration"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.create_incident_integration(incident_id=INCIDENT_DATA_ID, body=body)

    print(response)
```

#### Instructions

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

```ruby
# Create an incident integration metadata returns "CREATED" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

body = DatadogAPIClient::V2::IncidentIntegrationMetadataCreateRequest.new({
  data: DatadogAPIClient::V2::IncidentIntegrationMetadataCreateData.new({
    attributes: DatadogAPIClient::V2::IncidentIntegrationMetadataAttributes.new({
      incident_id: INCIDENT_DATA_ID,
      integration_type: 1,
      metadata: DatadogAPIClient::V2::SlackIntegrationMetadata.new({
        channels: [
          DatadogAPIClient::V2::SlackIntegrationMetadataChannelItem.new({
            channel_id: "C0123456789",
            channel_name: "#new-channel",
            team_id: "T01234567",
            redirect_url: "https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
          }),
        ],
      }),
    }),
    type: DatadogAPIClient::V2::IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,
  }),
})
p api_instance.create_incident_integration(INCIDENT_DATA_ID, body)
```

#### Instructions

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

```rust
// Create an incident integration metadata returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataAttributes;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataCreateData;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataCreateRequest;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataMetadata;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataType;
use datadog_api_client::datadogV2::model::SlackIntegrationMetadata;
use datadog_api_client::datadogV2::model::SlackIntegrationMetadataChannelItem;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let body =
        IncidentIntegrationMetadataCreateRequest::new(IncidentIntegrationMetadataCreateData::new(
            IncidentIntegrationMetadataAttributes::new(
                1,
                IncidentIntegrationMetadataMetadata::SlackIntegrationMetadata(Box::new(
                    SlackIntegrationMetadata::new(vec![SlackIntegrationMetadataChannelItem::new(
                        "C0123456789".to_string(),
                        "#new-channel".to_string(),
                        "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
                            .to_string(),
                    )
                    .team_id("T01234567".to_string())]),
                )),
            )
            .incident_id(incident_data_id.clone()),
            IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,
        ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncidentIntegration", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .create_incident_integration(incident_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://docs.datadoghq.com/api/latest/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Create an incident integration metadata returns "CREATED" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentIntegration"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiCreateIncidentIntegrationRequest = {
  body: {
    data: {
      attributes: {
        incidentId: INCIDENT_DATA_ID,
        integrationType: 1,
        metadata: {
          channels: [
            {
              channelId: "C0123456789",
              channelName: "#new-channel",
              teamId: "T01234567",
              redirectUrl:
                "https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
            },
          ],
        },
      },
      type: "incident_integrations",
    },
  },
  incidentId: INCIDENT_DATA_ID,
};

apiInstance
  .createIncidentIntegration(params)
  .then((data: v2.IncidentIntegrationMetadataResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Get incident integration metadata details{% #get-incident-integration-metadata-details %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                                          |
| ----------------- | --------------------------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |

### Overview

Get incident integration metadata details.

OAuth apps require the `incident_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                                      | Type   | Description                                    |
| ----------------------------------------- | ------ | ---------------------------------------------- |
| incident_id [*required*]             | string | The UUID of the incident.                      |
| integration_metadata_id [*required*] | string | The UUID of the incident integration metadata. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with an incident integration metadata.

| Parent field          | Field                              | Type            | Description                                                                                                                                                                                                  |
| --------------------- | ---------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|                       | data [*required*]             | object          | Incident integration metadata from a response.                                                                                                                                                               |
| data                  | attributes                         | object          | Incident integration metadata's attributes for a create request.                                                                                                                                             |
| attributes            | created                            | date-time       | Timestamp when the incident todo was created.                                                                                                                                                                |
| attributes            | incident_id                        | string          | UUID of the incident this integration metadata is connected to.                                                                                                                                              |
| attributes            | integration_type [*required*] | int32           | A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.                                                                                                       |
| attributes            | metadata [*required*]         |  <oneOf>   | Incident integration metadata's metadata attribute.                                                                                                                                                          |
| metadata              | Option 1                           | object          | Incident integration metadata for the Slack integration.                                                                                                                                                     |
| Option 1              | channels [*required*]         | [object]        | Array of Slack channels in this integration metadata.                                                                                                                                                        |
| channels              | channel_id [*required*]       | string          | Slack channel ID.                                                                                                                                                                                            |
| channels              | channel_name [*required*]     | string          | Name of the Slack channel.                                                                                                                                                                                   |
| channels              | redirect_url [*required*]     | string          | URL redirecting to the Slack channel.                                                                                                                                                                        |
| channels              | team_id                            | string          | Slack team ID.                                                                                                                                                                                               |
| metadata              | Option 2                           | object          | Incident integration metadata for the Jira integration.                                                                                                                                                      |
| Option 2              | issues [*required*]           | [object]        | Array of Jira issues in this integration metadata.                                                                                                                                                           |
| issues                | account [*required*]          | string          | URL of issue's Jira account.                                                                                                                                                                                 |
| issues                | issue_key                          | string          | Jira issue's issue key.                                                                                                                                                                                      |
| issues                | issuetype_id                       | string          | Jira issue's issue type.                                                                                                                                                                                     |
| issues                | project_key [*required*]      | string          | Jira issue's project keys.                                                                                                                                                                                   |
| issues                | redirect_url                       | string          | URL redirecting to the Jira issue.                                                                                                                                                                           |
| metadata              | Option 3                           | object          | Incident integration metadata for the Microsoft Teams integration.                                                                                                                                           |
| Option 3              | teams [*required*]            | [object]        | Array of Microsoft Teams in this integration metadata.                                                                                                                                                       |
| teams                 | ms_channel_id [*required*]    | string          | Microsoft Teams channel ID.                                                                                                                                                                                  |
| teams                 | ms_channel_name [*required*]  | string          | Microsoft Teams channel name.                                                                                                                                                                                |
| teams                 | ms_tenant_id [*required*]     | string          | Microsoft Teams tenant ID.                                                                                                                                                                                   |
| teams                 | redirect_url [*required*]     | string          | URL redirecting to the Microsoft Teams channel.                                                                                                                                                              |
| attributes            | modified                           | date-time       | Timestamp when the incident todo was last modified.                                                                                                                                                          |
| attributes            | status                             | int32           | A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed. |
| data                  | id [*required*]               | string          | The incident integration metadata's ID.                                                                                                                                                                      |
| data                  | relationships                      | object          | The incident's integration relationships from a response.                                                                                                                                                    |
| 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`                                                                                                                                                            |
| 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`                                                                                                                                                            |
| data                  | type [*required*]             | enum            | Integration metadata resource type. Allowed enum values: `incident_integrations`                                                                                                                             |
|                       | included                           | [ <oneOf>] | Included related resources that the user requested.                                                                                                                                                          |
| included              | Option 1                           | object          | User object returned by the API.                                                                                                                                                                             |
| Option 1              | attributes                         | object          | Attributes of user object returned by the API.                                                                                                                                                               |
| attributes            | created_at                         | date-time       | Creation time of the user.                                                                                                                                                                                   |
| attributes            | disabled                           | boolean         | Whether the user is disabled.                                                                                                                                                                                |
| attributes            | email                              | string          | Email of the user.                                                                                                                                                                                           |
| attributes            | handle                             | string          | Handle of the user.                                                                                                                                                                                          |
| attributes            | icon                               | string          | URL of the user's icon.                                                                                                                                                                                      |
| attributes            | last_login_time                    | date-time       | The last time the user logged in.                                                                                                                                                                            |
| attributes            | mfa_enabled                        | boolean         | If user has MFA enabled.                                                                                                                                                                                     |
| attributes            | modified_at                        | date-time       | Time that the user was last modified.                                                                                                                                                                        |
| attributes            | name                               | string          | Name of the user.                                                                                                                                                                                            |
| attributes            | service_account                    | boolean         | Whether the user is a service account.                                                                                                                                                                       |
| attributes            | status                             | string          | Status of the user.                                                                                                                                                                                          |
| attributes            | title                              | string          | Title of the user.                                                                                                                                                                                           |
| attributes            | verified                           | boolean         | Whether the user is verified.                                                                                                                                                                                |
| Option 1              | id                                 | string          | ID of the user.                                                                                                                                                                                              |
| Option 1              | relationships                      | object          | Relationships of the user object returned by the API.                                                                                                                                                        |
| relationships         | org                                | object          | Relationship to an organization.                                                                                                                                                                             |
| org                   | data [*required*]             | object          | Relationship to organization object.                                                                                                                                                                         |
| data                  | id [*required*]               | string          | ID of the organization.                                                                                                                                                                                      |
| data                  | type [*required*]             | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                                                                                     |
| relationships         | other_orgs                         | object          | Relationship to organizations.                                                                                                                                                                               |
| other_orgs            | data [*required*]             | [object]        | Relationships to organization objects.                                                                                                                                                                       |
| data                  | id [*required*]               | string          | ID of the organization.                                                                                                                                                                                      |
| data                  | type [*required*]             | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                                                                                     |
| relationships         | other_users                        | object          | Relationship to users.                                                                                                                                                                                       |
| other_users           | data [*required*]             | [object]        | Relationships to user objects.                                                                                                                                                                               |
| data                  | id [*required*]               | string          | A unique identifier that represents the user.                                                                                                                                                                |
| data                  | type [*required*]             | enum            | Users resource type. Allowed enum values: `users`                                                                                                                                                            |
| relationships         | roles                              | object          | Relationship to roles.                                                                                                                                                                                       |
| roles                 | data                               | [object]        | An array containing type and the unique identifier of a role.                                                                                                                                                |
| data                  | id                                 | string          | The unique identifier of the role.                                                                                                                                                                           |
| data                  | type                               | enum            | Roles type. Allowed enum values: `roles`                                                                                                                                                                     |
| Option 1              | type                               | enum            | Users resource type. Allowed enum values: `users`                                                                                                                                                            |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created": "2019-09-19T10:00:00.000Z",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#example-channel-name",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789\u0026team=T01234567",
            "team_id": "T01234567"
          }
        ]
      },
      "modified": "2019-09-19T10:00:00.000Z",
      "status": "integer"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_integrations"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"export integration_metadata_id="CHANGE_ME"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/relationships/integrations/${integration_metadata_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Get incident integration metadata details returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

# the "incident" has an "incident_integration_metadata"
INCIDENT_INTEGRATION_METADATA_DATA_ID = environ["INCIDENT_INTEGRATION_METADATA_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["get_incident_integration"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.get_incident_integration(
        incident_id=INCIDENT_DATA_ID,
        integration_metadata_id=INCIDENT_INTEGRATION_METADATA_DATA_ID,
    )

    print(response)
```

#### Instructions

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

```ruby
# Get incident integration metadata details returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

# the "incident" has an "incident_integration_metadata"
INCIDENT_INTEGRATION_METADATA_DATA_ID = ENV["INCIDENT_INTEGRATION_METADATA_DATA_ID"]
p api_instance.get_incident_integration(INCIDENT_DATA_ID, INCIDENT_INTEGRATION_METADATA_DATA_ID)
```

#### Instructions

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

```go
// Get incident integration metadata details 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	// the "incident" has an "incident_integration_metadata"
	IncidentIntegrationMetadataDataID := os.Getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetIncidentIntegration", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.GetIncidentIntegration(ctx, IncidentDataID, IncidentIntegrationMetadataDataID)

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

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

#### Instructions

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

```java
// Get incident integration metadata details 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.IncidentIntegrationMetadataResponse;

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

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

    // the "incident" has an "incident_integration_metadata"
    String INCIDENT_INTEGRATION_METADATA_DATA_ID =
        System.getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID");

    try {
      IncidentIntegrationMetadataResponse result =
          apiInstance.getIncidentIntegration(
              INCIDENT_DATA_ID, INCIDENT_INTEGRATION_METADATA_DATA_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#getIncidentIntegration");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get incident integration metadata details returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_integration_metadata"
    let incident_integration_metadata_data_id =
        std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetIncidentIntegration", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .get_incident_integration(
            incident_data_id.clone(),
            incident_integration_metadata_data_id.clone(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get incident integration metadata details returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getIncidentIntegration"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

// the "incident" has an "incident_integration_metadata"
const INCIDENT_INTEGRATION_METADATA_DATA_ID = process.env
  .INCIDENT_INTEGRATION_METADATA_DATA_ID as string;

const params: v2.IncidentsApiGetIncidentIntegrationRequest = {
  incidentId: INCIDENT_DATA_ID,
  integrationMetadataId: INCIDENT_INTEGRATION_METADATA_DATA_ID,
};

apiInstance
  .getIncidentIntegration(params)
  .then((data: v2.IncidentIntegrationMetadataResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Update an existing incident integration metadata{% #update-an-existing-incident-integration-metadata %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                                            |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}      |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |

### Overview

Update an existing incident integration metadata.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                                      | Type   | Description                                    |
| ----------------------------------------- | ------ | ---------------------------------------------- |
| incident_id [*required*]             | string | The UUID of the incident.                      |
| integration_metadata_id [*required*] | string | The UUID of the incident integration metadata. |

### Request

#### Body Data (required)

Incident integration metadata payload.

{% tab title="Model" %}

| Parent field | Field                              | Type          | Description                                                                                                                                                                                                  |
| ------------ | ---------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|              | data [*required*]             | object        | Incident integration metadata data for a patch request.                                                                                                                                                      |
| data         | attributes [*required*]       | object        | Incident integration metadata's attributes for a create request.                                                                                                                                             |
| attributes   | created                            | date-time     | Timestamp when the incident todo was created.                                                                                                                                                                |
| attributes   | incident_id                        | string        | UUID of the incident this integration metadata is connected to.                                                                                                                                              |
| attributes   | integration_type [*required*] | int32         | A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.                                                                                                       |
| attributes   | metadata [*required*]         |  <oneOf> | Incident integration metadata's metadata attribute.                                                                                                                                                          |
| metadata     | Option 1                           | object        | Incident integration metadata for the Slack integration.                                                                                                                                                     |
| Option 1     | channels [*required*]         | [object]      | Array of Slack channels in this integration metadata.                                                                                                                                                        |
| channels     | channel_id [*required*]       | string        | Slack channel ID.                                                                                                                                                                                            |
| channels     | channel_name [*required*]     | string        | Name of the Slack channel.                                                                                                                                                                                   |
| channels     | redirect_url [*required*]     | string        | URL redirecting to the Slack channel.                                                                                                                                                                        |
| channels     | team_id                            | string        | Slack team ID.                                                                                                                                                                                               |
| metadata     | Option 2                           | object        | Incident integration metadata for the Jira integration.                                                                                                                                                      |
| Option 2     | issues [*required*]           | [object]      | Array of Jira issues in this integration metadata.                                                                                                                                                           |
| issues       | account [*required*]          | string        | URL of issue's Jira account.                                                                                                                                                                                 |
| issues       | issue_key                          | string        | Jira issue's issue key.                                                                                                                                                                                      |
| issues       | issuetype_id                       | string        | Jira issue's issue type.                                                                                                                                                                                     |
| issues       | project_key [*required*]      | string        | Jira issue's project keys.                                                                                                                                                                                   |
| issues       | redirect_url                       | string        | URL redirecting to the Jira issue.                                                                                                                                                                           |
| metadata     | Option 3                           | object        | Incident integration metadata for the Microsoft Teams integration.                                                                                                                                           |
| Option 3     | teams [*required*]            | [object]      | Array of Microsoft Teams in this integration metadata.                                                                                                                                                       |
| teams        | ms_channel_id [*required*]    | string        | Microsoft Teams channel ID.                                                                                                                                                                                  |
| teams        | ms_channel_name [*required*]  | string        | Microsoft Teams channel name.                                                                                                                                                                                |
| teams        | ms_tenant_id [*required*]     | string        | Microsoft Teams tenant ID.                                                                                                                                                                                   |
| teams        | redirect_url [*required*]     | string        | URL redirecting to the Microsoft Teams channel.                                                                                                                                                              |
| attributes   | modified                           | date-time     | Timestamp when the incident todo was last modified.                                                                                                                                                          |
| attributes   | status                             | int32         | A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed. |
| data         | type [*required*]             | enum          | Integration metadata resource type. Allowed enum values: `incident_integrations`                                                                                                                             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "incident_id": "00000000-0000-0000-1234-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#updated-channel-name",
            "team_id": "T01234567",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
          }
        ]
      }
    },
    "type": "incident_integrations"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with an incident integration metadata.

| Parent field          | Field                              | Type            | Description                                                                                                                                                                                                  |
| --------------------- | ---------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|                       | data [*required*]             | object          | Incident integration metadata from a response.                                                                                                                                                               |
| data                  | attributes                         | object          | Incident integration metadata's attributes for a create request.                                                                                                                                             |
| attributes            | created                            | date-time       | Timestamp when the incident todo was created.                                                                                                                                                                |
| attributes            | incident_id                        | string          | UUID of the incident this integration metadata is connected to.                                                                                                                                              |
| attributes            | integration_type [*required*] | int32           | A number indicating the type of integration this metadata is for. 1 indicates Slack; 8 indicates Jira.                                                                                                       |
| attributes            | metadata [*required*]         |  <oneOf>   | Incident integration metadata's metadata attribute.                                                                                                                                                          |
| metadata              | Option 1                           | object          | Incident integration metadata for the Slack integration.                                                                                                                                                     |
| Option 1              | channels [*required*]         | [object]        | Array of Slack channels in this integration metadata.                                                                                                                                                        |
| channels              | channel_id [*required*]       | string          | Slack channel ID.                                                                                                                                                                                            |
| channels              | channel_name [*required*]     | string          | Name of the Slack channel.                                                                                                                                                                                   |
| channels              | redirect_url [*required*]     | string          | URL redirecting to the Slack channel.                                                                                                                                                                        |
| channels              | team_id                            | string          | Slack team ID.                                                                                                                                                                                               |
| metadata              | Option 2                           | object          | Incident integration metadata for the Jira integration.                                                                                                                                                      |
| Option 2              | issues [*required*]           | [object]        | Array of Jira issues in this integration metadata.                                                                                                                                                           |
| issues                | account [*required*]          | string          | URL of issue's Jira account.                                                                                                                                                                                 |
| issues                | issue_key                          | string          | Jira issue's issue key.                                                                                                                                                                                      |
| issues                | issuetype_id                       | string          | Jira issue's issue type.                                                                                                                                                                                     |
| issues                | project_key [*required*]      | string          | Jira issue's project keys.                                                                                                                                                                                   |
| issues                | redirect_url                       | string          | URL redirecting to the Jira issue.                                                                                                                                                                           |
| metadata              | Option 3                           | object          | Incident integration metadata for the Microsoft Teams integration.                                                                                                                                           |
| Option 3              | teams [*required*]            | [object]        | Array of Microsoft Teams in this integration metadata.                                                                                                                                                       |
| teams                 | ms_channel_id [*required*]    | string          | Microsoft Teams channel ID.                                                                                                                                                                                  |
| teams                 | ms_channel_name [*required*]  | string          | Microsoft Teams channel name.                                                                                                                                                                                |
| teams                 | ms_tenant_id [*required*]     | string          | Microsoft Teams tenant ID.                                                                                                                                                                                   |
| teams                 | redirect_url [*required*]     | string          | URL redirecting to the Microsoft Teams channel.                                                                                                                                                              |
| attributes            | modified                           | date-time       | Timestamp when the incident todo was last modified.                                                                                                                                                          |
| attributes            | status                             | int32           | A number indicating the status of this integration metadata. 0 indicates unknown; 1 indicates pending; 2 indicates complete; 3 indicates manually created; 4 indicates manually updated; 5 indicates failed. |
| data                  | id [*required*]               | string          | The incident integration metadata's ID.                                                                                                                                                                      |
| data                  | relationships                      | object          | The incident's integration relationships from a response.                                                                                                                                                    |
| 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`                                                                                                                                                            |
| 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`                                                                                                                                                            |
| data                  | type [*required*]             | enum            | Integration metadata resource type. Allowed enum values: `incident_integrations`                                                                                                                             |
|                       | included                           | [ <oneOf>] | Included related resources that the user requested.                                                                                                                                                          |
| included              | Option 1                           | object          | User object returned by the API.                                                                                                                                                                             |
| Option 1              | attributes                         | object          | Attributes of user object returned by the API.                                                                                                                                                               |
| attributes            | created_at                         | date-time       | Creation time of the user.                                                                                                                                                                                   |
| attributes            | disabled                           | boolean         | Whether the user is disabled.                                                                                                                                                                                |
| attributes            | email                              | string          | Email of the user.                                                                                                                                                                                           |
| attributes            | handle                             | string          | Handle of the user.                                                                                                                                                                                          |
| attributes            | icon                               | string          | URL of the user's icon.                                                                                                                                                                                      |
| attributes            | last_login_time                    | date-time       | The last time the user logged in.                                                                                                                                                                            |
| attributes            | mfa_enabled                        | boolean         | If user has MFA enabled.                                                                                                                                                                                     |
| attributes            | modified_at                        | date-time       | Time that the user was last modified.                                                                                                                                                                        |
| attributes            | name                               | string          | Name of the user.                                                                                                                                                                                            |
| attributes            | service_account                    | boolean         | Whether the user is a service account.                                                                                                                                                                       |
| attributes            | status                             | string          | Status of the user.                                                                                                                                                                                          |
| attributes            | title                              | string          | Title of the user.                                                                                                                                                                                           |
| attributes            | verified                           | boolean         | Whether the user is verified.                                                                                                                                                                                |
| Option 1              | id                                 | string          | ID of the user.                                                                                                                                                                                              |
| Option 1              | relationships                      | object          | Relationships of the user object returned by the API.                                                                                                                                                        |
| relationships         | org                                | object          | Relationship to an organization.                                                                                                                                                                             |
| org                   | data [*required*]             | object          | Relationship to organization object.                                                                                                                                                                         |
| data                  | id [*required*]               | string          | ID of the organization.                                                                                                                                                                                      |
| data                  | type [*required*]             | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                                                                                     |
| relationships         | other_orgs                         | object          | Relationship to organizations.                                                                                                                                                                               |
| other_orgs            | data [*required*]             | [object]        | Relationships to organization objects.                                                                                                                                                                       |
| data                  | id [*required*]               | string          | ID of the organization.                                                                                                                                                                                      |
| data                  | type [*required*]             | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                                                                                     |
| relationships         | other_users                        | object          | Relationship to users.                                                                                                                                                                                       |
| other_users           | data [*required*]             | [object]        | Relationships to user objects.                                                                                                                                                                               |
| data                  | id [*required*]               | string          | A unique identifier that represents the user.                                                                                                                                                                |
| data                  | type [*required*]             | enum            | Users resource type. Allowed enum values: `users`                                                                                                                                                            |
| relationships         | roles                              | object          | Relationship to roles.                                                                                                                                                                                       |
| roles                 | data                               | [object]        | An array containing type and the unique identifier of a role.                                                                                                                                                |
| data                  | id                                 | string          | The unique identifier of the role.                                                                                                                                                                           |
| data                  | type                               | enum            | Roles type. Allowed enum values: `roles`                                                                                                                                                                     |
| Option 1              | type                               | enum            | Users resource type. Allowed enum values: `users`                                                                                                                                                            |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created": "2019-09-19T10:00:00.000Z",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#example-channel-name",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789\u0026team=T01234567",
            "team_id": "T01234567"
          }
        ]
      },
      "modified": "2019-09-19T10:00:00.000Z",
      "status": "integer"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_integrations"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                          \# Path parametersexport incident_id="CHANGE_ME"export integration_metadata_id="CHANGE_ME"\# Curl commandcurl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/relationships/integrations/${integration_metadata_id}" \
-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": {
      "incident_id": "00000000-0000-0000-1234-000000000000",
      "integration_type": 1,
      "metadata": {
        "channels": [
          {
            "channel_id": "C0123456789",
            "channel_name": "#updated-channel-name",
            "team_id": "T01234567",
            "redirect_url": "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
          }
        ]
      }
    },
    "type": "incident_integrations"
  }
}
EOF
                        
##### 

```go
// Update an existing incident integration metadata 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	// the "incident" has an "incident_integration_metadata"
	IncidentIntegrationMetadataDataID := os.Getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID")

	body := datadogV2.IncidentIntegrationMetadataPatchRequest{
		Data: datadogV2.IncidentIntegrationMetadataPatchData{
			Attributes: datadogV2.IncidentIntegrationMetadataAttributes{
				IncidentId:      datadog.PtrString(IncidentDataID),
				IntegrationType: 1,
				Metadata: datadogV2.IncidentIntegrationMetadataMetadata{
					SlackIntegrationMetadata: &datadogV2.SlackIntegrationMetadata{
						Channels: []datadogV2.SlackIntegrationMetadataChannelItem{
							{
								ChannelId:   "C0123456789",
								ChannelName: "#updated-channel-name",
								TeamId:      datadog.PtrString("T01234567"),
								RedirectUrl: "https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
							},
						},
					}},
			},
			Type: datadogV2.INCIDENTINTEGRATIONMETADATATYPE_INCIDENT_INTEGRATIONS,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateIncidentIntegration", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.UpdateIncidentIntegration(ctx, IncidentDataID, IncidentIntegrationMetadataDataID, body)

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

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

#### Instructions

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

```java
// Update an existing incident integration metadata 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.IncidentIntegrationMetadataAttributes;
import com.datadog.api.client.v2.model.IncidentIntegrationMetadataMetadata;
import com.datadog.api.client.v2.model.IncidentIntegrationMetadataPatchData;
import com.datadog.api.client.v2.model.IncidentIntegrationMetadataPatchRequest;
import com.datadog.api.client.v2.model.IncidentIntegrationMetadataResponse;
import com.datadog.api.client.v2.model.IncidentIntegrationMetadataType;
import com.datadog.api.client.v2.model.SlackIntegrationMetadata;
import com.datadog.api.client.v2.model.SlackIntegrationMetadataChannelItem;
import java.util.Collections;

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

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

    // the "incident" has an "incident_integration_metadata"
    String INCIDENT_INTEGRATION_METADATA_DATA_ID =
        System.getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID");

    IncidentIntegrationMetadataPatchRequest body =
        new IncidentIntegrationMetadataPatchRequest()
            .data(
                new IncidentIntegrationMetadataPatchData()
                    .attributes(
                        new IncidentIntegrationMetadataAttributes()
                            .incidentId(INCIDENT_DATA_ID)
                            .integrationType(1)
                            .metadata(
                                new IncidentIntegrationMetadataMetadata(
                                    new SlackIntegrationMetadata()
                                        .channels(
                                            Collections.singletonList(
                                                new SlackIntegrationMetadataChannelItem()
                                                    .channelId("C0123456789")
                                                    .channelName("#updated-channel-name")
                                                    .teamId("T01234567")
                                                    .redirectUrl(
                                                        "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"))))))
                    .type(IncidentIntegrationMetadataType.INCIDENT_INTEGRATIONS));

    try {
      IncidentIntegrationMetadataResponse result =
          apiInstance.updateIncidentIntegration(
              INCIDENT_DATA_ID, INCIDENT_INTEGRATION_METADATA_DATA_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#updateIncidentIntegration");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Update an existing incident integration metadata 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_integration_metadata_attributes import IncidentIntegrationMetadataAttributes
from datadog_api_client.v2.model.incident_integration_metadata_patch_data import IncidentIntegrationMetadataPatchData
from datadog_api_client.v2.model.incident_integration_metadata_patch_request import (
    IncidentIntegrationMetadataPatchRequest,
)
from datadog_api_client.v2.model.incident_integration_metadata_type import IncidentIntegrationMetadataType
from datadog_api_client.v2.model.slack_integration_metadata import SlackIntegrationMetadata
from datadog_api_client.v2.model.slack_integration_metadata_channel_item import SlackIntegrationMetadataChannelItem

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

# the "incident" has an "incident_integration_metadata"
INCIDENT_INTEGRATION_METADATA_DATA_ID = environ["INCIDENT_INTEGRATION_METADATA_DATA_ID"]

body = IncidentIntegrationMetadataPatchRequest(
    data=IncidentIntegrationMetadataPatchData(
        attributes=IncidentIntegrationMetadataAttributes(
            incident_id=INCIDENT_DATA_ID,
            integration_type=1,
            metadata=SlackIntegrationMetadata(
                channels=[
                    SlackIntegrationMetadataChannelItem(
                        channel_id="C0123456789",
                        channel_name="#updated-channel-name",
                        team_id="T01234567",
                        redirect_url="https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
                    ),
                ],
            ),
        ),
        type=IncidentIntegrationMetadataType.INCIDENT_INTEGRATIONS,
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_incident_integration"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.update_incident_integration(
        incident_id=INCIDENT_DATA_ID, integration_metadata_id=INCIDENT_INTEGRATION_METADATA_DATA_ID, body=body
    )

    print(response)
```

#### Instructions

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

```ruby
# Update an existing incident integration metadata returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

# the "incident" has an "incident_integration_metadata"
INCIDENT_INTEGRATION_METADATA_DATA_ID = ENV["INCIDENT_INTEGRATION_METADATA_DATA_ID"]

body = DatadogAPIClient::V2::IncidentIntegrationMetadataPatchRequest.new({
  data: DatadogAPIClient::V2::IncidentIntegrationMetadataPatchData.new({
    attributes: DatadogAPIClient::V2::IncidentIntegrationMetadataAttributes.new({
      incident_id: INCIDENT_DATA_ID,
      integration_type: 1,
      metadata: DatadogAPIClient::V2::SlackIntegrationMetadata.new({
        channels: [
          DatadogAPIClient::V2::SlackIntegrationMetadataChannelItem.new({
            channel_id: "C0123456789",
            channel_name: "#updated-channel-name",
            team_id: "T01234567",
            redirect_url: "https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
          }),
        ],
      }),
    }),
    type: DatadogAPIClient::V2::IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,
  }),
})
p api_instance.update_incident_integration(INCIDENT_DATA_ID, INCIDENT_INTEGRATION_METADATA_DATA_ID, body)
```

#### Instructions

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

```rust
// Update an existing incident integration metadata returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataAttributes;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataMetadata;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataPatchData;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataPatchRequest;
use datadog_api_client::datadogV2::model::IncidentIntegrationMetadataType;
use datadog_api_client::datadogV2::model::SlackIntegrationMetadata;
use datadog_api_client::datadogV2::model::SlackIntegrationMetadataChannelItem;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_integration_metadata"
    let incident_integration_metadata_data_id =
        std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();
    let body =
        IncidentIntegrationMetadataPatchRequest::new(IncidentIntegrationMetadataPatchData::new(
            IncidentIntegrationMetadataAttributes::new(
                1,
                IncidentIntegrationMetadataMetadata::SlackIntegrationMetadata(Box::new(
                    SlackIntegrationMetadata::new(vec![SlackIntegrationMetadataChannelItem::new(
                        "C0123456789".to_string(),
                        "#updated-channel-name".to_string(),
                        "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
                            .to_string(),
                    )
                    .team_id("T01234567".to_string())]),
                )),
            )
            .incident_id(incident_data_id.clone()),
            IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,
        ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncidentIntegration", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident_integration(
            incident_data_id.clone(),
            incident_integration_metadata_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://docs.datadoghq.com/api/latest/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Update an existing incident integration metadata returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateIncidentIntegration"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

// the "incident" has an "incident_integration_metadata"
const INCIDENT_INTEGRATION_METADATA_DATA_ID = process.env
  .INCIDENT_INTEGRATION_METADATA_DATA_ID as string;

const params: v2.IncidentsApiUpdateIncidentIntegrationRequest = {
  body: {
    data: {
      attributes: {
        incidentId: INCIDENT_DATA_ID,
        integrationType: 1,
        metadata: {
          channels: [
            {
              channelId: "C0123456789",
              channelName: "#updated-channel-name",
              teamId: "T01234567",
              redirectUrl:
                "https://slack.com/app_redirect?channel=C0123456789&team=T01234567",
            },
          ],
        },
      },
      type: "incident_integrations",
    },
  },
  incidentId: INCIDENT_DATA_ID,
  integrationMetadataId: INCIDENT_INTEGRATION_METADATA_DATA_ID,
};

apiInstance
  .updateIncidentIntegration(params)
  .then((data: v2.IncidentIntegrationMetadataResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Delete an incident integration metadata{% #delete-an-incident-integration-metadata %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                                             |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------ |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id} |

### Overview

Delete an incident integration metadata.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                                      | Type   | Description                                    |
| ----------------------------------------- | ------ | ---------------------------------------------- |
| incident_id [*required*]             | string | The UUID of the incident.                      |
| integration_metadata_id [*required*] | string | The UUID of the incident integration metadata. |

### Response

{% tab title="204" %}
OK
{% /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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"export integration_metadata_id="CHANGE_ME"\# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/relationships/integrations/${integration_metadata_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Delete an incident integration metadata returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

# the "incident" has an "incident_integration_metadata"
INCIDENT_INTEGRATION_METADATA_DATA_ID = environ["INCIDENT_INTEGRATION_METADATA_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["delete_incident_integration"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    api_instance.delete_incident_integration(
        incident_id=INCIDENT_DATA_ID,
        integration_metadata_id=INCIDENT_INTEGRATION_METADATA_DATA_ID,
    )
```

#### Instructions

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

```ruby
# Delete an incident integration metadata returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

# the "incident" has an "incident_integration_metadata"
INCIDENT_INTEGRATION_METADATA_DATA_ID = ENV["INCIDENT_INTEGRATION_METADATA_DATA_ID"]
api_instance.delete_incident_integration(INCIDENT_DATA_ID, INCIDENT_INTEGRATION_METADATA_DATA_ID)
```

#### Instructions

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

```go
// Delete an incident integration metadata returns "OK" response

package main

import (
	"context"
	"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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	// the "incident" has an "incident_integration_metadata"
	IncidentIntegrationMetadataDataID := os.Getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteIncidentIntegration", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	r, err := api.DeleteIncidentIntegration(ctx, IncidentDataID, IncidentIntegrationMetadataDataID)

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

#### Instructions

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

```java
// Delete an incident integration metadata returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;

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

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

    // the "incident" has an "incident_integration_metadata"
    String INCIDENT_INTEGRATION_METADATA_DATA_ID =
        System.getenv("INCIDENT_INTEGRATION_METADATA_DATA_ID");

    try {
      apiInstance.deleteIncidentIntegration(
          INCIDENT_DATA_ID, INCIDENT_INTEGRATION_METADATA_DATA_ID);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#deleteIncidentIntegration");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Delete an incident integration metadata returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_integration_metadata"
    let incident_integration_metadata_data_id =
        std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncidentIntegration", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .delete_incident_integration(
            incident_data_id.clone(),
            incident_integration_metadata_data_id.clone(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Delete an incident integration metadata returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteIncidentIntegration"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

// the "incident" has an "incident_integration_metadata"
const INCIDENT_INTEGRATION_METADATA_DATA_ID = process.env
  .INCIDENT_INTEGRATION_METADATA_DATA_ID as string;

const params: v2.IncidentsApiDeleteIncidentIntegrationRequest = {
  incidentId: INCIDENT_DATA_ID,
  integrationMetadataId: INCIDENT_INTEGRATION_METADATA_DATA_ID,
};

apiInstance
  .deleteIncidentIntegration(params)
  .then((data: any) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Get a list of an incident's todos{% #get-a-list-of-an-incidents-todos %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                         |
| ----------------- | ------------------------------------------------------------------------------------ |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/todos      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todos      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos |

### Overview

Get all todos for an incident. This endpoint requires the `incident_read` permission.

OAuth apps require the `incident_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description               |
| ----------------------------- | ------ | ------------------------- |
| incident_id [*required*] | string | The UUID of the incident. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with a list of incident todos.

| Parent field          | Field                       | Type            | Description                                                                                                 |
| --------------------- | --------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------- |
|                       | data [*required*]      | [object]        | An array of incident todos.                                                                                 |
| data                  | attributes                  | object          | Incident todo's attributes.                                                                                 |
| attributes            | assignees [*required*] | [ <oneOf>] | Array of todo assignees.                                                                                    |
| assignees             | Option 1                    | string          | Assignee's @-handle.                                                                                        |
| assignees             | Option 2                    | object          | Anonymous assignee entity.                                                                                  |
| Option 2              | icon [*required*]      | string          | URL for assignee's icon.                                                                                    |
| Option 2              | id [*required*]        | string          | Anonymous assignee's ID.                                                                                    |
| Option 2              | name [*required*]      | string          | Assignee's name.                                                                                            |
| Option 2              | source [*required*]    | enum            | The source of the anonymous assignee. Allowed enum values: `slack,microsoft_teams`                          |
| attributes            | completed                   | string          | Timestamp when the todo was completed.                                                                      |
| attributes            | content [*required*]   | string          | The follow-up task's content.                                                                               |
| attributes            | created                     | date-time       | Timestamp when the incident todo was created.                                                               |
| attributes            | due_date                    | string          | Timestamp when the todo should be completed by.                                                             |
| attributes            | incident_id                 | string          | UUID of the incident this todo is connected to.                                                             |
| attributes            | modified                    | date-time       | Timestamp when the incident todo was last modified.                                                         |
| data                  | id [*required*]        | string          | The incident todo's ID.                                                                                     |
| data                  | relationships               | object          | The incident's relationships from a response.                                                               |
| 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`                                                           |
| 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`                                                           |
| data                  | type [*required*]      | enum            | Todo resource type. Allowed enum values: `incident_todos`                                                   |
|                       | included                    | [ <oneOf>] | Included related resources that the user requested.                                                         |
| included              | Option 1                    | object          | User object returned by the API.                                                                            |
| Option 1              | attributes                  | object          | Attributes of user object returned by the API.                                                              |
| attributes            | created_at                  | date-time       | Creation time of the user.                                                                                  |
| attributes            | disabled                    | boolean         | Whether the user is disabled.                                                                               |
| attributes            | email                       | string          | Email of the user.                                                                                          |
| attributes            | handle                      | string          | Handle of the user.                                                                                         |
| attributes            | icon                        | string          | URL of the user's icon.                                                                                     |
| attributes            | last_login_time             | date-time       | The last time the user logged in.                                                                           |
| attributes            | mfa_enabled                 | boolean         | If user has MFA enabled.                                                                                    |
| attributes            | modified_at                 | date-time       | Time that the user was last modified.                                                                       |
| attributes            | name                        | string          | Name of the user.                                                                                           |
| attributes            | service_account             | boolean         | Whether the user is a service account.                                                                      |
| attributes            | status                      | string          | Status of the user.                                                                                         |
| attributes            | title                       | string          | Title of the user.                                                                                          |
| attributes            | verified                    | boolean         | Whether the user is verified.                                                                               |
| Option 1              | id                          | string          | ID of the user.                                                                                             |
| Option 1              | relationships               | object          | Relationships of the user object returned by the API.                                                       |
| relationships         | org                         | object          | Relationship to an organization.                                                                            |
| org                   | data [*required*]      | object          | Relationship to organization object.                                                                        |
| data                  | id [*required*]        | string          | ID of the organization.                                                                                     |
| data                  | type [*required*]      | enum            | Organizations resource type. Allowed enum values: `orgs`                                                    |
| relationships         | other_orgs                  | object          | Relationship to organizations.                                                                              |
| other_orgs            | data [*required*]      | [object]        | Relationships to organization objects.                                                                      |
| data                  | id [*required*]        | string          | ID of the organization.                                                                                     |
| data                  | type [*required*]      | enum            | Organizations resource type. Allowed enum values: `orgs`                                                    |
| relationships         | other_users                 | object          | Relationship to users.                                                                                      |
| other_users           | data [*required*]      | [object]        | Relationships to user objects.                                                                              |
| data                  | id [*required*]        | string          | A unique identifier that represents the user.                                                               |
| data                  | type [*required*]      | enum            | Users resource type. Allowed enum values: `users`                                                           |
| relationships         | roles                       | object          | Relationship to roles.                                                                                      |
| roles                 | data                        | [object]        | An array containing type and the unique identifier of a role.                                               |
| data                  | id                          | string          | The unique identifier of the role.                                                                          |
| data                  | type                        | enum            | Roles type. Allowed enum values: `roles`                                                                    |
| Option 1              | type                        | enum            | Users resource type. Allowed enum values: `users`                                                           |
|                       | meta                        | object          | The metadata object containing pagination metadata.                                                         |
| meta                  | pagination                  | object          | Pagination properties.                                                                                      |
| pagination            | next_offset                 | int64           | The index of the first element in the next page of results. Equal to page size added to the current offset. |
| pagination            | offset                      | int64           | The index of the first element in the results.                                                              |
| pagination            | size                        | int64           | Maximum size of pages to return.                                                                            |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "assignees": [
          {
            "description": "@test.user@test.com",
            "example": "@test.user@test.com",
            "type": "@test.user@test.com"
          }
        ],
        "completed": "2023-03-06T22:00:00.000000+00:00",
        "content": "Restore lost data.",
        "created": "2019-09-19T10:00:00.000Z",
        "due_date": "2023-07-10T05:00:00.000000+00:00",
        "incident_id": "00000000-aaaa-0000-0000-000000000000",
        "modified": "2019-09-19T10:00:00.000Z"
      },
      "id": "00000000-0000-0000-1234-000000000000",
      "relationships": {
        "created_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        }
      },
      "type": "incident_todos"
    }
  ],
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ],
  "meta": {
    "pagination": {
      "next_offset": 1000,
      "offset": 10,
      "size": 1000
    }
  }
}
```

{% /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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/relationships/todos" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Get a list of an incident's todos returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["list_incident_todos"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.list_incident_todos(
        incident_id=INCIDENT_DATA_ID,
    )

    print(response)
```

#### Instructions

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

```ruby
# Get a list of an incident's todos returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]
p api_instance.list_incident_todos(INCIDENT_DATA_ID)
```

#### Instructions

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

```go
// Get a list of an incident's todos 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListIncidentTodos", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.ListIncidentTodos(ctx, IncidentDataID)

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

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

#### Instructions

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

```java
// Get a list of an incident's todos 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.IncidentTodoListResponse;

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

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

    try {
      IncidentTodoListResponse result = apiInstance.listIncidentTodos(INCIDENT_DATA_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#listIncidentTodos");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get a list of an incident's todos returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidentTodos", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.list_incident_todos(incident_data_id.clone()).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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get a list of an incident's todos returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listIncidentTodos"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiListIncidentTodosRequest = {
  incidentId: INCIDENT_DATA_ID,
};

apiInstance
  .listIncidentTodos(params)
  .then((data: v2.IncidentTodoListResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Create an incident todo{% #create-an-incident-todo %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                          |
| ----------------- | ------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/todos      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todos      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos |

### Overview

Create an incident todo. This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description               |
| ----------------------------- | ------ | ------------------------- |
| incident_id [*required*] | string | The UUID of the incident. |

### Request

#### Body Data (required)

Incident todo payload.

{% tab title="Model" %}

| Parent field | Field                        | Type            | Description                                                                        |
| ------------ | ---------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|              | data [*required*]       | object          | Incident todo data for a create request.                                           |
| data         | attributes [*required*] | object          | Incident todo's attributes.                                                        |
| attributes   | assignees [*required*]  | [ <oneOf>] | Array of todo assignees.                                                           |
| assignees    | Option 1                     | string          | Assignee's @-handle.                                                               |
| assignees    | Option 2                     | object          | Anonymous assignee entity.                                                         |
| Option 2     | icon [*required*]       | string          | URL for assignee's icon.                                                           |
| Option 2     | id [*required*]         | string          | Anonymous assignee's ID.                                                           |
| Option 2     | name [*required*]       | string          | Assignee's name.                                                                   |
| Option 2     | source [*required*]     | enum            | The source of the anonymous assignee. Allowed enum values: `slack,microsoft_teams` |
| attributes   | completed                    | string          | Timestamp when the todo was completed.                                             |
| attributes   | content [*required*]    | string          | The follow-up task's content.                                                      |
| attributes   | created                      | date-time       | Timestamp when the incident todo was created.                                      |
| attributes   | due_date                     | string          | Timestamp when the todo should be completed by.                                    |
| attributes   | incident_id                  | string          | UUID of the incident this todo is connected to.                                    |
| attributes   | modified                     | date-time       | Timestamp when the incident todo was last modified.                                |
| data         | type [*required*]       | enum            | Todo resource type. Allowed enum values: `incident_todos`                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "assignees": [
        "@test.user@test.com"
      ],
      "content": "Restore lost data."
    },
    "type": "incident_todos"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
CREATED
{% tab title="Model" %}
Response with an incident todo.

| Parent field          | Field                       | Type            | Description                                                                        |
| --------------------- | --------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|                       | data [*required*]      | object          | Incident todo response data.                                                       |
| data                  | attributes                  | object          | Incident todo's attributes.                                                        |
| attributes            | assignees [*required*] | [ <oneOf>] | Array of todo assignees.                                                           |
| assignees             | Option 1                    | string          | Assignee's @-handle.                                                               |
| assignees             | Option 2                    | object          | Anonymous assignee entity.                                                         |
| Option 2              | icon [*required*]      | string          | URL for assignee's icon.                                                           |
| Option 2              | id [*required*]        | string          | Anonymous assignee's ID.                                                           |
| Option 2              | name [*required*]      | string          | Assignee's name.                                                                   |
| Option 2              | source [*required*]    | enum            | The source of the anonymous assignee. Allowed enum values: `slack,microsoft_teams` |
| attributes            | completed                   | string          | Timestamp when the todo was completed.                                             |
| attributes            | content [*required*]   | string          | The follow-up task's content.                                                      |
| attributes            | created                     | date-time       | Timestamp when the incident todo was created.                                      |
| attributes            | due_date                    | string          | Timestamp when the todo should be completed by.                                    |
| attributes            | incident_id                 | string          | UUID of the incident this todo is connected to.                                    |
| attributes            | modified                    | date-time       | Timestamp when the incident todo was last modified.                                |
| data                  | id [*required*]        | string          | The incident todo's ID.                                                            |
| data                  | relationships               | object          | The incident's relationships from a response.                                      |
| 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`                                  |
| 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`                                  |
| data                  | type [*required*]      | enum            | Todo resource type. Allowed enum values: `incident_todos`                          |
|                       | included                    | [ <oneOf>] | Included related resources that the user requested.                                |
| included              | Option 1                    | object          | User object returned by the API.                                                   |
| Option 1              | attributes                  | object          | Attributes of user object returned by the API.                                     |
| attributes            | created_at                  | date-time       | Creation time of the user.                                                         |
| attributes            | disabled                    | boolean         | Whether the user is disabled.                                                      |
| attributes            | email                       | string          | Email of the user.                                                                 |
| attributes            | handle                      | string          | Handle of the user.                                                                |
| attributes            | icon                        | string          | URL of the user's icon.                                                            |
| attributes            | last_login_time             | date-time       | The last time the user logged in.                                                  |
| attributes            | mfa_enabled                 | boolean         | If user has MFA enabled.                                                           |
| attributes            | modified_at                 | date-time       | Time that the user was last modified.                                              |
| attributes            | name                        | string          | Name of the user.                                                                  |
| attributes            | service_account             | boolean         | Whether the user is a service account.                                             |
| attributes            | status                      | string          | Status of the user.                                                                |
| attributes            | title                       | string          | Title of the user.                                                                 |
| attributes            | verified                    | boolean         | Whether the user is verified.                                                      |
| Option 1              | id                          | string          | ID of the user.                                                                    |
| Option 1              | relationships               | object          | Relationships of the user object returned by the API.                              |
| relationships         | org                         | object          | Relationship to an organization.                                                   |
| org                   | data [*required*]      | object          | Relationship to organization object.                                               |
| data                  | id [*required*]        | string          | ID of the organization.                                                            |
| data                  | type [*required*]      | enum            | Organizations resource type. Allowed enum values: `orgs`                           |
| relationships         | other_orgs                  | object          | Relationship to organizations.                                                     |
| other_orgs            | data [*required*]      | [object]        | Relationships to organization objects.                                             |
| data                  | id [*required*]        | string          | ID of the organization.                                                            |
| data                  | type [*required*]      | enum            | Organizations resource type. Allowed enum values: `orgs`                           |
| relationships         | other_users                 | object          | Relationship to users.                                                             |
| other_users           | data [*required*]      | [object]        | Relationships to user objects.                                                     |
| data                  | id [*required*]        | string          | A unique identifier that represents the user.                                      |
| data                  | type [*required*]      | enum            | Users resource type. Allowed enum values: `users`                                  |
| relationships         | roles                       | object          | Relationship to roles.                                                             |
| roles                 | data                        | [object]        | An array containing type and the unique identifier of a role.                      |
| data                  | id                          | string          | The unique identifier of the role.                                                 |
| data                  | type                        | enum            | Roles type. Allowed enum values: `roles`                                           |
| Option 1              | type                        | enum            | Users resource type. Allowed enum values: `users`                                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "assignees": [
        {
          "description": "@test.user@test.com",
          "example": "@test.user@test.com",
          "type": "@test.user@test.com"
        }
      ],
      "completed": "2023-03-06T22:00:00.000000+00:00",
      "content": "Restore lost data.",
      "created": "2019-09-19T10:00:00.000Z",
      "due_date": "2023-07-10T05:00:00.000000+00:00",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "modified": "2019-09-19T10:00:00.000Z"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_todos"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                          \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/relationships/todos" \
-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": {
      "assignees": [
        "@test.user@test.com"
      ],
      "content": "Restore lost data."
    },
    "type": "incident_todos"
  }
}
EOF
                        
##### 

```go
// Create an incident todo returns "CREATED" 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	body := datadogV2.IncidentTodoCreateRequest{
		Data: datadogV2.IncidentTodoCreateData{
			Attributes: datadogV2.IncidentTodoAttributes{
				Assignees: []datadogV2.IncidentTodoAssignee{
					datadogV2.IncidentTodoAssignee{
						IncidentTodoAssigneeHandle: datadog.PtrString("@test.user@test.com")},
				},
				Content: "Restore lost data.",
			},
			Type: datadogV2.INCIDENTTODOTYPE_INCIDENT_TODOS,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateIncidentTodo", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.CreateIncidentTodo(ctx, IncidentDataID, body)

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

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

#### Instructions

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

```java
// Create an incident todo returns "CREATED" 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.IncidentTodoAssignee;
import com.datadog.api.client.v2.model.IncidentTodoAttributes;
import com.datadog.api.client.v2.model.IncidentTodoCreateData;
import com.datadog.api.client.v2.model.IncidentTodoCreateRequest;
import com.datadog.api.client.v2.model.IncidentTodoResponse;
import com.datadog.api.client.v2.model.IncidentTodoType;
import java.util.Collections;

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

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

    IncidentTodoCreateRequest body =
        new IncidentTodoCreateRequest()
            .data(
                new IncidentTodoCreateData()
                    .attributes(
                        new IncidentTodoAttributes()
                            .assignees(
                                Collections.singletonList(
                                    new IncidentTodoAssignee("@test.user@test.com")))
                            .content("Restore lost data."))
                    .type(IncidentTodoType.INCIDENT_TODOS));

    try {
      IncidentTodoResponse result = apiInstance.createIncidentTodo(INCIDENT_DATA_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#createIncidentTodo");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Create an incident todo returns "CREATED" 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_todo_assignee_array import IncidentTodoAssigneeArray
from datadog_api_client.v2.model.incident_todo_attributes import IncidentTodoAttributes
from datadog_api_client.v2.model.incident_todo_create_data import IncidentTodoCreateData
from datadog_api_client.v2.model.incident_todo_create_request import IncidentTodoCreateRequest
from datadog_api_client.v2.model.incident_todo_type import IncidentTodoType

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

body = IncidentTodoCreateRequest(
    data=IncidentTodoCreateData(
        attributes=IncidentTodoAttributes(
            assignees=IncidentTodoAssigneeArray(
                [
                    "@test.user@test.com",
                ]
            ),
            content="Restore lost data.",
        ),
        type=IncidentTodoType.INCIDENT_TODOS,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_incident_todo"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.create_incident_todo(incident_id=INCIDENT_DATA_ID, body=body)

    print(response)
```

#### Instructions

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

```ruby
# Create an incident todo returns "CREATED" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

body = DatadogAPIClient::V2::IncidentTodoCreateRequest.new({
  data: DatadogAPIClient::V2::IncidentTodoCreateData.new({
    attributes: DatadogAPIClient::V2::IncidentTodoAttributes.new({
      assignees: [
        "@test.user@test.com",
      ],
      content: "Restore lost data.",
    }),
    type: DatadogAPIClient::V2::IncidentTodoType::INCIDENT_TODOS,
  }),
})
p api_instance.create_incident_todo(INCIDENT_DATA_ID, body)
```

#### Instructions

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

```rust
// Create an incident todo returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentTodoAssignee;
use datadog_api_client::datadogV2::model::IncidentTodoAttributes;
use datadog_api_client::datadogV2::model::IncidentTodoCreateData;
use datadog_api_client::datadogV2::model::IncidentTodoCreateRequest;
use datadog_api_client::datadogV2::model::IncidentTodoType;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
    let body = IncidentTodoCreateRequest::new(IncidentTodoCreateData::new(
        IncidentTodoAttributes::new(
            vec![IncidentTodoAssignee::IncidentTodoAssigneeHandle(
                "@test.user@test.com".to_string(),
            )],
            "Restore lost data.".to_string(),
        ),
        IncidentTodoType::INCIDENT_TODOS,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncidentTodo", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .create_incident_todo(incident_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://docs.datadoghq.com/api/latest/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Create an incident todo returns "CREATED" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentTodo"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiCreateIncidentTodoRequest = {
  body: {
    data: {
      attributes: {
        assignees: ["@test.user@test.com"],
        content: "Restore lost data.",
      },
      type: "incident_todos",
    },
  },
  incidentId: INCIDENT_DATA_ID,
};

apiInstance
  .createIncidentTodo(params)
  .then((data: v2.IncidentTodoResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Get incident todo details{% #get-incident-todo-details %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                   |
| ----------------- | ---------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |

### Overview

Get incident todo details. This endpoint requires the `incident_read` permission.

OAuth apps require the `incident_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description                    |
| ----------------------------- | ------ | ------------------------------ |
| incident_id [*required*] | string | The UUID of the incident.      |
| todo_id [*required*]     | string | The UUID of the incident todo. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with an incident todo.

| Parent field          | Field                       | Type            | Description                                                                        |
| --------------------- | --------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|                       | data [*required*]      | object          | Incident todo response data.                                                       |
| data                  | attributes                  | object          | Incident todo's attributes.                                                        |
| attributes            | assignees [*required*] | [ <oneOf>] | Array of todo assignees.                                                           |
| assignees             | Option 1                    | string          | Assignee's @-handle.                                                               |
| assignees             | Option 2                    | object          | Anonymous assignee entity.                                                         |
| Option 2              | icon [*required*]      | string          | URL for assignee's icon.                                                           |
| Option 2              | id [*required*]        | string          | Anonymous assignee's ID.                                                           |
| Option 2              | name [*required*]      | string          | Assignee's name.                                                                   |
| Option 2              | source [*required*]    | enum            | The source of the anonymous assignee. Allowed enum values: `slack,microsoft_teams` |
| attributes            | completed                   | string          | Timestamp when the todo was completed.                                             |
| attributes            | content [*required*]   | string          | The follow-up task's content.                                                      |
| attributes            | created                     | date-time       | Timestamp when the incident todo was created.                                      |
| attributes            | due_date                    | string          | Timestamp when the todo should be completed by.                                    |
| attributes            | incident_id                 | string          | UUID of the incident this todo is connected to.                                    |
| attributes            | modified                    | date-time       | Timestamp when the incident todo was last modified.                                |
| data                  | id [*required*]        | string          | The incident todo's ID.                                                            |
| data                  | relationships               | object          | The incident's relationships from a response.                                      |
| 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`                                  |
| 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`                                  |
| data                  | type [*required*]      | enum            | Todo resource type. Allowed enum values: `incident_todos`                          |
|                       | included                    | [ <oneOf>] | Included related resources that the user requested.                                |
| included              | Option 1                    | object          | User object returned by the API.                                                   |
| Option 1              | attributes                  | object          | Attributes of user object returned by the API.                                     |
| attributes            | created_at                  | date-time       | Creation time of the user.                                                         |
| attributes            | disabled                    | boolean         | Whether the user is disabled.                                                      |
| attributes            | email                       | string          | Email of the user.                                                                 |
| attributes            | handle                      | string          | Handle of the user.                                                                |
| attributes            | icon                        | string          | URL of the user's icon.                                                            |
| attributes            | last_login_time             | date-time       | The last time the user logged in.                                                  |
| attributes            | mfa_enabled                 | boolean         | If user has MFA enabled.                                                           |
| attributes            | modified_at                 | date-time       | Time that the user was last modified.                                              |
| attributes            | name                        | string          | Name of the user.                                                                  |
| attributes            | service_account             | boolean         | Whether the user is a service account.                                             |
| attributes            | status                      | string          | Status of the user.                                                                |
| attributes            | title                       | string          | Title of the user.                                                                 |
| attributes            | verified                    | boolean         | Whether the user is verified.                                                      |
| Option 1              | id                          | string          | ID of the user.                                                                    |
| Option 1              | relationships               | object          | Relationships of the user object returned by the API.                              |
| relationships         | org                         | object          | Relationship to an organization.                                                   |
| org                   | data [*required*]      | object          | Relationship to organization object.                                               |
| data                  | id [*required*]        | string          | ID of the organization.                                                            |
| data                  | type [*required*]      | enum            | Organizations resource type. Allowed enum values: `orgs`                           |
| relationships         | other_orgs                  | object          | Relationship to organizations.                                                     |
| other_orgs            | data [*required*]      | [object]        | Relationships to organization objects.                                             |
| data                  | id [*required*]        | string          | ID of the organization.                                                            |
| data                  | type [*required*]      | enum            | Organizations resource type. Allowed enum values: `orgs`                           |
| relationships         | other_users                 | object          | Relationship to users.                                                             |
| other_users           | data [*required*]      | [object]        | Relationships to user objects.                                                     |
| data                  | id [*required*]        | string          | A unique identifier that represents the user.                                      |
| data                  | type [*required*]      | enum            | Users resource type. Allowed enum values: `users`                                  |
| relationships         | roles                       | object          | Relationship to roles.                                                             |
| roles                 | data                        | [object]        | An array containing type and the unique identifier of a role.                      |
| data                  | id                          | string          | The unique identifier of the role.                                                 |
| data                  | type                        | enum            | Roles type. Allowed enum values: `roles`                                           |
| Option 1              | type                        | enum            | Users resource type. Allowed enum values: `users`                                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "assignees": [
        {
          "description": "@test.user@test.com",
          "example": "@test.user@test.com",
          "type": "@test.user@test.com"
        }
      ],
      "completed": "2023-03-06T22:00:00.000000+00:00",
      "content": "Restore lost data.",
      "created": "2019-09-19T10:00:00.000Z",
      "due_date": "2023-07-10T05:00:00.000000+00:00",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "modified": "2019-09-19T10:00:00.000Z"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_todos"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"export todo_id="CHANGE_ME"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/relationships/todos/${todo_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Get incident todo details returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

# the "incident" has an "incident_todo"
INCIDENT_TODO_DATA_ID = environ["INCIDENT_TODO_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["get_incident_todo"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.get_incident_todo(
        incident_id=INCIDENT_DATA_ID,
        todo_id=INCIDENT_TODO_DATA_ID,
    )

    print(response)
```

#### Instructions

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

```ruby
# Get incident todo details returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

# the "incident" has an "incident_todo"
INCIDENT_TODO_DATA_ID = ENV["INCIDENT_TODO_DATA_ID"]
p api_instance.get_incident_todo(INCIDENT_DATA_ID, INCIDENT_TODO_DATA_ID)
```

#### Instructions

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

```go
// Get incident todo details 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	// the "incident" has an "incident_todo"
	IncidentTodoDataID := os.Getenv("INCIDENT_TODO_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetIncidentTodo", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.GetIncidentTodo(ctx, IncidentDataID, IncidentTodoDataID)

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

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

#### Instructions

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

```java
// Get incident todo details 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.IncidentTodoResponse;

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

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

    // the "incident" has an "incident_todo"
    String INCIDENT_TODO_DATA_ID = System.getenv("INCIDENT_TODO_DATA_ID");

    try {
      IncidentTodoResponse result =
          apiInstance.getIncidentTodo(INCIDENT_DATA_ID, INCIDENT_TODO_DATA_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#getIncidentTodo");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get incident todo details returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_todo"
    let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetIncidentTodo", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .get_incident_todo(incident_data_id.clone(), incident_todo_data_id.clone())
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get incident todo details returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getIncidentTodo"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

// the "incident" has an "incident_todo"
const INCIDENT_TODO_DATA_ID = process.env.INCIDENT_TODO_DATA_ID as string;

const params: v2.IncidentsApiGetIncidentTodoRequest = {
  incidentId: INCIDENT_DATA_ID,
  todoId: INCIDENT_TODO_DATA_ID,
};

apiInstance
  .getIncidentTodo(params)
  .then((data: v2.IncidentTodoResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Update an incident todo{% #update-an-incident-todo %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                     |
| ----------------- | ------------------------------------------------------------------------------------------------ |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}      |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |

### Overview

Update an incident todo. This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description                    |
| ----------------------------- | ------ | ------------------------------ |
| incident_id [*required*] | string | The UUID of the incident.      |
| todo_id [*required*]     | string | The UUID of the incident todo. |

### Request

#### Body Data (required)

Incident todo payload.

{% tab title="Model" %}

| Parent field | Field                        | Type            | Description                                                                        |
| ------------ | ---------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|              | data [*required*]       | object          | Incident todo data for a patch request.                                            |
| data         | attributes [*required*] | object          | Incident todo's attributes.                                                        |
| attributes   | assignees [*required*]  | [ <oneOf>] | Array of todo assignees.                                                           |
| assignees    | Option 1                     | string          | Assignee's @-handle.                                                               |
| assignees    | Option 2                     | object          | Anonymous assignee entity.                                                         |
| Option 2     | icon [*required*]       | string          | URL for assignee's icon.                                                           |
| Option 2     | id [*required*]         | string          | Anonymous assignee's ID.                                                           |
| Option 2     | name [*required*]       | string          | Assignee's name.                                                                   |
| Option 2     | source [*required*]     | enum            | The source of the anonymous assignee. Allowed enum values: `slack,microsoft_teams` |
| attributes   | completed                    | string          | Timestamp when the todo was completed.                                             |
| attributes   | content [*required*]    | string          | The follow-up task's content.                                                      |
| attributes   | created                      | date-time       | Timestamp when the incident todo was created.                                      |
| attributes   | due_date                     | string          | Timestamp when the todo should be completed by.                                    |
| attributes   | incident_id                  | string          | UUID of the incident this todo is connected to.                                    |
| attributes   | modified                     | date-time       | Timestamp when the incident todo was last modified.                                |
| data         | type [*required*]       | enum            | Todo resource type. Allowed enum values: `incident_todos`                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "assignees": [
        "@test.user@test.com"
      ],
      "content": "Restore lost data.",
      "completed": "2023-03-06T22:00:00.000000+00:00",
      "due_date": "2023-07-10T05:00:00.000000+00:00"
    },
    "type": "incident_todos"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with an incident todo.

| Parent field          | Field                       | Type            | Description                                                                        |
| --------------------- | --------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|                       | data [*required*]      | object          | Incident todo response data.                                                       |
| data                  | attributes                  | object          | Incident todo's attributes.                                                        |
| attributes            | assignees [*required*] | [ <oneOf>] | Array of todo assignees.                                                           |
| assignees             | Option 1                    | string          | Assignee's @-handle.                                                               |
| assignees             | Option 2                    | object          | Anonymous assignee entity.                                                         |
| Option 2              | icon [*required*]      | string          | URL for assignee's icon.                                                           |
| Option 2              | id [*required*]        | string          | Anonymous assignee's ID.                                                           |
| Option 2              | name [*required*]      | string          | Assignee's name.                                                                   |
| Option 2              | source [*required*]    | enum            | The source of the anonymous assignee. Allowed enum values: `slack,microsoft_teams` |
| attributes            | completed                   | string          | Timestamp when the todo was completed.                                             |
| attributes            | content [*required*]   | string          | The follow-up task's content.                                                      |
| attributes            | created                     | date-time       | Timestamp when the incident todo was created.                                      |
| attributes            | due_date                    | string          | Timestamp when the todo should be completed by.                                    |
| attributes            | incident_id                 | string          | UUID of the incident this todo is connected to.                                    |
| attributes            | modified                    | date-time       | Timestamp when the incident todo was last modified.                                |
| data                  | id [*required*]        | string          | The incident todo's ID.                                                            |
| data                  | relationships               | object          | The incident's relationships from a response.                                      |
| 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`                                  |
| 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`                                  |
| data                  | type [*required*]      | enum            | Todo resource type. Allowed enum values: `incident_todos`                          |
|                       | included                    | [ <oneOf>] | Included related resources that the user requested.                                |
| included              | Option 1                    | object          | User object returned by the API.                                                   |
| Option 1              | attributes                  | object          | Attributes of user object returned by the API.                                     |
| attributes            | created_at                  | date-time       | Creation time of the user.                                                         |
| attributes            | disabled                    | boolean         | Whether the user is disabled.                                                      |
| attributes            | email                       | string          | Email of the user.                                                                 |
| attributes            | handle                      | string          | Handle of the user.                                                                |
| attributes            | icon                        | string          | URL of the user's icon.                                                            |
| attributes            | last_login_time             | date-time       | The last time the user logged in.                                                  |
| attributes            | mfa_enabled                 | boolean         | If user has MFA enabled.                                                           |
| attributes            | modified_at                 | date-time       | Time that the user was last modified.                                              |
| attributes            | name                        | string          | Name of the user.                                                                  |
| attributes            | service_account             | boolean         | Whether the user is a service account.                                             |
| attributes            | status                      | string          | Status of the user.                                                                |
| attributes            | title                       | string          | Title of the user.                                                                 |
| attributes            | verified                    | boolean         | Whether the user is verified.                                                      |
| Option 1              | id                          | string          | ID of the user.                                                                    |
| Option 1              | relationships               | object          | Relationships of the user object returned by the API.                              |
| relationships         | org                         | object          | Relationship to an organization.                                                   |
| org                   | data [*required*]      | object          | Relationship to organization object.                                               |
| data                  | id [*required*]        | string          | ID of the organization.                                                            |
| data                  | type [*required*]      | enum            | Organizations resource type. Allowed enum values: `orgs`                           |
| relationships         | other_orgs                  | object          | Relationship to organizations.                                                     |
| other_orgs            | data [*required*]      | [object]        | Relationships to organization objects.                                             |
| data                  | id [*required*]        | string          | ID of the organization.                                                            |
| data                  | type [*required*]      | enum            | Organizations resource type. Allowed enum values: `orgs`                           |
| relationships         | other_users                 | object          | Relationship to users.                                                             |
| other_users           | data [*required*]      | [object]        | Relationships to user objects.                                                     |
| data                  | id [*required*]        | string          | A unique identifier that represents the user.                                      |
| data                  | type [*required*]      | enum            | Users resource type. Allowed enum values: `users`                                  |
| relationships         | roles                       | object          | Relationship to roles.                                                             |
| roles                 | data                        | [object]        | An array containing type and the unique identifier of a role.                      |
| data                  | id                          | string          | The unique identifier of the role.                                                 |
| data                  | type                        | enum            | Roles type. Allowed enum values: `roles`                                           |
| Option 1              | type                        | enum            | Users resource type. Allowed enum values: `users`                                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "assignees": [
        {
          "description": "@test.user@test.com",
          "example": "@test.user@test.com",
          "type": "@test.user@test.com"
        }
      ],
      "completed": "2023-03-06T22:00:00.000000+00:00",
      "content": "Restore lost data.",
      "created": "2019-09-19T10:00:00.000Z",
      "due_date": "2023-07-10T05:00:00.000000+00:00",
      "incident_id": "00000000-aaaa-0000-0000-000000000000",
      "modified": "2019-09-19T10:00:00.000Z"
    },
    "id": "00000000-0000-0000-1234-000000000000",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_todos"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                          \# Path parametersexport incident_id="CHANGE_ME"export todo_id="CHANGE_ME"\# Curl commandcurl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/relationships/todos/${todo_id}" \
-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": {
      "assignees": [
        "@test.user@test.com"
      ],
      "content": "Restore lost data.",
      "completed": "2023-03-06T22:00:00.000000+00:00",
      "due_date": "2023-07-10T05:00:00.000000+00:00"
    },
    "type": "incident_todos"
  }
}
EOF
                        
##### 

```go
// Update an incident todo 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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	// the "incident" has an "incident_todo"
	IncidentTodoDataID := os.Getenv("INCIDENT_TODO_DATA_ID")

	body := datadogV2.IncidentTodoPatchRequest{
		Data: datadogV2.IncidentTodoPatchData{
			Attributes: datadogV2.IncidentTodoAttributes{
				Assignees: []datadogV2.IncidentTodoAssignee{
					datadogV2.IncidentTodoAssignee{
						IncidentTodoAssigneeHandle: datadog.PtrString("@test.user@test.com")},
				},
				Content:   "Restore lost data.",
				Completed: *datadog.NewNullableString(datadog.PtrString("2023-03-06T22:00:00.000000+00:00")),
				DueDate:   *datadog.NewNullableString(datadog.PtrString("2023-07-10T05:00:00.000000+00:00")),
			},
			Type: datadogV2.INCIDENTTODOTYPE_INCIDENT_TODOS,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateIncidentTodo", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.UpdateIncidentTodo(ctx, IncidentDataID, IncidentTodoDataID, body)

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

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

#### Instructions

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

```java
// Update an incident todo 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.IncidentTodoAssignee;
import com.datadog.api.client.v2.model.IncidentTodoAttributes;
import com.datadog.api.client.v2.model.IncidentTodoPatchData;
import com.datadog.api.client.v2.model.IncidentTodoPatchRequest;
import com.datadog.api.client.v2.model.IncidentTodoResponse;
import com.datadog.api.client.v2.model.IncidentTodoType;
import java.util.Collections;

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

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

    // the "incident" has an "incident_todo"
    String INCIDENT_TODO_DATA_ID = System.getenv("INCIDENT_TODO_DATA_ID");

    IncidentTodoPatchRequest body =
        new IncidentTodoPatchRequest()
            .data(
                new IncidentTodoPatchData()
                    .attributes(
                        new IncidentTodoAttributes()
                            .assignees(
                                Collections.singletonList(
                                    new IncidentTodoAssignee("@test.user@test.com")))
                            .content("Restore lost data.")
                            .completed("2023-03-06T22:00:00.000000+00:00")
                            .dueDate("2023-07-10T05:00:00.000000+00:00"))
                    .type(IncidentTodoType.INCIDENT_TODOS));

    try {
      IncidentTodoResponse result =
          apiInstance.updateIncidentTodo(INCIDENT_DATA_ID, INCIDENT_TODO_DATA_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#updateIncidentTodo");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Update an incident todo 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_todo_assignee_array import IncidentTodoAssigneeArray
from datadog_api_client.v2.model.incident_todo_attributes import IncidentTodoAttributes
from datadog_api_client.v2.model.incident_todo_patch_data import IncidentTodoPatchData
from datadog_api_client.v2.model.incident_todo_patch_request import IncidentTodoPatchRequest
from datadog_api_client.v2.model.incident_todo_type import IncidentTodoType

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

# the "incident" has an "incident_todo"
INCIDENT_TODO_DATA_ID = environ["INCIDENT_TODO_DATA_ID"]

body = IncidentTodoPatchRequest(
    data=IncidentTodoPatchData(
        attributes=IncidentTodoAttributes(
            assignees=IncidentTodoAssigneeArray(
                [
                    "@test.user@test.com",
                ]
            ),
            content="Restore lost data.",
            completed="2023-03-06T22:00:00.000000+00:00",
            due_date="2023-07-10T05:00:00.000000+00:00",
        ),
        type=IncidentTodoType.INCIDENT_TODOS,
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_incident_todo"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.update_incident_todo(incident_id=INCIDENT_DATA_ID, todo_id=INCIDENT_TODO_DATA_ID, body=body)

    print(response)
```

#### Instructions

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

```ruby
# Update an incident todo returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

# the "incident" has an "incident_todo"
INCIDENT_TODO_DATA_ID = ENV["INCIDENT_TODO_DATA_ID"]

body = DatadogAPIClient::V2::IncidentTodoPatchRequest.new({
  data: DatadogAPIClient::V2::IncidentTodoPatchData.new({
    attributes: DatadogAPIClient::V2::IncidentTodoAttributes.new({
      assignees: [
        "@test.user@test.com",
      ],
      content: "Restore lost data.",
      completed: "2023-03-06T22:00:00.000000+00:00",
      due_date: "2023-07-10T05:00:00.000000+00:00",
    }),
    type: DatadogAPIClient::V2::IncidentTodoType::INCIDENT_TODOS,
  }),
})
p api_instance.update_incident_todo(INCIDENT_DATA_ID, INCIDENT_TODO_DATA_ID, body)
```

#### Instructions

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

```rust
// Update an incident todo returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentTodoAssignee;
use datadog_api_client::datadogV2::model::IncidentTodoAttributes;
use datadog_api_client::datadogV2::model::IncidentTodoPatchData;
use datadog_api_client::datadogV2::model::IncidentTodoPatchRequest;
use datadog_api_client::datadogV2::model::IncidentTodoType;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_todo"
    let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap();
    let body = IncidentTodoPatchRequest::new(IncidentTodoPatchData::new(
        IncidentTodoAttributes::new(
            vec![IncidentTodoAssignee::IncidentTodoAssigneeHandle(
                "@test.user@test.com".to_string(),
            )],
            "Restore lost data.".to_string(),
        )
        .completed(Some("2023-03-06T22:00:00.000000+00:00".to_string()))
        .due_date(Some("2023-07-10T05:00:00.000000+00:00".to_string())),
        IncidentTodoType::INCIDENT_TODOS,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncidentTodo", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident_todo(
            incident_data_id.clone(),
            incident_todo_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://docs.datadoghq.com/api/latest/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Update an incident todo returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateIncidentTodo"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

// the "incident" has an "incident_todo"
const INCIDENT_TODO_DATA_ID = process.env.INCIDENT_TODO_DATA_ID as string;

const params: v2.IncidentsApiUpdateIncidentTodoRequest = {
  body: {
    data: {
      attributes: {
        assignees: ["@test.user@test.com"],
        content: "Restore lost data.",
        completed: "2023-03-06T22:00:00.000000+00:00",
        dueDate: "2023-07-10T05:00:00.000000+00:00",
      },
      type: "incident_todos",
    },
  },
  incidentId: INCIDENT_DATA_ID,
  todoId: INCIDENT_TODO_DATA_ID,
};

apiInstance
  .updateIncidentTodo(params)
  .then((data: v2.IncidentTodoResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Delete an incident todo{% #delete-an-incident-todo %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                      |
| ----------------- | ------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/relationships/todos/{todo_id} |

### Overview

Delete an incident todo. This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description                    |
| ----------------------------- | ------ | ------------------------------ |
| incident_id [*required*] | string | The UUID of the incident.      |
| todo_id [*required*]     | string | The UUID of the incident todo. |

### Response

{% tab title="204" %}
OK
{% /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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"export todo_id="CHANGE_ME"\# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/relationships/todos/${todo_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Delete an incident todo returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "incident" in the system
INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"]

# the "incident" has an "incident_todo"
INCIDENT_TODO_DATA_ID = environ["INCIDENT_TODO_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["delete_incident_todo"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    api_instance.delete_incident_todo(
        incident_id=INCIDENT_DATA_ID,
        todo_id=INCIDENT_TODO_DATA_ID,
    )
```

#### Instructions

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

```ruby
# Delete an incident todo returns "OK" response

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

# there is a valid "incident" in the system
INCIDENT_DATA_ID = ENV["INCIDENT_DATA_ID"]

# the "incident" has an "incident_todo"
INCIDENT_TODO_DATA_ID = ENV["INCIDENT_TODO_DATA_ID"]
api_instance.delete_incident_todo(INCIDENT_DATA_ID, INCIDENT_TODO_DATA_ID)
```

#### Instructions

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

```go
// Delete an incident todo returns "OK" response

package main

import (
	"context"
	"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" in the system
	IncidentDataID := os.Getenv("INCIDENT_DATA_ID")

	// the "incident" has an "incident_todo"
	IncidentTodoDataID := os.Getenv("INCIDENT_TODO_DATA_ID")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteIncidentTodo", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	r, err := api.DeleteIncidentTodo(ctx, IncidentDataID, IncidentTodoDataID)

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

#### Instructions

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

```java
// Delete an incident todo returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;

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

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

    // the "incident" has an "incident_todo"
    String INCIDENT_TODO_DATA_ID = System.getenv("INCIDENT_TODO_DATA_ID");

    try {
      apiInstance.deleteIncidentTodo(INCIDENT_DATA_ID, INCIDENT_TODO_DATA_ID);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#deleteIncidentTodo");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Delete an incident todo returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "incident" in the system
    let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();

    // the "incident" has an "incident_todo"
    let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap();
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncidentTodo", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .delete_incident_todo(incident_data_id.clone(), incident_todo_data_id.clone())
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Delete an incident todo returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteIncidentTodo"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

// the "incident" has an "incident_todo"
const INCIDENT_TODO_DATA_ID = process.env.INCIDENT_TODO_DATA_ID as string;

const params: v2.IncidentsApiDeleteIncidentTodoRequest = {
  incidentId: INCIDENT_DATA_ID,
  todoId: INCIDENT_TODO_DATA_ID,
};

apiInstance
  .deleteIncidentTodo(params)
  .then((data: any) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Create an incident type{% #create-an-incident-type %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                     |
| ----------------- | ---------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/incidents/config/types |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/incidents/config/types |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/incidents/config/types      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/incidents/config/types      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/incidents/config/types     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/incidents/config/types |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/incidents/config/types |

### Overview

Create an incident type. This endpoint requires the `incident_settings_write` permission.

OAuth apps require the `incident_settings_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Request

#### Body Data (required)

Incident type payload.

{% tab title="Model" %}

| Parent field | Field                        | Type      | Description                                                                                                                                 |
| ------------ | ---------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object    | Incident type data for a create request.                                                                                                    |
| data         | attributes [*required*] | object    | Incident type's attributes.                                                                                                                 |
| attributes   | createdAt                    | date-time | Timestamp when the incident type was created.                                                                                               |
| attributes   | createdBy                    | string    | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes   | lastModifiedBy               | string    | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes   | modifiedAt                   | date-time | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| data         | type [*required*]       | enum      | Incident type resource type. Allowed enum values: `incident_types`                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "description": "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
      "is_default": false,
      "name": "Security Incident"
    },
    "type": "incident_types"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
CREATED
{% tab title="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                    | createdAt                     | date-time | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string    | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string    | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| 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`                                                                                           |
| 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`                                                                                           |
| 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`                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "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 %}

{% /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

##### 
                          \# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/types" \
-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": {
      "description": "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
      "is_default": false,
      "name": "Security Incident"
    },
    "type": "incident_types"
  }
}
EOF
                        
##### 

```go
// Create an incident type returns "CREATED" 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() {
	body := datadogV2.IncidentTypeCreateRequest{
		Data: datadogV2.IncidentTypeCreateData{
			Attributes: datadogV2.IncidentTypeAttributes{
				Description: datadog.PtrString("Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data."),
				IsDefault:   datadog.PtrBool(false),
				Name:        "Security Incident",
			},
			Type: datadogV2.INCIDENTTYPETYPE_INCIDENT_TYPES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateIncidentType", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.CreateIncidentType(ctx, body)

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

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

#### Instructions

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

```java
// Create an incident type returns "CREATED" 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.IncidentTypeAttributes;
import com.datadog.api.client.v2.model.IncidentTypeCreateData;
import com.datadog.api.client.v2.model.IncidentTypeCreateRequest;
import com.datadog.api.client.v2.model.IncidentTypeResponse;
import com.datadog.api.client.v2.model.IncidentTypeType;

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

    IncidentTypeCreateRequest body =
        new IncidentTypeCreateRequest()
            .data(
                new IncidentTypeCreateData()
                    .attributes(
                        new IncidentTypeAttributes()
                            .description(
                                "Any incidents that harm (or have the potential to) the"
                                    + " confidentiality, integrity, or availability of our data.")
                            .isDefault(false)
                            .name("Security Incident"))
                    .type(IncidentTypeType.INCIDENT_TYPES));

    try {
      IncidentTypeResponse result = apiInstance.createIncidentType(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#createIncidentType");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Create an incident type returns "CREATED" response
"""

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_attributes import IncidentTypeAttributes
from datadog_api_client.v2.model.incident_type_create_data import IncidentTypeCreateData
from datadog_api_client.v2.model.incident_type_create_request import IncidentTypeCreateRequest
from datadog_api_client.v2.model.incident_type_type import IncidentTypeType

body = IncidentTypeCreateRequest(
    data=IncidentTypeCreateData(
        attributes=IncidentTypeAttributes(
            description="Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
            is_default=False,
            name="Security Incident",
        ),
        type=IncidentTypeType.INCIDENT_TYPES,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_incident_type"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.create_incident_type(body=body)

    print(response)
```

#### Instructions

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

```ruby
# Create an incident type returns "CREATED" response

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

body = DatadogAPIClient::V2::IncidentTypeCreateRequest.new({
  data: DatadogAPIClient::V2::IncidentTypeCreateData.new({
    attributes: DatadogAPIClient::V2::IncidentTypeAttributes.new({
      description: "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
      is_default: false,
      name: "Security Incident",
    }),
    type: DatadogAPIClient::V2::IncidentTypeType::INCIDENT_TYPES,
  }),
})
p api_instance.create_incident_type(body)
```

#### Instructions

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

```rust
// Create an incident type returns "CREATED" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentTypeAttributes;
use datadog_api_client::datadogV2::model::IncidentTypeCreateData;
use datadog_api_client::datadogV2::model::IncidentTypeCreateRequest;
use datadog_api_client::datadogV2::model::IncidentTypeType;

#[tokio::main]
async fn main() {
    let body =
        IncidentTypeCreateRequest::new(
            IncidentTypeCreateData::new(
                IncidentTypeAttributes::new("Security Incident".to_string())
                    .description(
                        "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.".to_string(),
                    )
                    .is_default(false),
                IncidentTypeType::INCIDENT_TYPES,
            ),
        );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncidentType", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.create_incident_type(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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Create an incident type returns "CREATED" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentType"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiCreateIncidentTypeRequest = {
  body: {
    data: {
      attributes: {
        description:
          "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.",
        isDefault: false,
        name: "Security Incident",
      },
      type: "incident_types",
    },
  },
};

apiInstance
  .createIncidentType(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://docs.datadoghq.com/api/latest/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Get a list of incident types{% #get-a-list-of-incident-types %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                    |
| ----------------- | --------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/config/types |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/config/types |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/config/types      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/config/types      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/config/types     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/config/types |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/config/types |

### Overview

Get all incident types. This endpoint requires any of the following permissions:
`incident_settings_read``incident_read`


OAuth apps require the `incident_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Query Strings

| Name            | Type    | Description                                     |
| --------------- | ------- | ----------------------------------------------- |
| include_deleted | boolean | Include deleted incident types in the response. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with a list of incident types.

| Parent field                  | Field                         | Type      | Description                                                                                                                                 |
| ----------------------------- | ----------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]        | [object]  | An array of incident type objects.                                                                                                          |
| data                          | attributes                    | object    | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                     | date-time | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string    | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string    | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| 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`                                                                                           |
| 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`                                                                                           |
| 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`                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "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 %}

{% /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="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

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/types" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Get a list of incident types returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

configuration = Configuration()
configuration.unstable_operations["list_incident_types"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.list_incident_types()

    print(response)
```

#### Instructions

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

```ruby
# Get a list of incident types returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.list_incident_types".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.list_incident_types()
```

#### Instructions

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

```go
// Get a list of incident types 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListIncidentTypes", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.ListIncidentTypes(ctx, *datadogV2.NewListIncidentTypesOptionalParameters())

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

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

#### Instructions

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

```java
// Get a list of incident types 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.IncidentTypeListResponse;

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

    try {
      IncidentTypeListResponse result = apiInstance.listIncidentTypes();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#listIncidentTypes");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get a list of incident types returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::ListIncidentTypesOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidentTypes", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .list_incident_types(ListIncidentTypesOptionalParams::default())
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get a list of incident types returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listIncidentTypes"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

apiInstance
  .listIncidentTypes()
  .then((data: v2.IncidentTypeListResponse) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Get incident type details{% #get-incident-type-details %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                       |
| ----------------- | ---------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/config/types/{incident_type_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/config/types/{incident_type_id}      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |

### Overview

Get incident type details. This endpoint requires the `incident_read` permission.

OAuth apps require the `incident_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

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

### Response

{% tab title="200" %}
OK
{% tab title="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                    | createdAt                     | date-time | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string    | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string    | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| 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`                                                                                           |
| 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`                                                                                           |
| 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`                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "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 %}

{% /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

##### 
                  \# Path parametersexport incident_type_id="CHANGE_ME"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/types/${incident_type_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Get incident type details returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

configuration = Configuration()
configuration.unstable_operations["get_incident_type"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.get_incident_type(
        incident_type_id="incident_type_id",
    )

    print(response)
```

#### Instructions

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

```ruby
# Get incident type details returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.get_incident_type".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.get_incident_type("incident_type_id")
```

#### Instructions

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

```go
// Get incident type details 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetIncidentType", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.GetIncidentType(ctx, "incident_type_id")

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

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

#### Instructions

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

```java
// Get incident type details 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.IncidentTypeResponse;

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

    try {
      IncidentTypeResponse result = apiInstance.getIncidentType("incident_type_id");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#getIncidentType");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get incident type details returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetIncidentType", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.get_incident_type("incident_type_id".to_string()).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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get incident type details returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getIncidentType"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiGetIncidentTypeRequest = {
  incidentTypeId: "incident_type_id",
};

apiInstance
  .getIncidentType(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://docs.datadoghq.com/api/latest/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Update an incident type{% #update-an-incident-type %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                         |
| ----------------- | ------------------------------------------------------------------------------------ |
| 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} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/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}      |
| 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} |

### Overview

Update an incident type. This endpoint requires the `incident_settings_write` permission.

OAuth apps require the `incident_settings_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

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

### Request

#### Body Data (required)

Incident type payload.

{% tab title="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   | createdAt                    | date-time | Timestamp when the incident type was created.                                                          |
| attributes   | createdBy                    | string    | A unique identifier that represents the user that created the incident type.                           |
| 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   | lastModifiedBy               | string    | A unique identifier that represents the user that last modified the incident type.                     |
| attributes   | modifiedAt                   | date-time | Timestamp when the incident type was last modified.                                                    |
| attributes   | name                         | string    | The name of the incident type.                                                                         |
| attributes   | prefix                       | string    | The string that will be prepended to the incident title across the Datadog app.                        |
| data         | id [*required*]         | string    | The incident type's ID.                                                                                |
| data         | type [*required*]       | enum      | Incident type resource type. Allowed enum values: `incident_types`                                     |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "attributes": {
      "name": "Security Incident-updated"
    },
    "type": "incident_types"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="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                    | createdAt                     | date-time | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string    | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string    | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| 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`                                                                                           |
| 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`                                                                                           |
| 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`                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "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 %}

{% /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

##### 
                          \# Path parametersexport incident_type_id="CHANGE_ME"\# Curl commandcurl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/types/${incident_type_id}" \
-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": {
    "id": "00000000-0000-0000-0000-000000000000",
    "attributes": {
      "name": "Security Incident-updated"
    },
    "type": "incident_types"
  }
}
EOF
                        
##### 

```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())
	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://docs.datadoghq.com/api/latest/?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```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.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://docs.datadoghq.com/api/latest/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```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.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://docs.datadoghq.com/api/latest/?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Update an incident type returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  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://docs.datadoghq.com/api/latest/?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```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.UpdateIncidentType", 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://docs.datadoghq.com/api/latest/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Update an incident type returns "OK" response
 */

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

const configuration = client.createConfiguration();
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://docs.datadoghq.com/api/latest/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Delete an incident type{% #delete-an-incident-type %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                          |
| ----------------- | ------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/incidents/config/types/{incident_type_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/incidents/config/types/{incident_type_id}      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/incidents/config/types/{incident_type_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/incidents/config/types/{incident_type_id} |

### Overview

Delete an incident type. This endpoint requires the `incident_settings_write` permission.

OAuth apps require the `incident_settings_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

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

### Response

{% tab title="204" %}
OK
{% /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

##### 
                  \# Path parametersexport incident_type_id="CHANGE_ME"\# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/types/${incident_type_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Delete 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

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

configuration = Configuration()
configuration.unstable_operations["delete_incident_type"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    api_instance.delete_incident_type(
        incident_type_id=INCIDENT_TYPE_DATA_ID,
    )
```

#### Instructions

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

```ruby
# Delete an incident type returns "OK" response

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

# there is a valid "incident_type" in the system
INCIDENT_TYPE_DATA_ID = ENV["INCIDENT_TYPE_DATA_ID"]
api_instance.delete_incident_type(INCIDENT_TYPE_DATA_ID)
```

#### Instructions

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

```go
// Delete an incident type returns "OK" response

package main

import (
	"context"
	"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")

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteIncidentType", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	r, err := api.DeleteIncidentType(ctx, IncidentTypeDataID)

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

#### Instructions

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

```java
// Delete 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;

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

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

    try {
      apiInstance.deleteIncidentType(INCIDENT_TYPE_DATA_ID);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#deleteIncidentType");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Delete an incident type returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[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 mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncidentType", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .delete_incident_type(incident_type_data_id.clone())
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Delete an incident type returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteIncidentType"] = 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.IncidentsApiDeleteIncidentTypeRequest = {
  incidentTypeId: INCIDENT_TYPE_DATA_ID,
};

apiInstance
  .deleteIncidentType(params)
  .then((data: any) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## List incident notification templates{% #list-incident-notification-templates %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                     |
| ----------------- | -------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/config/notification-templates |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/config/notification-templates |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/config/notification-templates      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/config/notification-templates      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/config/notification-templates     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/config/notification-templates |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/config/notification-templates |

### Overview

Lists all notification templates. Optionally filter by incident type. This endpoint requires the `incident_notification_settings_read` permission.

### Arguments

#### Query Strings

| Name                  | Type   | Description                                                                                                                     |
| --------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------- |
| filter[incident-type] | string | Optional incident type ID filter.                                                                                               |
| include               | string | Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with notification templates.

| Parent field                  | Field                         | Type            | Description                                                                                                                                 |
| ----------------------------- | ----------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]        | [object]        | The `NotificationTemplateArray` `data`.                                                                                                     |
| data                          | attributes                    | object          | The notification template's attributes.                                                                                                     |
| attributes                    | category [*required*]    | string          | The category of the notification template.                                                                                                  |
| attributes                    | content [*required*]     | string          | The content body of the notification template.                                                                                              |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification template was created.                                                                                       |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification template was last modified.                                                                                 |
| attributes                    | name [*required*]        | string          | The name of the notification template.                                                                                                      |
| attributes                    | subject [*required*]     | string          | The subject line of the notification template.                                                                                              |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| data                          | relationships                 | object          | The notification template'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| data                          | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |
|                               | included                      | [ <oneOf>] | Related objects that are included in the response.                                                                                          |
| included                      | Option 1                      | object          | User object returned by the API.                                                                                                            |
| Option 1                      | attributes                    | object          | Attributes of user object returned by the API.                                                                                              |
| attributes                    | created_at                    | date-time       | Creation time of the user.                                                                                                                  |
| attributes                    | disabled                      | boolean         | Whether the user is disabled.                                                                                                               |
| attributes                    | email                         | string          | Email of the user.                                                                                                                          |
| attributes                    | handle                        | string          | Handle of the user.                                                                                                                         |
| attributes                    | icon                          | string          | URL of the user's icon.                                                                                                                     |
| attributes                    | last_login_time               | date-time       | The last time the user logged in.                                                                                                           |
| attributes                    | mfa_enabled                   | boolean         | If user has MFA enabled.                                                                                                                    |
| attributes                    | modified_at                   | date-time       | Time that the user was last modified.                                                                                                       |
| attributes                    | name                          | string          | Name of the user.                                                                                                                           |
| attributes                    | service_account               | boolean         | Whether the user is a service account.                                                                                                      |
| attributes                    | status                        | string          | Status of the user.                                                                                                                         |
| attributes                    | title                         | string          | Title of the user.                                                                                                                          |
| attributes                    | verified                      | boolean         | Whether the user is verified.                                                                                                               |
| Option 1                      | id                            | string          | ID of the user.                                                                                                                             |
| Option 1                      | relationships                 | object          | Relationships of the user object returned by the API.                                                                                       |
| relationships                 | org                           | object          | Relationship to an organization.                                                                                                            |
| org                           | data [*required*]        | object          | Relationship to organization object.                                                                                                        |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_orgs                    | object          | Relationship to organizations.                                                                                                              |
| other_orgs                    | data [*required*]        | [object]        | Relationships to organization objects.                                                                                                      |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_users                   | object          | Relationship to users.                                                                                                                      |
| other_users                   | data [*required*]        | [object]        | Relationships to user objects.                                                                                                              |
| data                          | id [*required*]          | string          | A unique identifier that represents the user.                                                                                               |
| data                          | type [*required*]        | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| relationships                 | roles                         | object          | Relationship to roles.                                                                                                                      |
| roles                         | data                          | [object]        | An array containing type and the unique identifier of a role.                                                                               |
| data                          | id                            | string          | The unique identifier of the role.                                                                                                          |
| data                          | type                          | enum            | Roles type. Allowed enum values: `roles`                                                                                                    |
| Option 1                      | type                          | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| included                      | Option 2                      | object          | Incident type response data.                                                                                                                |
| Option 2                      | attributes                    | object          | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                     | date-time       | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string          | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string          | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time       | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| Option 2                      | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| Option 2                      | 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`                                                                                           |
| 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`                                                                                           |
| 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.                                                                                                         |
| Option 2                      | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
|                               | meta                          | object          | Response metadata.                                                                                                                          |
| meta                          | page                          | object          | Pagination metadata.                                                                                                                        |
| page                          | total_count                   | int64           | Total number of notification templates.                                                                                                     |
| page                          | total_filtered_count          | int64           | Total number of notification templates matching the filter.                                                                                 |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "category": "alert",
        "content": "An incident has been declared.\n\nTitle: {{incident.title}}\nSeverity: {{incident.severity}}\nAffected Services: {{incident.services}}\nStatus: {{incident.state}}\n\nPlease join the incident channel for updates.",
        "created": "2025-01-15T10:30:00Z",
        "modified": "2025-01-15T14:45:00Z",
        "name": "Incident Alert Template",
        "subject": "{{incident.severity}} Incident: {{incident.title}}"
      },
      "id": "00000000-0000-0000-0000-000000000001",
      "relationships": {
        "created_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "incident_type": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "incident_types"
          }
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        }
      },
      "type": "notification_templates"
    }
  ],
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ],
  "meta": {
    "page": {
      "total_count": 42,
      "total_filtered_count": 15
    }
  }
}
```

{% /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

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/notification-templates" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
List incident notification templates returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

configuration = Configuration()
configuration.unstable_operations["list_incident_notification_templates"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.list_incident_notification_templates()

    print(response)
```

#### Instructions

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

```ruby
# List incident notification templates returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.list_incident_notification_templates".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.list_incident_notification_templates()
```

#### Instructions

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

```go
// List incident notification templates 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListIncidentNotificationTemplates", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.ListIncidentNotificationTemplates(ctx, *datadogV2.NewListIncidentNotificationTemplatesOptionalParameters())

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

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

#### Instructions

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

```java
// List incident notification templates 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.IncidentNotificationTemplateArray;

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

    try {
      IncidentNotificationTemplateArray result = apiInstance.listIncidentNotificationTemplates();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#listIncidentNotificationTemplates");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// List incident notification templates returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::ListIncidentNotificationTemplatesOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidentNotificationTemplates", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .list_incident_notification_templates(
            ListIncidentNotificationTemplatesOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * List incident notification templates returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listIncidentNotificationTemplates"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

apiInstance
  .listIncidentNotificationTemplates()
  .then((data: v2.IncidentNotificationTemplateArray) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Create incident notification template{% #create-incident-notification-template %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                      |
| ----------------- | --------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/incidents/config/notification-templates |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/incidents/config/notification-templates |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/incidents/config/notification-templates      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/incidents/config/notification-templates      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/incidents/config/notification-templates     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/incidents/config/notification-templates |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/incidents/config/notification-templates |

### Overview

Creates a new notification template. This endpoint requires the `incident_notification_settings_write` permission.

OAuth apps require the `incident_notification_settings_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field  | Field                        | Type   | Description                                                                         |
| ------------- | ---------------------------- | ------ | ----------------------------------------------------------------------------------- |
|               | data [*required*]       | object | Notification template data for a create request.                                    |
| data          | attributes [*required*] | object | The attributes for creating a notification template.                                |
| attributes    | category [*required*]   | string | The category of the notification template.                                          |
| attributes    | content [*required*]    | string | The content body of the notification template.                                      |
| attributes    | name [*required*]       | string | The name of the notification template.                                              |
| attributes    | subject [*required*]    | string | The subject line of the notification template.                                      |
| data          | relationships                | object | The definition of `NotificationTemplateCreateDataRelationships` object.             |
| relationships | incident_type                | object | Relationship to an incident type.                                                   |
| incident_type | data [*required*]       | object | Relationship to incident type object.                                               |
| data          | id [*required*]         | string | The incident type's ID.                                                             |
| data          | type [*required*]       | enum   | Incident type resource type. Allowed enum values: `incident_types`                  |
| data          | type [*required*]       | enum   | Notification templates resource type. Allowed enum values: `notification_templates` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "category": "alert",
      "content": "An incident has been declared.\n\nTitle: Sample Incident Title\nSeverity: SEV-2\nAffected Services: web-service, database-service\nStatus: active\n\nPlease join the incident channel for updates.",
      "name": "Example-Incident",
      "subject": "SEV-2 Incident: Sample Incident Title"
    },
    "relationships": {
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      }
    },
    "type": "notification_templates"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response with a notification template.

| Parent field                  | Field                         | Type            | Description                                                                                                                                 |
| ----------------------------- | ----------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]        | object          | Notification template data from a response.                                                                                                 |
| data                          | attributes                    | object          | The notification template's attributes.                                                                                                     |
| attributes                    | category [*required*]    | string          | The category of the notification template.                                                                                                  |
| attributes                    | content [*required*]     | string          | The content body of the notification template.                                                                                              |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification template was created.                                                                                       |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification template was last modified.                                                                                 |
| attributes                    | name [*required*]        | string          | The name of the notification template.                                                                                                      |
| attributes                    | subject [*required*]     | string          | The subject line of the notification template.                                                                                              |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| data                          | relationships                 | object          | The notification template'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| data                          | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |
|                               | included                      | [ <oneOf>] | Related objects that are included in the response.                                                                                          |
| included                      | Option 1                      | object          | User object returned by the API.                                                                                                            |
| Option 1                      | attributes                    | object          | Attributes of user object returned by the API.                                                                                              |
| attributes                    | created_at                    | date-time       | Creation time of the user.                                                                                                                  |
| attributes                    | disabled                      | boolean         | Whether the user is disabled.                                                                                                               |
| attributes                    | email                         | string          | Email of the user.                                                                                                                          |
| attributes                    | handle                        | string          | Handle of the user.                                                                                                                         |
| attributes                    | icon                          | string          | URL of the user's icon.                                                                                                                     |
| attributes                    | last_login_time               | date-time       | The last time the user logged in.                                                                                                           |
| attributes                    | mfa_enabled                   | boolean         | If user has MFA enabled.                                                                                                                    |
| attributes                    | modified_at                   | date-time       | Time that the user was last modified.                                                                                                       |
| attributes                    | name                          | string          | Name of the user.                                                                                                                           |
| attributes                    | service_account               | boolean         | Whether the user is a service account.                                                                                                      |
| attributes                    | status                        | string          | Status of the user.                                                                                                                         |
| attributes                    | title                         | string          | Title of the user.                                                                                                                          |
| attributes                    | verified                      | boolean         | Whether the user is verified.                                                                                                               |
| Option 1                      | id                            | string          | ID of the user.                                                                                                                             |
| Option 1                      | relationships                 | object          | Relationships of the user object returned by the API.                                                                                       |
| relationships                 | org                           | object          | Relationship to an organization.                                                                                                            |
| org                           | data [*required*]        | object          | Relationship to organization object.                                                                                                        |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_orgs                    | object          | Relationship to organizations.                                                                                                              |
| other_orgs                    | data [*required*]        | [object]        | Relationships to organization objects.                                                                                                      |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_users                   | object          | Relationship to users.                                                                                                                      |
| other_users                   | data [*required*]        | [object]        | Relationships to user objects.                                                                                                              |
| data                          | id [*required*]          | string          | A unique identifier that represents the user.                                                                                               |
| data                          | type [*required*]        | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| relationships                 | roles                         | object          | Relationship to roles.                                                                                                                      |
| roles                         | data                          | [object]        | An array containing type and the unique identifier of a role.                                                                               |
| data                          | id                            | string          | The unique identifier of the role.                                                                                                          |
| data                          | type                          | enum            | Roles type. Allowed enum values: `roles`                                                                                                    |
| Option 1                      | type                          | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| included                      | Option 2                      | object          | Incident type response data.                                                                                                                |
| Option 2                      | attributes                    | object          | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                     | date-time       | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string          | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string          | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time       | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| Option 2                      | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| Option 2                      | 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`                                                                                           |
| 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`                                                                                           |
| 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.                                                                                                         |
| Option 2                      | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "category": "alert",
      "content": "An incident has been declared.\n\nTitle: {{incident.title}}\nSeverity: {{incident.severity}}\nAffected Services: {{incident.services}}\nStatus: {{incident.state}}\n\nPlease join the incident channel for updates.",
      "created": "2025-01-15T10:30:00Z",
      "modified": "2025-01-15T14:45:00Z",
      "name": "Incident Alert Template",
      "subject": "{{incident.severity}} Incident: {{incident.title}}"
    },
    "id": "00000000-0000-0000-0000-000000000001",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "notification_templates"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                          \# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/notification-templates" \
-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": {
      "category": "alert",
      "content": "An incident has been declared.\n\nTitle: Sample Incident Title\nSeverity: SEV-2\nAffected Services: web-service, database-service\nStatus: active\n\nPlease join the incident channel for updates.",
      "name": "Example-Incident",
      "subject": "SEV-2 Incident: Sample Incident Title"
    },
    "relationships": {
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      }
    },
    "type": "notification_templates"
  }
}
EOF
                        
##### 

```go
// Create incident notification template returns "Created" 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.CreateIncidentNotificationTemplateRequest{
		Data: datadogV2.IncidentNotificationTemplateCreateData{
			Attributes: datadogV2.IncidentNotificationTemplateCreateAttributes{
				Category: "alert",
				Content: `An incident has been declared.

Title: Sample Incident Title
Severity: SEV-2
Affected Services: web-service, database-service
Status: active

Please join the incident channel for updates.`,
				Name:    "Example-Incident",
				Subject: "SEV-2 Incident: Sample Incident Title",
			},
			Relationships: &datadogV2.IncidentNotificationTemplateCreateDataRelationships{
				IncidentType: &datadogV2.RelationshipToIncidentType{
					Data: datadogV2.RelationshipToIncidentTypeData{
						Id:   IncidentTypeDataID,
						Type: datadogV2.INCIDENTTYPETYPE_INCIDENT_TYPES,
					},
				},
			},
			Type: datadogV2.INCIDENTNOTIFICATIONTEMPLATETYPE_NOTIFICATION_TEMPLATES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateIncidentNotificationTemplate", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.CreateIncidentNotificationTemplate(ctx, body)

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

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

#### Instructions

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

```java
// Create incident notification template returns "Created" 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.CreateIncidentNotificationTemplateRequest;
import com.datadog.api.client.v2.model.IncidentNotificationTemplate;
import com.datadog.api.client.v2.model.IncidentNotificationTemplateCreateAttributes;
import com.datadog.api.client.v2.model.IncidentNotificationTemplateCreateData;
import com.datadog.api.client.v2.model.IncidentNotificationTemplateCreateDataRelationships;
import com.datadog.api.client.v2.model.IncidentNotificationTemplateType;
import com.datadog.api.client.v2.model.IncidentTypeType;
import com.datadog.api.client.v2.model.RelationshipToIncidentType;
import com.datadog.api.client.v2.model.RelationshipToIncidentTypeData;

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

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

    CreateIncidentNotificationTemplateRequest body =
        new CreateIncidentNotificationTemplateRequest()
            .data(
                new IncidentNotificationTemplateCreateData()
                    .attributes(
                        new IncidentNotificationTemplateCreateAttributes()
                            .category("alert")
                            .content(
                                """
An incident has been declared.

Title: Sample Incident Title
Severity: SEV-2
Affected Services: web-service, database-service
Status: active

Please join the incident channel for updates.
""")
                            .name("Example-Incident")
                            .subject("SEV-2 Incident: Sample Incident Title"))
                    .relationships(
                        new IncidentNotificationTemplateCreateDataRelationships()
                            .incidentType(
                                new RelationshipToIncidentType()
                                    .data(
                                        new RelationshipToIncidentTypeData()
                                            .id(INCIDENT_TYPE_DATA_ID)
                                            .type(IncidentTypeType.INCIDENT_TYPES))))
                    .type(IncidentNotificationTemplateType.NOTIFICATION_TEMPLATES));

    try {
      IncidentNotificationTemplate result = apiInstance.createIncidentNotificationTemplate(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#createIncidentNotificationTemplate");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Create incident notification template returns "Created" 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.create_incident_notification_template_request import (
    CreateIncidentNotificationTemplateRequest,
)
from datadog_api_client.v2.model.incident_notification_template_create_attributes import (
    IncidentNotificationTemplateCreateAttributes,
)
from datadog_api_client.v2.model.incident_notification_template_create_data import (
    IncidentNotificationTemplateCreateData,
)
from datadog_api_client.v2.model.incident_notification_template_create_data_relationships import (
    IncidentNotificationTemplateCreateDataRelationships,
)
from datadog_api_client.v2.model.incident_notification_template_type import IncidentNotificationTemplateType
from datadog_api_client.v2.model.incident_type_type import IncidentTypeType
from datadog_api_client.v2.model.relationship_to_incident_type import RelationshipToIncidentType
from datadog_api_client.v2.model.relationship_to_incident_type_data import RelationshipToIncidentTypeData

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

body = CreateIncidentNotificationTemplateRequest(
    data=IncidentNotificationTemplateCreateData(
        attributes=IncidentNotificationTemplateCreateAttributes(
            category="alert",
            content="An incident has been declared.\n\nTitle: Sample Incident Title\nSeverity: SEV-2\nAffected Services: web-service, database-service\nStatus: active\n\nPlease join the incident channel for updates.",
            name="Example-Incident",
            subject="SEV-2 Incident: Sample Incident Title",
        ),
        relationships=IncidentNotificationTemplateCreateDataRelationships(
            incident_type=RelationshipToIncidentType(
                data=RelationshipToIncidentTypeData(
                    id=INCIDENT_TYPE_DATA_ID,
                    type=IncidentTypeType.INCIDENT_TYPES,
                ),
            ),
        ),
        type=IncidentNotificationTemplateType.NOTIFICATION_TEMPLATES,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_incident_notification_template"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.create_incident_notification_template(body=body)

    print(response)
```

#### Instructions

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

```ruby
# Create incident notification template returns "Created" response

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

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

body = DatadogAPIClient::V2::CreateIncidentNotificationTemplateRequest.new({
  data: DatadogAPIClient::V2::IncidentNotificationTemplateCreateData.new({
    attributes: DatadogAPIClient::V2::IncidentNotificationTemplateCreateAttributes.new({
      category: "alert",
      content: 'An incident has been declared.\n\nTitle: Sample Incident Title\nSeverity: SEV-2\nAffected Services: web-service, database-service\nStatus: active\n\nPlease join the incident channel for updates.',
      name: "Example-Incident",
      subject: "SEV-2 Incident: Sample Incident Title",
    }),
    relationships: DatadogAPIClient::V2::IncidentNotificationTemplateCreateDataRelationships.new({
      incident_type: DatadogAPIClient::V2::RelationshipToIncidentType.new({
        data: DatadogAPIClient::V2::RelationshipToIncidentTypeData.new({
          id: INCIDENT_TYPE_DATA_ID,
          type: DatadogAPIClient::V2::IncidentTypeType::INCIDENT_TYPES,
        }),
      }),
    }),
    type: DatadogAPIClient::V2::IncidentNotificationTemplateType::NOTIFICATION_TEMPLATES,
  }),
})
p api_instance.create_incident_notification_template(body)
```

#### Instructions

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

```rust
// Create incident notification template returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::CreateIncidentNotificationTemplateRequest;
use datadog_api_client::datadogV2::model::IncidentNotificationTemplateCreateAttributes;
use datadog_api_client::datadogV2::model::IncidentNotificationTemplateCreateData;
use datadog_api_client::datadogV2::model::IncidentNotificationTemplateCreateDataRelationships;
use datadog_api_client::datadogV2::model::IncidentNotificationTemplateType;
use datadog_api_client::datadogV2::model::IncidentTypeType;
use datadog_api_client::datadogV2::model::RelationshipToIncidentType;
use datadog_api_client::datadogV2::model::RelationshipToIncidentTypeData;

#[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 = CreateIncidentNotificationTemplateRequest::new(
        IncidentNotificationTemplateCreateData::new(
            IncidentNotificationTemplateCreateAttributes::new(
                "alert".to_string(),
                r#"An incident has been declared.

Title: Sample Incident Title
Severity: SEV-2
Affected Services: web-service, database-service
Status: active

Please join the incident channel for updates."#
                    .to_string(),
                "Example-Incident".to_string(),
                "SEV-2 Incident: Sample Incident Title".to_string(),
            ),
            IncidentNotificationTemplateType::NOTIFICATION_TEMPLATES,
        )
        .relationships(
            IncidentNotificationTemplateCreateDataRelationships::new().incident_type(
                RelationshipToIncidentType::new(RelationshipToIncidentTypeData::new(
                    incident_type_data_id.clone(),
                    IncidentTypeType::INCIDENT_TYPES,
                )),
            ),
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncidentNotificationTemplate", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.create_incident_notification_template(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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Create incident notification template returns "Created" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentNotificationTemplate"] =
  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.IncidentsApiCreateIncidentNotificationTemplateRequest = {
  body: {
    data: {
      attributes: {
        category: "alert",
        content:
          "An incident has been declared.\n\nTitle: Sample Incident Title\nSeverity: SEV-2\nAffected Services: web-service, database-service\nStatus: active\n\nPlease join the incident channel for updates.",
        name: "Example-Incident",
        subject: "SEV-2 Incident: Sample Incident Title",
      },
      relationships: {
        incidentType: {
          data: {
            id: INCIDENT_TYPE_DATA_ID,
            type: "incident_types",
          },
        },
      },
      type: "notification_templates",
    },
  },
};

apiInstance
  .createIncidentNotificationTemplate(params)
  .then((data: v2.IncidentNotificationTemplate) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Get incident notification template{% #get-incident-notification-template %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                          |
| ----------------- | ------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/config/notification-templates/{id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/config/notification-templates/{id}      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/config/notification-templates/{id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |

### Overview

Retrieves a specific notification template by its ID. This endpoint requires any of the following permissions:
`incident_settings_read``incident_write``incident_read`


OAuth apps require the `incident_read, incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                 | Type   | Description                          |
| -------------------- | ------ | ------------------------------------ |
| id [*required*] | string | The ID of the notification template. |

#### Query Strings

| Name    | Type   | Description                                                                                                                     |
| ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------- |
| include | string | Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with a notification template.

| Parent field                  | Field                         | Type            | Description                                                                                                                                 |
| ----------------------------- | ----------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]        | object          | Notification template data from a response.                                                                                                 |
| data                          | attributes                    | object          | The notification template's attributes.                                                                                                     |
| attributes                    | category [*required*]    | string          | The category of the notification template.                                                                                                  |
| attributes                    | content [*required*]     | string          | The content body of the notification template.                                                                                              |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification template was created.                                                                                       |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification template was last modified.                                                                                 |
| attributes                    | name [*required*]        | string          | The name of the notification template.                                                                                                      |
| attributes                    | subject [*required*]     | string          | The subject line of the notification template.                                                                                              |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| data                          | relationships                 | object          | The notification template'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| data                          | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |
|                               | included                      | [ <oneOf>] | Related objects that are included in the response.                                                                                          |
| included                      | Option 1                      | object          | User object returned by the API.                                                                                                            |
| Option 1                      | attributes                    | object          | Attributes of user object returned by the API.                                                                                              |
| attributes                    | created_at                    | date-time       | Creation time of the user.                                                                                                                  |
| attributes                    | disabled                      | boolean         | Whether the user is disabled.                                                                                                               |
| attributes                    | email                         | string          | Email of the user.                                                                                                                          |
| attributes                    | handle                        | string          | Handle of the user.                                                                                                                         |
| attributes                    | icon                          | string          | URL of the user's icon.                                                                                                                     |
| attributes                    | last_login_time               | date-time       | The last time the user logged in.                                                                                                           |
| attributes                    | mfa_enabled                   | boolean         | If user has MFA enabled.                                                                                                                    |
| attributes                    | modified_at                   | date-time       | Time that the user was last modified.                                                                                                       |
| attributes                    | name                          | string          | Name of the user.                                                                                                                           |
| attributes                    | service_account               | boolean         | Whether the user is a service account.                                                                                                      |
| attributes                    | status                        | string          | Status of the user.                                                                                                                         |
| attributes                    | title                         | string          | Title of the user.                                                                                                                          |
| attributes                    | verified                      | boolean         | Whether the user is verified.                                                                                                               |
| Option 1                      | id                            | string          | ID of the user.                                                                                                                             |
| Option 1                      | relationships                 | object          | Relationships of the user object returned by the API.                                                                                       |
| relationships                 | org                           | object          | Relationship to an organization.                                                                                                            |
| org                           | data [*required*]        | object          | Relationship to organization object.                                                                                                        |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_orgs                    | object          | Relationship to organizations.                                                                                                              |
| other_orgs                    | data [*required*]        | [object]        | Relationships to organization objects.                                                                                                      |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_users                   | object          | Relationship to users.                                                                                                                      |
| other_users                   | data [*required*]        | [object]        | Relationships to user objects.                                                                                                              |
| data                          | id [*required*]          | string          | A unique identifier that represents the user.                                                                                               |
| data                          | type [*required*]        | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| relationships                 | roles                         | object          | Relationship to roles.                                                                                                                      |
| roles                         | data                          | [object]        | An array containing type and the unique identifier of a role.                                                                               |
| data                          | id                            | string          | The unique identifier of the role.                                                                                                          |
| data                          | type                          | enum            | Roles type. Allowed enum values: `roles`                                                                                                    |
| Option 1                      | type                          | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| included                      | Option 2                      | object          | Incident type response data.                                                                                                                |
| Option 2                      | attributes                    | object          | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                     | date-time       | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string          | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string          | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time       | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| Option 2                      | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| Option 2                      | 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`                                                                                           |
| 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`                                                                                           |
| 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.                                                                                                         |
| Option 2                      | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "category": "alert",
      "content": "An incident has been declared.\n\nTitle: {{incident.title}}\nSeverity: {{incident.severity}}\nAffected Services: {{incident.services}}\nStatus: {{incident.state}}\n\nPlease join the incident channel for updates.",
      "created": "2025-01-15T10:30:00Z",
      "modified": "2025-01-15T14:45:00Z",
      "name": "Incident Alert Template",
      "subject": "{{incident.severity}} Incident: {{incident.title}}"
    },
    "id": "00000000-0000-0000-0000-000000000001",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "notification_templates"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                  \# Path parametersexport id="00000000-0000-0000-0000-000000000001"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/notification-templates/${id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Get incident notification template returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

# there is a valid "notification_template" in the system
NOTIFICATION_TEMPLATE_DATA_ID = environ["NOTIFICATION_TEMPLATE_DATA_ID"]

configuration = Configuration()
configuration.unstable_operations["get_incident_notification_template"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.get_incident_notification_template(
        id=NOTIFICATION_TEMPLATE_DATA_ID,
    )

    print(response)
```

#### Instructions

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

```ruby
# Get incident notification template returns "OK" response

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

# there is a valid "notification_template" in the system
NOTIFICATION_TEMPLATE_DATA_ID = ENV["NOTIFICATION_TEMPLATE_DATA_ID"]
p api_instance.get_incident_notification_template(NOTIFICATION_TEMPLATE_DATA_ID)
```

#### Instructions

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

```go
// Get incident notification template 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"
	"github.com/google/uuid"
)

func main() {
	// there is a valid "notification_template" in the system
	NotificationTemplateDataID := uuid.MustParse(os.Getenv("NOTIFICATION_TEMPLATE_DATA_ID"))

	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetIncidentNotificationTemplate", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.GetIncidentNotificationTemplate(ctx, NotificationTemplateDataID, *datadogV2.NewGetIncidentNotificationTemplateOptionalParameters())

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

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

#### Instructions

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

```java
// Get incident notification template 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.IncidentNotificationTemplate;
import java.util.UUID;

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

    // there is a valid "notification_template" in the system
    UUID NOTIFICATION_TEMPLATE_DATA_ID = null;
    try {
      NOTIFICATION_TEMPLATE_DATA_ID =
          UUID.fromString(System.getenv("NOTIFICATION_TEMPLATE_DATA_ID"));
    } catch (IllegalArgumentException e) {
      System.err.println("Error parsing UUID: " + e.getMessage());
    }

    try {
      IncidentNotificationTemplate result =
          apiInstance.getIncidentNotificationTemplate(NOTIFICATION_TEMPLATE_DATA_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#getIncidentNotificationTemplate");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get incident notification template returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::GetIncidentNotificationTemplateOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;

#[tokio::main]
async fn main() {
    // there is a valid "notification_template" in the system
    let notification_template_data_id =
        uuid::Uuid::parse_str(&std::env::var("NOTIFICATION_TEMPLATE_DATA_ID").unwrap())
            .expect("Invalid UUID");
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetIncidentNotificationTemplate", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .get_incident_notification_template(
            notification_template_data_id.clone(),
            GetIncidentNotificationTemplateOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get incident notification template returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getIncidentNotificationTemplate"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiGetIncidentNotificationTemplateRequest = {
  id: NOTIFICATION_TEMPLATE_DATA_ID,
};

apiInstance
  .getIncidentNotificationTemplate(params)
  .then((data: v2.IncidentNotificationTemplate) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Update incident notification template{% #update-incident-notification-template %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                            |
| ----------------- | --------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/incidents/config/notification-templates/{id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/incidents/config/notification-templates/{id}      |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/incidents/config/notification-templates/{id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |

### Overview

Updates an existing notification template's attributes. This endpoint requires the `incident_notification_settings_write` permission.

OAuth apps require the `incident_notification_settings_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                 | Type   | Description                          |
| -------------------- | ------ | ------------------------------------ |
| id [*required*] | string | The ID of the notification template. |

#### Query Strings

| Name    | Type   | Description                                                                                                                     |
| ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------- |
| include | string | Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                  | Type   | Description                                                                         |
| ------------ | ---------------------- | ------ | ----------------------------------------------------------------------------------- |
|              | data [*required*] | object | Notification template data for an update request.                                   |
| data         | attributes             | object | The attributes to update on a notification template.                                |
| attributes   | category               | string | The category of the notification template.                                          |
| attributes   | content                | string | The content body of the notification template.                                      |
| attributes   | name                   | string | The name of the notification template.                                              |
| attributes   | subject                | string | The subject line of the notification template.                                      |
| data         | id [*required*]   | uuid   | The unique identifier of the notification template.                                 |
| data         | type [*required*] | enum   | Notification templates resource type. Allowed enum values: `notification_templates` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "category": "update",
      "content": "Incident Status Update:\n\nTitle: Sample Incident Title\nNew Status: resolved\nSeverity: SEV-2\nServices: web-service, database-service\nCommander: John Doe\n\nFor more details, visit the incident page.",
      "name": "Example-Incident",
      "subject": "Incident Update: Sample Incident Title - resolved"
    },
    "id": "00000000-0000-0000-0000-000000000001",
    "type": "notification_templates"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with a notification template.

| Parent field                  | Field                         | Type            | Description                                                                                                                                 |
| ----------------------------- | ----------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]        | object          | Notification template data from a response.                                                                                                 |
| data                          | attributes                    | object          | The notification template's attributes.                                                                                                     |
| attributes                    | category [*required*]    | string          | The category of the notification template.                                                                                                  |
| attributes                    | content [*required*]     | string          | The content body of the notification template.                                                                                              |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification template was created.                                                                                       |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification template was last modified.                                                                                 |
| attributes                    | name [*required*]        | string          | The name of the notification template.                                                                                                      |
| attributes                    | subject [*required*]     | string          | The subject line of the notification template.                                                                                              |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| data                          | relationships                 | object          | The notification template'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| data                          | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |
|                               | included                      | [ <oneOf>] | Related objects that are included in the response.                                                                                          |
| included                      | Option 1                      | object          | User object returned by the API.                                                                                                            |
| Option 1                      | attributes                    | object          | Attributes of user object returned by the API.                                                                                              |
| attributes                    | created_at                    | date-time       | Creation time of the user.                                                                                                                  |
| attributes                    | disabled                      | boolean         | Whether the user is disabled.                                                                                                               |
| attributes                    | email                         | string          | Email of the user.                                                                                                                          |
| attributes                    | handle                        | string          | Handle of the user.                                                                                                                         |
| attributes                    | icon                          | string          | URL of the user's icon.                                                                                                                     |
| attributes                    | last_login_time               | date-time       | The last time the user logged in.                                                                                                           |
| attributes                    | mfa_enabled                   | boolean         | If user has MFA enabled.                                                                                                                    |
| attributes                    | modified_at                   | date-time       | Time that the user was last modified.                                                                                                       |
| attributes                    | name                          | string          | Name of the user.                                                                                                                           |
| attributes                    | service_account               | boolean         | Whether the user is a service account.                                                                                                      |
| attributes                    | status                        | string          | Status of the user.                                                                                                                         |
| attributes                    | title                         | string          | Title of the user.                                                                                                                          |
| attributes                    | verified                      | boolean         | Whether the user is verified.                                                                                                               |
| Option 1                      | id                            | string          | ID of the user.                                                                                                                             |
| Option 1                      | relationships                 | object          | Relationships of the user object returned by the API.                                                                                       |
| relationships                 | org                           | object          | Relationship to an organization.                                                                                                            |
| org                           | data [*required*]        | object          | Relationship to organization object.                                                                                                        |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_orgs                    | object          | Relationship to organizations.                                                                                                              |
| other_orgs                    | data [*required*]        | [object]        | Relationships to organization objects.                                                                                                      |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_users                   | object          | Relationship to users.                                                                                                                      |
| other_users                   | data [*required*]        | [object]        | Relationships to user objects.                                                                                                              |
| data                          | id [*required*]          | string          | A unique identifier that represents the user.                                                                                               |
| data                          | type [*required*]        | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| relationships                 | roles                         | object          | Relationship to roles.                                                                                                                      |
| roles                         | data                          | [object]        | An array containing type and the unique identifier of a role.                                                                               |
| data                          | id                            | string          | The unique identifier of the role.                                                                                                          |
| data                          | type                          | enum            | Roles type. Allowed enum values: `roles`                                                                                                    |
| Option 1                      | type                          | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| included                      | Option 2                      | object          | Incident type response data.                                                                                                                |
| Option 2                      | attributes                    | object          | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                     | date-time       | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string          | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string          | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time       | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| Option 2                      | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| Option 2                      | 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`                                                                                           |
| 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`                                                                                           |
| 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.                                                                                                         |
| Option 2                      | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "category": "alert",
      "content": "An incident has been declared.\n\nTitle: {{incident.title}}\nSeverity: {{incident.severity}}\nAffected Services: {{incident.services}}\nStatus: {{incident.state}}\n\nPlease join the incident channel for updates.",
      "created": "2025-01-15T10:30:00Z",
      "modified": "2025-01-15T14:45:00Z",
      "name": "Incident Alert Template",
      "subject": "{{incident.severity}} Incident: {{incident.title}}"
    },
    "id": "00000000-0000-0000-0000-000000000001",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "notification_templates"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                          \# Path parametersexport id="00000000-0000-0000-0000-000000000001"\# Curl commandcurl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/notification-templates/${id}" \
-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": {
      "category": "update",
      "content": "Incident Status Update:\n\nTitle: Sample Incident Title\nNew Status: resolved\nSeverity: SEV-2\nServices: web-service, database-service\nCommander: John Doe\n\nFor more details, visit the incident page.",
      "name": "Example-Incident",
      "subject": "Incident Update: Sample Incident Title - resolved"
    },
    "id": "00000000-0000-0000-0000-000000000001",
    "type": "notification_templates"
  }
}
EOF
                        
##### 

```go
// Update incident notification template 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"
	"github.com/google/uuid"
)

func main() {
	// there is a valid "notification_template" in the system
	NotificationTemplateDataID := uuid.MustParse(os.Getenv("NOTIFICATION_TEMPLATE_DATA_ID"))

	body := datadogV2.PatchIncidentNotificationTemplateRequest{
		Data: datadogV2.IncidentNotificationTemplateUpdateData{
			Attributes: &datadogV2.IncidentNotificationTemplateUpdateAttributes{
				Category: datadog.PtrString("update"),
				Content: datadog.PtrString(`Incident Status Update:

Title: Sample Incident Title
New Status: resolved
Severity: SEV-2
Services: web-service, database-service
Commander: John Doe

For more details, visit the incident page.`),
				Name:    datadog.PtrString("Example-Incident"),
				Subject: datadog.PtrString("Incident Update: Sample Incident Title - resolved"),
			},
			Id:   NotificationTemplateDataID,
			Type: datadogV2.INCIDENTNOTIFICATIONTEMPLATETYPE_NOTIFICATION_TEMPLATES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateIncidentNotificationTemplate", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.UpdateIncidentNotificationTemplate(ctx, NotificationTemplateDataID, body, *datadogV2.NewUpdateIncidentNotificationTemplateOptionalParameters())

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

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

#### Instructions

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

```java
// Update incident notification template 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.IncidentNotificationTemplate;
import com.datadog.api.client.v2.model.IncidentNotificationTemplateType;
import com.datadog.api.client.v2.model.IncidentNotificationTemplateUpdateAttributes;
import com.datadog.api.client.v2.model.IncidentNotificationTemplateUpdateData;
import com.datadog.api.client.v2.model.PatchIncidentNotificationTemplateRequest;
import java.util.UUID;

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

    // there is a valid "notification_template" in the system
    UUID NOTIFICATION_TEMPLATE_DATA_ID = null;
    try {
      NOTIFICATION_TEMPLATE_DATA_ID =
          UUID.fromString(System.getenv("NOTIFICATION_TEMPLATE_DATA_ID"));
    } catch (IllegalArgumentException e) {
      System.err.println("Error parsing UUID: " + e.getMessage());
    }

    PatchIncidentNotificationTemplateRequest body =
        new PatchIncidentNotificationTemplateRequest()
            .data(
                new IncidentNotificationTemplateUpdateData()
                    .attributes(
                        new IncidentNotificationTemplateUpdateAttributes()
                            .category("update")
                            .content(
                                """
Incident Status Update:

Title: Sample Incident Title
New Status: resolved
Severity: SEV-2
Services: web-service, database-service
Commander: John Doe

For more details, visit the incident page.
""")
                            .name("Example-Incident")
                            .subject("Incident Update: Sample Incident Title - resolved"))
                    .id(NOTIFICATION_TEMPLATE_DATA_ID)
                    .type(IncidentNotificationTemplateType.NOTIFICATION_TEMPLATES));

    try {
      IncidentNotificationTemplate result =
          apiInstance.updateIncidentNotificationTemplate(NOTIFICATION_TEMPLATE_DATA_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#updateIncidentNotificationTemplate");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Update incident notification template 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_notification_template_type import IncidentNotificationTemplateType
from datadog_api_client.v2.model.incident_notification_template_update_attributes import (
    IncidentNotificationTemplateUpdateAttributes,
)
from datadog_api_client.v2.model.incident_notification_template_update_data import (
    IncidentNotificationTemplateUpdateData,
)
from datadog_api_client.v2.model.patch_incident_notification_template_request import (
    PatchIncidentNotificationTemplateRequest,
)

# there is a valid "notification_template" in the system
NOTIFICATION_TEMPLATE_DATA_ID = environ["NOTIFICATION_TEMPLATE_DATA_ID"]

body = PatchIncidentNotificationTemplateRequest(
    data=IncidentNotificationTemplateUpdateData(
        attributes=IncidentNotificationTemplateUpdateAttributes(
            category="update",
            content="Incident Status Update:\n\nTitle: Sample Incident Title\nNew Status: resolved\nSeverity: SEV-2\nServices: web-service, database-service\nCommander: John Doe\n\nFor more details, visit the incident page.",
            name="Example-Incident",
            subject="Incident Update: Sample Incident Title - resolved",
        ),
        id=NOTIFICATION_TEMPLATE_DATA_ID,
        type=IncidentNotificationTemplateType.NOTIFICATION_TEMPLATES,
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_incident_notification_template"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.update_incident_notification_template(id=NOTIFICATION_TEMPLATE_DATA_ID, body=body)

    print(response)
```

#### Instructions

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

```ruby
# Update incident notification template returns "OK" response

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

# there is a valid "notification_template" in the system
NOTIFICATION_TEMPLATE_DATA_ID = ENV["NOTIFICATION_TEMPLATE_DATA_ID"]

body = DatadogAPIClient::V2::PatchIncidentNotificationTemplateRequest.new({
  data: DatadogAPIClient::V2::IncidentNotificationTemplateUpdateData.new({
    attributes: DatadogAPIClient::V2::IncidentNotificationTemplateUpdateAttributes.new({
      category: "update",
      content: 'Incident Status Update:\n\nTitle: Sample Incident Title\nNew Status: resolved\nSeverity: SEV-2\nServices: web-service, database-service\nCommander: John Doe\n\nFor more details, visit the incident page.',
      name: "Example-Incident",
      subject: "Incident Update: Sample Incident Title - resolved",
    }),
    id: NOTIFICATION_TEMPLATE_DATA_ID,
    type: DatadogAPIClient::V2::IncidentNotificationTemplateType::NOTIFICATION_TEMPLATES,
  }),
})
p api_instance.update_incident_notification_template(NOTIFICATION_TEMPLATE_DATA_ID, body)
```

#### Instructions

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

```rust
// Update incident notification template returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentNotificationTemplateOptionalParams;
use datadog_api_client::datadogV2::model::IncidentNotificationTemplateType;
use datadog_api_client::datadogV2::model::IncidentNotificationTemplateUpdateAttributes;
use datadog_api_client::datadogV2::model::IncidentNotificationTemplateUpdateData;
use datadog_api_client::datadogV2::model::PatchIncidentNotificationTemplateRequest;

#[tokio::main]
async fn main() {
    // there is a valid "notification_template" in the system
    let notification_template_data_id =
        uuid::Uuid::parse_str(&std::env::var("NOTIFICATION_TEMPLATE_DATA_ID").unwrap())
            .expect("Invalid UUID");
    let body = PatchIncidentNotificationTemplateRequest::new(
        IncidentNotificationTemplateUpdateData::new(
            notification_template_data_id.clone(),
            IncidentNotificationTemplateType::NOTIFICATION_TEMPLATES,
        )
        .attributes(
            IncidentNotificationTemplateUpdateAttributes::new()
                .category("update".to_string())
                .content(
                    r#"Incident Status Update:

Title: Sample Incident Title
New Status: resolved
Severity: SEV-2
Services: web-service, database-service
Commander: John Doe

For more details, visit the incident page."#
                        .to_string(),
                )
                .name("Example-Incident".to_string())
                .subject("Incident Update: Sample Incident Title - resolved".to_string()),
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncidentNotificationTemplate", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident_notification_template(
            notification_template_data_id.clone(),
            body,
            UpdateIncidentNotificationTemplateOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Update incident notification template returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateIncidentNotificationTemplate"] =
  true;
const apiInstance = new v2.IncidentsApi(configuration);

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

const params: v2.IncidentsApiUpdateIncidentNotificationTemplateRequest = {
  body: {
    data: {
      attributes: {
        category: "update",
        content:
          "Incident Status Update:\n\nTitle: Sample Incident Title\nNew Status: resolved\nSeverity: SEV-2\nServices: web-service, database-service\nCommander: John Doe\n\nFor more details, visit the incident page.",
        name: "Example-Incident",
        subject: "Incident Update: Sample Incident Title - resolved",
      },
      id: NOTIFICATION_TEMPLATE_DATA_ID,
      type: "notification_templates",
    },
  },
  id: NOTIFICATION_TEMPLATE_DATA_ID,
};

apiInstance
  .updateIncidentNotificationTemplate(params)
  .then((data: v2.IncidentNotificationTemplate) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Delete a notification template{% #delete-a-notification-template %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                             |
| ----------------- | ---------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/incidents/config/notification-templates/{id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/incidents/config/notification-templates/{id}      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/incidents/config/notification-templates/{id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/incidents/config/notification-templates/{id} |

### Overview

Deletes a notification template by its ID. This endpoint requires the `incident_notification_settings_write` permission.

OAuth apps require the `incident_notification_settings_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                 | Type   | Description                          |
| -------------------- | ------ | ------------------------------------ |
| id [*required*] | string | The ID of the notification template. |

#### Query Strings

| Name    | Type   | Description                                                                                                                     |
| ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------- |
| include | string | Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` |

### 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="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

##### 
                  \# Path parametersexport id="00000000-0000-0000-0000-000000000001"\# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/notification-templates/${id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Delete a notification template returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["delete_incident_notification_template"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    api_instance.delete_incident_notification_template(
        id=UUID("00000000-0000-0000-0000-000000000001"),
    )
```

#### Instructions

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

```ruby
# Delete a notification template returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.delete_incident_notification_template".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
api_instance.delete_incident_notification_template("00000000-0000-0000-0000-000000000001")
```

#### Instructions

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

```go
// Delete a notification template returns "No Content" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteIncidentNotificationTemplate", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	r, err := api.DeleteIncidentNotificationTemplate(ctx, uuid.MustParse("00000000-0000-0000-0000-000000000001"), *datadogV2.NewDeleteIncidentNotificationTemplateOptionalParameters())

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

#### Instructions

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

```java
// Delete a notification template returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;
import java.util.UUID;

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

    try {
      apiInstance.deleteIncidentNotificationTemplate(
          UUID.fromString("00000000-0000-0000-0000-000000000001"));
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#deleteIncidentNotificationTemplate");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Delete a notification template returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::DeleteIncidentNotificationTemplateOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncidentNotificationTemplate", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .delete_incident_notification_template(
            Uuid::parse_str("00000000-0000-0000-0000-000000000001").expect("invalid UUID"),
            DeleteIncidentNotificationTemplateOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Delete a notification template returns "No Content" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteIncidentNotificationTemplate"] =
  true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiDeleteIncidentNotificationTemplateRequest = {
  id: "00000000-0000-0000-0000-000000000001",
};

apiInstance
  .deleteIncidentNotificationTemplate(params)
  .then((data: any) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## List incident notification rules{% #list-incident-notification-rules %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                 |
| ----------------- | ---------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/config/notification-rules |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/config/notification-rules |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/config/notification-rules      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/config/notification-rules      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/config/notification-rules     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/config/notification-rules |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/config/notification-rules |

### Overview

Lists all notification rules for the organization. Optionally filter by incident type. This endpoint requires the `incident_notification_settings_read` permission.

### Arguments

#### Query Strings

| Name    | Type   | Description                                                                                                                                          |
| ------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| include | string | Comma-separated list of resources to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type`, `notification_template` |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with notification rules.

| Parent field                  | Field                         | Type            | Description                                                                                                                                 |
| ----------------------------- | ----------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]        | [object]        | The `NotificationRuleArray` `data`.                                                                                                         |
| data                          | attributes                    | object          | The notification rule's attributes.                                                                                                         |
| attributes                    | conditions [*required*]  | [object]        | The conditions that trigger this notification rule.                                                                                         |
| conditions                    | field [*required*]       | string          | The incident field to evaluate                                                                                                              |
| conditions                    | values [*required*]      | [string]        | The value(s) to compare against. Multiple values are `ORed` together.                                                                       |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification rule was created.                                                                                           |
| attributes                    | enabled [*required*]     | boolean         | Whether the notification rule is enabled.                                                                                                   |
| attributes                    | handles [*required*]     | [string]        | The notification handles (targets) for this rule.                                                                                           |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification rule was last modified.                                                                                     |
| attributes                    | renotify_on                   | [string]        | List of incident fields that trigger re-notification when changed.                                                                          |
| attributes                    | trigger [*required*]     | string          | The trigger event for this notification rule.                                                                                               |
| attributes                    | visibility [*required*]  | enum            | The visibility of the notification rule. Allowed enum values: `all,organization,private`                                                    |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification rule.                                                                                             |
| data                          | relationships                 | object          | The notification rule'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| relationships                 | notification_template         | object          | A relationship reference to a notification template.                                                                                        |
| notification_template         | data [*required*]        | object          | The notification template relationship data.                                                                                                |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| data                          | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |
| data                          | type [*required*]        | enum            | Notification rules resource type. Allowed enum values: `incident_notification_rules`                                                        |
|                               | included                      | [ <oneOf>] | Related objects that are included in the response.                                                                                          |
| included                      | Option 1                      | object          | User object returned by the API.                                                                                                            |
| Option 1                      | attributes                    | object          | Attributes of user object returned by the API.                                                                                              |
| attributes                    | created_at                    | date-time       | Creation time of the user.                                                                                                                  |
| attributes                    | disabled                      | boolean         | Whether the user is disabled.                                                                                                               |
| attributes                    | email                         | string          | Email of the user.                                                                                                                          |
| attributes                    | handle                        | string          | Handle of the user.                                                                                                                         |
| attributes                    | icon                          | string          | URL of the user's icon.                                                                                                                     |
| attributes                    | last_login_time               | date-time       | The last time the user logged in.                                                                                                           |
| attributes                    | mfa_enabled                   | boolean         | If user has MFA enabled.                                                                                                                    |
| attributes                    | modified_at                   | date-time       | Time that the user was last modified.                                                                                                       |
| attributes                    | name                          | string          | Name of the user.                                                                                                                           |
| attributes                    | service_account               | boolean         | Whether the user is a service account.                                                                                                      |
| attributes                    | status                        | string          | Status of the user.                                                                                                                         |
| attributes                    | title                         | string          | Title of the user.                                                                                                                          |
| attributes                    | verified                      | boolean         | Whether the user is verified.                                                                                                               |
| Option 1                      | id                            | string          | ID of the user.                                                                                                                             |
| Option 1                      | relationships                 | object          | Relationships of the user object returned by the API.                                                                                       |
| relationships                 | org                           | object          | Relationship to an organization.                                                                                                            |
| org                           | data [*required*]        | object          | Relationship to organization object.                                                                                                        |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_orgs                    | object          | Relationship to organizations.                                                                                                              |
| other_orgs                    | data [*required*]        | [object]        | Relationships to organization objects.                                                                                                      |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_users                   | object          | Relationship to users.                                                                                                                      |
| other_users                   | data [*required*]        | [object]        | Relationships to user objects.                                                                                                              |
| data                          | id [*required*]          | string          | A unique identifier that represents the user.                                                                                               |
| data                          | type [*required*]        | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| relationships                 | roles                         | object          | Relationship to roles.                                                                                                                      |
| roles                         | data                          | [object]        | An array containing type and the unique identifier of a role.                                                                               |
| data                          | id                            | string          | The unique identifier of the role.                                                                                                          |
| data                          | type                          | enum            | Roles type. Allowed enum values: `roles`                                                                                                    |
| Option 1                      | type                          | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| included                      | Option 2                      | object          | Incident type response data.                                                                                                                |
| Option 2                      | attributes                    | object          | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                     | date-time       | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string          | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string          | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time       | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| Option 2                      | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| Option 2                      | 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`                                                                                           |
| 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`                                                                                           |
| 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.                                                                                                         |
| Option 2                      | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| included                      | Option 3                      | object          | A notification template object for inclusion in other resources.                                                                            |
| Option 3                      | attributes                    | object          | The notification template's attributes.                                                                                                     |
| attributes                    | category [*required*]    | string          | The category of the notification template.                                                                                                  |
| attributes                    | content [*required*]     | string          | The content body of the notification template.                                                                                              |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification template was created.                                                                                       |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification template was last modified.                                                                                 |
| attributes                    | name [*required*]        | string          | The name of the notification template.                                                                                                      |
| attributes                    | subject [*required*]     | string          | The subject line of the notification template.                                                                                              |
| Option 3                      | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| Option 3                      | relationships                 | object          | The notification template'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| Option 3                      | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |
|                               | meta                          | object          | Response metadata.                                                                                                                          |
| meta                          | pagination                    | object          | Pagination metadata.                                                                                                                        |
| pagination                    | next_offset                   | int64           | The offset for the next page of results.                                                                                                    |
| pagination                    | offset                        | int64           | The current offset in the results.                                                                                                          |
| pagination                    | size                          | int64           | The number of results returned per page.                                                                                                    |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "conditions": [
          {
            "field": "severity",
            "values": [
              "SEV-1",
              "SEV-2"
            ]
          }
        ],
        "created": "2025-01-15T10:30:00Z",
        "enabled": true,
        "handles": [
          "@team-email@company.com",
          "@slack-channel"
        ],
        "modified": "2025-01-15T14:45:00Z",
        "renotify_on": [
          "status",
          "severity"
        ],
        "trigger": "incident_created_trigger",
        "visibility": "organization"
      },
      "id": "00000000-0000-0000-0000-000000000001",
      "relationships": {
        "created_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "incident_type": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "incident_types"
          }
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        },
        "notification_template": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000001",
            "type": "notification_templates"
          }
        }
      },
      "type": "incident_notification_rules"
    }
  ],
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ],
  "meta": {
    "pagination": {
      "next_offset": 15,
      "offset": 0,
      "size": 15
    }
  }
}
```

{% /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

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/notification-rules" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
List incident notification rules returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

configuration = Configuration()
configuration.unstable_operations["list_incident_notification_rules"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.list_incident_notification_rules()

    print(response)
```

#### Instructions

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

```ruby
# List incident notification rules returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.list_incident_notification_rules".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.list_incident_notification_rules()
```

#### Instructions

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

```go
// List incident notification rules 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListIncidentNotificationRules", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.ListIncidentNotificationRules(ctx, *datadogV2.NewListIncidentNotificationRulesOptionalParameters())

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

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

#### Instructions

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

```java
// List incident notification rules 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.IncidentNotificationRuleArray;

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

    try {
      IncidentNotificationRuleArray result = apiInstance.listIncidentNotificationRules();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#listIncidentNotificationRules");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// List incident notification rules returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::ListIncidentNotificationRulesOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidentNotificationRules", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .list_incident_notification_rules(ListIncidentNotificationRulesOptionalParams::default())
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * List incident notification rules returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listIncidentNotificationRules"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

apiInstance
  .listIncidentNotificationRules()
  .then((data: v2.IncidentNotificationRuleArray) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Create an incident notification rule{% #create-an-incident-notification-rule %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                  |
| ----------------- | ----------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/incidents/config/notification-rules |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/incidents/config/notification-rules |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/incidents/config/notification-rules      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/incidents/config/notification-rules      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/incidents/config/notification-rules     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/incidents/config/notification-rules |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/incidents/config/notification-rules |

### Overview

Creates a new notification rule. This endpoint requires the `incident_notification_settings_write` permission.

OAuth apps require the `incident_notification_settings_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field          | Field                        | Type     | Description                                                                              |
| --------------------- | ---------------------------- | -------- | ---------------------------------------------------------------------------------------- |
|                       | data [*required*]       | object   | Notification rule data for a create request.                                             |
| data                  | attributes [*required*] | object   | The attributes for creating a notification rule.                                         |
| attributes            | conditions [*required*] | [object] | The conditions that trigger this notification rule.                                      |
| conditions            | field [*required*]      | string   | The incident field to evaluate                                                           |
| conditions            | values [*required*]     | [string] | The value(s) to compare against. Multiple values are `ORed` together.                    |
| attributes            | enabled                      | boolean  | Whether the notification rule is enabled.                                                |
| attributes            | handles [*required*]    | [string] | The notification handles (targets) for this rule.                                        |
| attributes            | renotify_on                  | [string] | List of incident fields that trigger re-notification when changed.                       |
| attributes            | trigger [*required*]    | string   | The trigger event for this notification rule.                                            |
| attributes            | visibility                   | enum     | The visibility of the notification rule. Allowed enum values: `all,organization,private` |
| data                  | relationships                | object   | The definition of `NotificationRuleCreateDataRelationships` object.                      |
| relationships         | incident_type                | object   | Relationship to an incident type.                                                        |
| incident_type         | data [*required*]       | object   | Relationship to incident type object.                                                    |
| data                  | id [*required*]         | string   | The incident type's ID.                                                                  |
| data                  | type [*required*]       | enum     | Incident type resource type. Allowed enum values: `incident_types`                       |
| relationships         | notification_template        | object   | A relationship reference to a notification template.                                     |
| notification_template | data [*required*]       | object   | The notification template relationship data.                                             |
| data                  | id [*required*]         | uuid     | The unique identifier of the notification template.                                      |
| data                  | type [*required*]       | enum     | Notification templates resource type. Allowed enum values: `notification_templates`      |
| data                  | type [*required*]       | enum     | Notification rules resource type. Allowed enum values: `incident_notification_rules`     |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "conditions": [
        {
          "field": "severity",
          "values": [
            "SEV-1",
            "SEV-2"
          ]
        }
      ],
      "handles": [
        "@test-email@company.com"
      ],
      "visibility": "organization",
      "trigger": "incident_created_trigger",
      "enabled": true
    },
    "relationships": {
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      }
    },
    "type": "incident_notification_rules"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response with a notification rule.

| Parent field                  | Field                         | Type            | Description                                                                                                                                 |
| ----------------------------- | ----------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]        | object          | Notification rule data from a response.                                                                                                     |
| data                          | attributes                    | object          | The notification rule's attributes.                                                                                                         |
| attributes                    | conditions [*required*]  | [object]        | The conditions that trigger this notification rule.                                                                                         |
| conditions                    | field [*required*]       | string          | The incident field to evaluate                                                                                                              |
| conditions                    | values [*required*]      | [string]        | The value(s) to compare against. Multiple values are `ORed` together.                                                                       |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification rule was created.                                                                                           |
| attributes                    | enabled [*required*]     | boolean         | Whether the notification rule is enabled.                                                                                                   |
| attributes                    | handles [*required*]     | [string]        | The notification handles (targets) for this rule.                                                                                           |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification rule was last modified.                                                                                     |
| attributes                    | renotify_on                   | [string]        | List of incident fields that trigger re-notification when changed.                                                                          |
| attributes                    | trigger [*required*]     | string          | The trigger event for this notification rule.                                                                                               |
| attributes                    | visibility [*required*]  | enum            | The visibility of the notification rule. Allowed enum values: `all,organization,private`                                                    |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification rule.                                                                                             |
| data                          | relationships                 | object          | The notification rule'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| relationships                 | notification_template         | object          | A relationship reference to a notification template.                                                                                        |
| notification_template         | data [*required*]        | object          | The notification template relationship data.                                                                                                |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| data                          | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |
| data                          | type [*required*]        | enum            | Notification rules resource type. Allowed enum values: `incident_notification_rules`                                                        |
|                               | included                      | [ <oneOf>] | Related objects that are included in the response.                                                                                          |
| included                      | Option 1                      | object          | User object returned by the API.                                                                                                            |
| Option 1                      | attributes                    | object          | Attributes of user object returned by the API.                                                                                              |
| attributes                    | created_at                    | date-time       | Creation time of the user.                                                                                                                  |
| attributes                    | disabled                      | boolean         | Whether the user is disabled.                                                                                                               |
| attributes                    | email                         | string          | Email of the user.                                                                                                                          |
| attributes                    | handle                        | string          | Handle of the user.                                                                                                                         |
| attributes                    | icon                          | string          | URL of the user's icon.                                                                                                                     |
| attributes                    | last_login_time               | date-time       | The last time the user logged in.                                                                                                           |
| attributes                    | mfa_enabled                   | boolean         | If user has MFA enabled.                                                                                                                    |
| attributes                    | modified_at                   | date-time       | Time that the user was last modified.                                                                                                       |
| attributes                    | name                          | string          | Name of the user.                                                                                                                           |
| attributes                    | service_account               | boolean         | Whether the user is a service account.                                                                                                      |
| attributes                    | status                        | string          | Status of the user.                                                                                                                         |
| attributes                    | title                         | string          | Title of the user.                                                                                                                          |
| attributes                    | verified                      | boolean         | Whether the user is verified.                                                                                                               |
| Option 1                      | id                            | string          | ID of the user.                                                                                                                             |
| Option 1                      | relationships                 | object          | Relationships of the user object returned by the API.                                                                                       |
| relationships                 | org                           | object          | Relationship to an organization.                                                                                                            |
| org                           | data [*required*]        | object          | Relationship to organization object.                                                                                                        |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_orgs                    | object          | Relationship to organizations.                                                                                                              |
| other_orgs                    | data [*required*]        | [object]        | Relationships to organization objects.                                                                                                      |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_users                   | object          | Relationship to users.                                                                                                                      |
| other_users                   | data [*required*]        | [object]        | Relationships to user objects.                                                                                                              |
| data                          | id [*required*]          | string          | A unique identifier that represents the user.                                                                                               |
| data                          | type [*required*]        | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| relationships                 | roles                         | object          | Relationship to roles.                                                                                                                      |
| roles                         | data                          | [object]        | An array containing type and the unique identifier of a role.                                                                               |
| data                          | id                            | string          | The unique identifier of the role.                                                                                                          |
| data                          | type                          | enum            | Roles type. Allowed enum values: `roles`                                                                                                    |
| Option 1                      | type                          | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| included                      | Option 2                      | object          | Incident type response data.                                                                                                                |
| Option 2                      | attributes                    | object          | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                     | date-time       | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string          | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string          | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time       | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| Option 2                      | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| Option 2                      | 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`                                                                                           |
| 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`                                                                                           |
| 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.                                                                                                         |
| Option 2                      | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| included                      | Option 3                      | object          | A notification template object for inclusion in other resources.                                                                            |
| Option 3                      | attributes                    | object          | The notification template's attributes.                                                                                                     |
| attributes                    | category [*required*]    | string          | The category of the notification template.                                                                                                  |
| attributes                    | content [*required*]     | string          | The content body of the notification template.                                                                                              |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification template was created.                                                                                       |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification template was last modified.                                                                                 |
| attributes                    | name [*required*]        | string          | The name of the notification template.                                                                                                      |
| attributes                    | subject [*required*]     | string          | The subject line of the notification template.                                                                                              |
| Option 3                      | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| Option 3                      | relationships                 | object          | The notification template'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| Option 3                      | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "conditions": [
        {
          "field": "severity",
          "values": [
            "SEV-1",
            "SEV-2"
          ]
        }
      ],
      "created": "2025-01-15T10:30:00Z",
      "enabled": true,
      "handles": [
        "@team-email@company.com",
        "@slack-channel"
      ],
      "modified": "2025-01-15T14:45:00Z",
      "renotify_on": [
        "status",
        "severity"
      ],
      "trigger": "incident_created_trigger",
      "visibility": "organization"
    },
    "id": "00000000-0000-0000-0000-000000000001",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "notification_template": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000001",
          "type": "notification_templates"
        }
      }
    },
    "type": "incident_notification_rules"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                          \# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/notification-rules" \
-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": {
      "conditions": [
        {
          "field": "severity",
          "values": [
            "SEV-1",
            "SEV-2"
          ]
        }
      ],
      "handles": [
        "@test-email@company.com"
      ],
      "visibility": "organization",
      "trigger": "incident_created_trigger",
      "enabled": true
    },
    "relationships": {
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      }
    },
    "type": "incident_notification_rules"
  }
}
EOF
                        
##### 

```go
// Create incident notification rule returns "Created" 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.CreateIncidentNotificationRuleRequest{
		Data: datadogV2.IncidentNotificationRuleCreateData{
			Attributes: datadogV2.IncidentNotificationRuleCreateAttributes{
				Conditions: []datadogV2.IncidentNotificationRuleConditionsItems{
					{
						Field: "severity",
						Values: []string{
							"SEV-1",
							"SEV-2",
						},
					},
				},
				Handles: []string{
					"@test-email@company.com",
				},
				Visibility: datadogV2.INCIDENTNOTIFICATIONRULECREATEATTRIBUTESVISIBILITY_ORGANIZATION.Ptr(),
				Trigger:    "incident_created_trigger",
				Enabled:    datadog.PtrBool(true),
			},
			Relationships: &datadogV2.IncidentNotificationRuleCreateDataRelationships{
				IncidentType: &datadogV2.RelationshipToIncidentType{
					Data: datadogV2.RelationshipToIncidentTypeData{
						Id:   IncidentTypeDataID,
						Type: datadogV2.INCIDENTTYPETYPE_INCIDENT_TYPES,
					},
				},
			},
			Type: datadogV2.INCIDENTNOTIFICATIONRULETYPE_INCIDENT_NOTIFICATION_RULES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateIncidentNotificationRule", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.CreateIncidentNotificationRule(ctx, body)

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

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

#### Instructions

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

```java
// Create incident notification rule returns "Created" 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.CreateIncidentNotificationRuleRequest;
import com.datadog.api.client.v2.model.IncidentNotificationRule;
import com.datadog.api.client.v2.model.IncidentNotificationRuleConditionsItems;
import com.datadog.api.client.v2.model.IncidentNotificationRuleCreateAttributes;
import com.datadog.api.client.v2.model.IncidentNotificationRuleCreateAttributesVisibility;
import com.datadog.api.client.v2.model.IncidentNotificationRuleCreateData;
import com.datadog.api.client.v2.model.IncidentNotificationRuleCreateDataRelationships;
import com.datadog.api.client.v2.model.IncidentNotificationRuleType;
import com.datadog.api.client.v2.model.IncidentTypeType;
import com.datadog.api.client.v2.model.RelationshipToIncidentType;
import com.datadog.api.client.v2.model.RelationshipToIncidentTypeData;
import java.util.Arrays;
import java.util.Collections;

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

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

    CreateIncidentNotificationRuleRequest body =
        new CreateIncidentNotificationRuleRequest()
            .data(
                new IncidentNotificationRuleCreateData()
                    .attributes(
                        new IncidentNotificationRuleCreateAttributes()
                            .conditions(
                                Collections.singletonList(
                                    new IncidentNotificationRuleConditionsItems()
                                        .field("severity")
                                        .values(Arrays.asList("SEV-1", "SEV-2"))))
                            .handles(Collections.singletonList("@test-email@company.com"))
                            .visibility(
                                IncidentNotificationRuleCreateAttributesVisibility.ORGANIZATION)
                            .trigger("incident_created_trigger")
                            .enabled(true))
                    .relationships(
                        new IncidentNotificationRuleCreateDataRelationships()
                            .incidentType(
                                new RelationshipToIncidentType()
                                    .data(
                                        new RelationshipToIncidentTypeData()
                                            .id(INCIDENT_TYPE_DATA_ID)
                                            .type(IncidentTypeType.INCIDENT_TYPES))))
                    .type(IncidentNotificationRuleType.INCIDENT_NOTIFICATION_RULES));

    try {
      IncidentNotificationRule result = apiInstance.createIncidentNotificationRule(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#createIncidentNotificationRule");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Create incident notification rule returns "Created" 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.create_incident_notification_rule_request import CreateIncidentNotificationRuleRequest
from datadog_api_client.v2.model.incident_notification_rule_conditions_items import (
    IncidentNotificationRuleConditionsItems,
)
from datadog_api_client.v2.model.incident_notification_rule_create_attributes import (
    IncidentNotificationRuleCreateAttributes,
)
from datadog_api_client.v2.model.incident_notification_rule_create_attributes_visibility import (
    IncidentNotificationRuleCreateAttributesVisibility,
)
from datadog_api_client.v2.model.incident_notification_rule_create_data import IncidentNotificationRuleCreateData
from datadog_api_client.v2.model.incident_notification_rule_create_data_relationships import (
    IncidentNotificationRuleCreateDataRelationships,
)
from datadog_api_client.v2.model.incident_notification_rule_type import IncidentNotificationRuleType
from datadog_api_client.v2.model.incident_type_type import IncidentTypeType
from datadog_api_client.v2.model.relationship_to_incident_type import RelationshipToIncidentType
from datadog_api_client.v2.model.relationship_to_incident_type_data import RelationshipToIncidentTypeData

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

body = CreateIncidentNotificationRuleRequest(
    data=IncidentNotificationRuleCreateData(
        attributes=IncidentNotificationRuleCreateAttributes(
            conditions=[
                IncidentNotificationRuleConditionsItems(
                    field="severity",
                    values=[
                        "SEV-1",
                        "SEV-2",
                    ],
                ),
            ],
            handles=[
                "@test-email@company.com",
            ],
            visibility=IncidentNotificationRuleCreateAttributesVisibility.ORGANIZATION,
            trigger="incident_created_trigger",
            enabled=True,
        ),
        relationships=IncidentNotificationRuleCreateDataRelationships(
            incident_type=RelationshipToIncidentType(
                data=RelationshipToIncidentTypeData(
                    id=INCIDENT_TYPE_DATA_ID,
                    type=IncidentTypeType.INCIDENT_TYPES,
                ),
            ),
        ),
        type=IncidentNotificationRuleType.INCIDENT_NOTIFICATION_RULES,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_incident_notification_rule"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.create_incident_notification_rule(body=body)

    print(response)
```

#### Instructions

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

```ruby
# Create incident notification rule returns "Created" response

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

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

body = DatadogAPIClient::V2::CreateIncidentNotificationRuleRequest.new({
  data: DatadogAPIClient::V2::IncidentNotificationRuleCreateData.new({
    attributes: DatadogAPIClient::V2::IncidentNotificationRuleCreateAttributes.new({
      conditions: [
        DatadogAPIClient::V2::IncidentNotificationRuleConditionsItems.new({
          field: "severity",
          values: [
            "SEV-1",
            "SEV-2",
          ],
        }),
      ],
      handles: [
        "@test-email@company.com",
      ],
      visibility: DatadogAPIClient::V2::IncidentNotificationRuleCreateAttributesVisibility::ORGANIZATION,
      trigger: "incident_created_trigger",
      enabled: true,
    }),
    relationships: DatadogAPIClient::V2::IncidentNotificationRuleCreateDataRelationships.new({
      incident_type: DatadogAPIClient::V2::RelationshipToIncidentType.new({
        data: DatadogAPIClient::V2::RelationshipToIncidentTypeData.new({
          id: INCIDENT_TYPE_DATA_ID,
          type: DatadogAPIClient::V2::IncidentTypeType::INCIDENT_TYPES,
        }),
      }),
    }),
    type: DatadogAPIClient::V2::IncidentNotificationRuleType::INCIDENT_NOTIFICATION_RULES,
  }),
})
p api_instance.create_incident_notification_rule(body)
```

#### Instructions

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

```rust
// Create incident notification rule returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::CreateIncidentNotificationRuleRequest;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleConditionsItems;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleCreateAttributes;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleCreateAttributesVisibility;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleCreateData;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleCreateDataRelationships;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleType;
use datadog_api_client::datadogV2::model::IncidentTypeType;
use datadog_api_client::datadogV2::model::RelationshipToIncidentType;
use datadog_api_client::datadogV2::model::RelationshipToIncidentTypeData;

#[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 = CreateIncidentNotificationRuleRequest::new(
        IncidentNotificationRuleCreateData::new(
            IncidentNotificationRuleCreateAttributes::new(
                vec![IncidentNotificationRuleConditionsItems::new(
                    "severity".to_string(),
                    vec!["SEV-1".to_string(), "SEV-2".to_string()],
                )],
                vec!["@test-email@company.com".to_string()],
                "incident_created_trigger".to_string(),
            )
            .enabled(true)
            .visibility(IncidentNotificationRuleCreateAttributesVisibility::ORGANIZATION),
            IncidentNotificationRuleType::INCIDENT_NOTIFICATION_RULES,
        )
        .relationships(
            IncidentNotificationRuleCreateDataRelationships::new().incident_type(
                RelationshipToIncidentType::new(RelationshipToIncidentTypeData::new(
                    incident_type_data_id.clone(),
                    IncidentTypeType::INCIDENT_TYPES,
                )),
            ),
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncidentNotificationRule", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api.create_incident_notification_rule(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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Create incident notification rule returns "Created" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentNotificationRule"] = 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.IncidentsApiCreateIncidentNotificationRuleRequest = {
  body: {
    data: {
      attributes: {
        conditions: [
          {
            field: "severity",
            values: ["SEV-1", "SEV-2"],
          },
        ],
        handles: ["@test-email@company.com"],
        visibility: "organization",
        trigger: "incident_created_trigger",
        enabled: true,
      },
      relationships: {
        incidentType: {
          data: {
            id: INCIDENT_TYPE_DATA_ID,
            type: "incident_types",
          },
        },
      },
      type: "incident_notification_rules",
    },
  },
};

apiInstance
  .createIncidentNotificationRule(params)
  .then((data: v2.IncidentNotificationRule) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Get an incident notification rule{% #get-an-incident-notification-rule %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                      |
| ----------------- | --------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/config/notification-rules/{id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/config/notification-rules/{id}      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/config/notification-rules/{id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |

### Overview

Retrieves a specific notification rule by its ID. This endpoint requires the `incident_notification_settings_read` permission.

OAuth apps require the `incident_notification_settings_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                 | Type   | Description                      |
| -------------------- | ------ | -------------------------------- |
| id [*required*] | string | The ID of the notification rule. |

#### Query Strings

| Name    | Type   | Description                                                                                                                                          |
| ------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| include | string | Comma-separated list of resources to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type`, `notification_template` |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with a notification rule.

| Parent field                  | Field                         | Type            | Description                                                                                                                                 |
| ----------------------------- | ----------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]        | object          | Notification rule data from a response.                                                                                                     |
| data                          | attributes                    | object          | The notification rule's attributes.                                                                                                         |
| attributes                    | conditions [*required*]  | [object]        | The conditions that trigger this notification rule.                                                                                         |
| conditions                    | field [*required*]       | string          | The incident field to evaluate                                                                                                              |
| conditions                    | values [*required*]      | [string]        | The value(s) to compare against. Multiple values are `ORed` together.                                                                       |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification rule was created.                                                                                           |
| attributes                    | enabled [*required*]     | boolean         | Whether the notification rule is enabled.                                                                                                   |
| attributes                    | handles [*required*]     | [string]        | The notification handles (targets) for this rule.                                                                                           |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification rule was last modified.                                                                                     |
| attributes                    | renotify_on                   | [string]        | List of incident fields that trigger re-notification when changed.                                                                          |
| attributes                    | trigger [*required*]     | string          | The trigger event for this notification rule.                                                                                               |
| attributes                    | visibility [*required*]  | enum            | The visibility of the notification rule. Allowed enum values: `all,organization,private`                                                    |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification rule.                                                                                             |
| data                          | relationships                 | object          | The notification rule'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| relationships                 | notification_template         | object          | A relationship reference to a notification template.                                                                                        |
| notification_template         | data [*required*]        | object          | The notification template relationship data.                                                                                                |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| data                          | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |
| data                          | type [*required*]        | enum            | Notification rules resource type. Allowed enum values: `incident_notification_rules`                                                        |
|                               | included                      | [ <oneOf>] | Related objects that are included in the response.                                                                                          |
| included                      | Option 1                      | object          | User object returned by the API.                                                                                                            |
| Option 1                      | attributes                    | object          | Attributes of user object returned by the API.                                                                                              |
| attributes                    | created_at                    | date-time       | Creation time of the user.                                                                                                                  |
| attributes                    | disabled                      | boolean         | Whether the user is disabled.                                                                                                               |
| attributes                    | email                         | string          | Email of the user.                                                                                                                          |
| attributes                    | handle                        | string          | Handle of the user.                                                                                                                         |
| attributes                    | icon                          | string          | URL of the user's icon.                                                                                                                     |
| attributes                    | last_login_time               | date-time       | The last time the user logged in.                                                                                                           |
| attributes                    | mfa_enabled                   | boolean         | If user has MFA enabled.                                                                                                                    |
| attributes                    | modified_at                   | date-time       | Time that the user was last modified.                                                                                                       |
| attributes                    | name                          | string          | Name of the user.                                                                                                                           |
| attributes                    | service_account               | boolean         | Whether the user is a service account.                                                                                                      |
| attributes                    | status                        | string          | Status of the user.                                                                                                                         |
| attributes                    | title                         | string          | Title of the user.                                                                                                                          |
| attributes                    | verified                      | boolean         | Whether the user is verified.                                                                                                               |
| Option 1                      | id                            | string          | ID of the user.                                                                                                                             |
| Option 1                      | relationships                 | object          | Relationships of the user object returned by the API.                                                                                       |
| relationships                 | org                           | object          | Relationship to an organization.                                                                                                            |
| org                           | data [*required*]        | object          | Relationship to organization object.                                                                                                        |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_orgs                    | object          | Relationship to organizations.                                                                                                              |
| other_orgs                    | data [*required*]        | [object]        | Relationships to organization objects.                                                                                                      |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_users                   | object          | Relationship to users.                                                                                                                      |
| other_users                   | data [*required*]        | [object]        | Relationships to user objects.                                                                                                              |
| data                          | id [*required*]          | string          | A unique identifier that represents the user.                                                                                               |
| data                          | type [*required*]        | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| relationships                 | roles                         | object          | Relationship to roles.                                                                                                                      |
| roles                         | data                          | [object]        | An array containing type and the unique identifier of a role.                                                                               |
| data                          | id                            | string          | The unique identifier of the role.                                                                                                          |
| data                          | type                          | enum            | Roles type. Allowed enum values: `roles`                                                                                                    |
| Option 1                      | type                          | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| included                      | Option 2                      | object          | Incident type response data.                                                                                                                |
| Option 2                      | attributes                    | object          | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                     | date-time       | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string          | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string          | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time       | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| Option 2                      | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| Option 2                      | 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`                                                                                           |
| 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`                                                                                           |
| 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.                                                                                                         |
| Option 2                      | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| included                      | Option 3                      | object          | A notification template object for inclusion in other resources.                                                                            |
| Option 3                      | attributes                    | object          | The notification template's attributes.                                                                                                     |
| attributes                    | category [*required*]    | string          | The category of the notification template.                                                                                                  |
| attributes                    | content [*required*]     | string          | The content body of the notification template.                                                                                              |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification template was created.                                                                                       |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification template was last modified.                                                                                 |
| attributes                    | name [*required*]        | string          | The name of the notification template.                                                                                                      |
| attributes                    | subject [*required*]     | string          | The subject line of the notification template.                                                                                              |
| Option 3                      | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| Option 3                      | relationships                 | object          | The notification template'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| Option 3                      | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "conditions": [
        {
          "field": "severity",
          "values": [
            "SEV-1",
            "SEV-2"
          ]
        }
      ],
      "created": "2025-01-15T10:30:00Z",
      "enabled": true,
      "handles": [
        "@team-email@company.com",
        "@slack-channel"
      ],
      "modified": "2025-01-15T14:45:00Z",
      "renotify_on": [
        "status",
        "severity"
      ],
      "trigger": "incident_created_trigger",
      "visibility": "organization"
    },
    "id": "00000000-0000-0000-0000-000000000001",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "notification_template": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000001",
          "type": "notification_templates"
        }
      }
    },
    "type": "incident_notification_rules"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                  \# Path parametersexport id="00000000-0000-0000-0000-000000000001"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/notification-rules/${id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Get an incident notification rule returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["get_incident_notification_rule"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.get_incident_notification_rule(
        id=UUID("00000000-0000-0000-0000-000000000001"),
    )

    print(response)
```

#### Instructions

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

```ruby
# Get an incident notification rule returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.get_incident_notification_rule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.get_incident_notification_rule("00000000-0000-0000-0000-000000000001")
```

#### Instructions

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

```go
// Get an incident notification rule 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"
	"github.com/google/uuid"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetIncidentNotificationRule", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.GetIncidentNotificationRule(ctx, uuid.MustParse("00000000-0000-0000-0000-000000000001"), *datadogV2.NewGetIncidentNotificationRuleOptionalParameters())

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

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

#### Instructions

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

```java
// Get an incident notification rule 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.IncidentNotificationRule;
import java.util.UUID;

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

    try {
      IncidentNotificationRule result =
          apiInstance.getIncidentNotificationRule(
              UUID.fromString("00000000-0000-0000-0000-000000000001"));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#getIncidentNotificationRule");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get an incident notification rule returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::GetIncidentNotificationRuleOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetIncidentNotificationRule", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .get_incident_notification_rule(
            Uuid::parse_str("00000000-0000-0000-0000-000000000001").expect("invalid UUID"),
            GetIncidentNotificationRuleOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get an incident notification rule returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getIncidentNotificationRule"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiGetIncidentNotificationRuleRequest = {
  id: "00000000-0000-0000-0000-000000000001",
};

apiInstance
  .getIncidentNotificationRule(params)
  .then((data: v2.IncidentNotificationRule) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Update an incident notification rule{% #update-an-incident-notification-rule %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                      |
| ----------------- | --------------------------------------------------------------------------------- |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v2/incidents/config/notification-rules/{id}      |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v2/incidents/config/notification-rules/{id}      |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v2/incidents/config/notification-rules/{id}     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |

### Overview

Updates an existing notification rule with a complete replacement. This endpoint requires the `incident_notification_settings_write` permission.

OAuth apps require the `incident_notification_settings_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                 | Type   | Description                      |
| -------------------- | ------ | -------------------------------- |
| id [*required*] | string | The ID of the notification rule. |

#### Query Strings

| Name    | Type   | Description                                                                                                                                          |
| ------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| include | string | Comma-separated list of resources to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type`, `notification_template` |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field          | Field                        | Type     | Description                                                                              |
| --------------------- | ---------------------------- | -------- | ---------------------------------------------------------------------------------------- |
|                       | data [*required*]       | object   | Notification rule data for an update request.                                            |
| data                  | attributes [*required*] | object   | The attributes for creating a notification rule.                                         |
| attributes            | conditions [*required*] | [object] | The conditions that trigger this notification rule.                                      |
| conditions            | field [*required*]      | string   | The incident field to evaluate                                                           |
| conditions            | values [*required*]     | [string] | The value(s) to compare against. Multiple values are `ORed` together.                    |
| attributes            | enabled                      | boolean  | Whether the notification rule is enabled.                                                |
| attributes            | handles [*required*]    | [string] | The notification handles (targets) for this rule.                                        |
| attributes            | renotify_on                  | [string] | List of incident fields that trigger re-notification when changed.                       |
| attributes            | trigger [*required*]    | string   | The trigger event for this notification rule.                                            |
| attributes            | visibility                   | enum     | The visibility of the notification rule. Allowed enum values: `all,organization,private` |
| data                  | id [*required*]         | uuid     | The unique identifier of the notification rule.                                          |
| data                  | relationships                | object   | The definition of `NotificationRuleCreateDataRelationships` object.                      |
| relationships         | incident_type                | object   | Relationship to an incident type.                                                        |
| incident_type         | data [*required*]       | object   | Relationship to incident type object.                                                    |
| data                  | id [*required*]         | string   | The incident type's ID.                                                                  |
| data                  | type [*required*]       | enum     | Incident type resource type. Allowed enum values: `incident_types`                       |
| relationships         | notification_template        | object   | A relationship reference to a notification template.                                     |
| notification_template | data [*required*]       | object   | The notification template relationship data.                                             |
| data                  | id [*required*]         | uuid     | The unique identifier of the notification template.                                      |
| data                  | type [*required*]       | enum     | Notification templates resource type. Allowed enum values: `notification_templates`      |
| data                  | type [*required*]       | enum     | Notification rules resource type. Allowed enum values: `incident_notification_rules`     |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "enabled": false,
      "conditions": [
        {
          "field": "severity",
          "values": [
            "SEV-1"
          ]
        }
      ],
      "handles": [
        "@updated-team-email@company.com"
      ],
      "visibility": "private",
      "trigger": "incident_modified_trigger"
    },
    "relationships": {
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      }
    },
    "id": "00000000-0000-0000-0000-000000000001",
    "type": "incident_notification_rules"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response with a notification rule.

| Parent field                  | Field                         | Type            | Description                                                                                                                                 |
| ----------------------------- | ----------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]        | object          | Notification rule data from a response.                                                                                                     |
| data                          | attributes                    | object          | The notification rule's attributes.                                                                                                         |
| attributes                    | conditions [*required*]  | [object]        | The conditions that trigger this notification rule.                                                                                         |
| conditions                    | field [*required*]       | string          | The incident field to evaluate                                                                                                              |
| conditions                    | values [*required*]      | [string]        | The value(s) to compare against. Multiple values are `ORed` together.                                                                       |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification rule was created.                                                                                           |
| attributes                    | enabled [*required*]     | boolean         | Whether the notification rule is enabled.                                                                                                   |
| attributes                    | handles [*required*]     | [string]        | The notification handles (targets) for this rule.                                                                                           |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification rule was last modified.                                                                                     |
| attributes                    | renotify_on                   | [string]        | List of incident fields that trigger re-notification when changed.                                                                          |
| attributes                    | trigger [*required*]     | string          | The trigger event for this notification rule.                                                                                               |
| attributes                    | visibility [*required*]  | enum            | The visibility of the notification rule. Allowed enum values: `all,organization,private`                                                    |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification rule.                                                                                             |
| data                          | relationships                 | object          | The notification rule'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| relationships                 | notification_template         | object          | A relationship reference to a notification template.                                                                                        |
| notification_template         | data [*required*]        | object          | The notification template relationship data.                                                                                                |
| data                          | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| data                          | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |
| data                          | type [*required*]        | enum            | Notification rules resource type. Allowed enum values: `incident_notification_rules`                                                        |
|                               | included                      | [ <oneOf>] | Related objects that are included in the response.                                                                                          |
| included                      | Option 1                      | object          | User object returned by the API.                                                                                                            |
| Option 1                      | attributes                    | object          | Attributes of user object returned by the API.                                                                                              |
| attributes                    | created_at                    | date-time       | Creation time of the user.                                                                                                                  |
| attributes                    | disabled                      | boolean         | Whether the user is disabled.                                                                                                               |
| attributes                    | email                         | string          | Email of the user.                                                                                                                          |
| attributes                    | handle                        | string          | Handle of the user.                                                                                                                         |
| attributes                    | icon                          | string          | URL of the user's icon.                                                                                                                     |
| attributes                    | last_login_time               | date-time       | The last time the user logged in.                                                                                                           |
| attributes                    | mfa_enabled                   | boolean         | If user has MFA enabled.                                                                                                                    |
| attributes                    | modified_at                   | date-time       | Time that the user was last modified.                                                                                                       |
| attributes                    | name                          | string          | Name of the user.                                                                                                                           |
| attributes                    | service_account               | boolean         | Whether the user is a service account.                                                                                                      |
| attributes                    | status                        | string          | Status of the user.                                                                                                                         |
| attributes                    | title                         | string          | Title of the user.                                                                                                                          |
| attributes                    | verified                      | boolean         | Whether the user is verified.                                                                                                               |
| Option 1                      | id                            | string          | ID of the user.                                                                                                                             |
| Option 1                      | relationships                 | object          | Relationships of the user object returned by the API.                                                                                       |
| relationships                 | org                           | object          | Relationship to an organization.                                                                                                            |
| org                           | data [*required*]        | object          | Relationship to organization object.                                                                                                        |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_orgs                    | object          | Relationship to organizations.                                                                                                              |
| other_orgs                    | data [*required*]        | [object]        | Relationships to organization objects.                                                                                                      |
| data                          | id [*required*]          | string          | ID of the organization.                                                                                                                     |
| data                          | type [*required*]        | enum            | Organizations resource type. Allowed enum values: `orgs`                                                                                    |
| relationships                 | other_users                   | object          | Relationship to users.                                                                                                                      |
| other_users                   | data [*required*]        | [object]        | Relationships to user objects.                                                                                                              |
| data                          | id [*required*]          | string          | A unique identifier that represents the user.                                                                                               |
| data                          | type [*required*]        | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| relationships                 | roles                         | object          | Relationship to roles.                                                                                                                      |
| roles                         | data                          | [object]        | An array containing type and the unique identifier of a role.                                                                               |
| data                          | id                            | string          | The unique identifier of the role.                                                                                                          |
| data                          | type                          | enum            | Roles type. Allowed enum values: `roles`                                                                                                    |
| Option 1                      | type                          | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| included                      | Option 2                      | object          | Incident type response data.                                                                                                                |
| Option 2                      | attributes                    | object          | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                     | date-time       | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                     | string          | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                | string          | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                    | date-time       | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| Option 2                      | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| Option 2                      | 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`                                                                                           |
| 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`                                                                                           |
| 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.                                                                                                         |
| Option 2                      | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| included                      | Option 3                      | object          | A notification template object for inclusion in other resources.                                                                            |
| Option 3                      | attributes                    | object          | The notification template's attributes.                                                                                                     |
| attributes                    | category [*required*]    | string          | The category of the notification template.                                                                                                  |
| attributes                    | content [*required*]     | string          | The content body of the notification template.                                                                                              |
| attributes                    | created [*required*]     | date-time       | Timestamp when the notification template was created.                                                                                       |
| attributes                    | modified [*required*]    | date-time       | Timestamp when the notification template was last modified.                                                                                 |
| attributes                    | name [*required*]        | string          | The name of the notification template.                                                                                                      |
| attributes                    | subject [*required*]     | string          | The subject line of the notification template.                                                                                              |
| Option 3                      | id [*required*]          | uuid            | The unique identifier of the notification template.                                                                                         |
| Option 3                      | relationships                 | object          | The notification template'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`                                                                                           |
| relationships                 | incident_type                 | object          | Relationship to an incident type.                                                                                                           |
| incident_type                 | data [*required*]        | object          | Relationship to incident type object.                                                                                                       |
| data                          | id [*required*]          | string          | The incident type's ID.                                                                                                                     |
| data                          | type [*required*]        | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |
| 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`                                                                                           |
| Option 3                      | type [*required*]        | enum            | Notification templates resource type. Allowed enum values: `notification_templates`                                                         |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "conditions": [
        {
          "field": "severity",
          "values": [
            "SEV-1",
            "SEV-2"
          ]
        }
      ],
      "created": "2025-01-15T10:30:00Z",
      "enabled": true,
      "handles": [
        "@team-email@company.com",
        "@slack-channel"
      ],
      "modified": "2025-01-15T14:45:00Z",
      "renotify_on": [
        "status",
        "severity"
      ],
      "trigger": "incident_created_trigger",
      "visibility": "organization"
    },
    "id": "00000000-0000-0000-0000-000000000001",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      },
      "notification_template": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000001",
          "type": "notification_templates"
        }
      }
    },
    "type": "incident_notification_rules"
  },
  "included": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "disabled": false,
        "email": "string",
        "handle": "string",
        "icon": "string",
        "last_login_time": "2019-09-19T10:00:00.000Z",
        "mfa_enabled": false,
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "service_account": false,
        "status": "string",
        "title": "string",
        "verified": false
      },
      "id": "string",
      "relationships": {
        "org": {
          "data": {
            "id": "00000000-0000-beef-0000-000000000000",
            "type": "orgs"
          }
        },
        "other_orgs": {
          "data": [
            {
              "id": "00000000-0000-beef-0000-000000000000",
              "type": "orgs"
            }
          ]
        },
        "other_users": {
          "data": [
            {
              "id": "00000000-0000-0000-2345-000000000000",
              "type": "users"
            }
          ]
        },
        "roles": {
          "data": [
            {
              "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
              "type": "roles"
            }
          ]
        }
      },
      "type": "users"
    }
  ]
}
```

{% /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

##### 
                          \# Path parametersexport id="00000000-0000-0000-0000-000000000001"\# Curl commandcurl -X PUT "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/notification-rules/${id}" \
-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": {
      "enabled": false,
      "conditions": [
        {
          "field": "severity",
          "values": [
            "SEV-1"
          ]
        }
      ],
      "handles": [
        "@updated-team-email@company.com"
      ],
      "visibility": "private",
      "trigger": "incident_modified_trigger"
    },
    "relationships": {
      "incident_type": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "incident_types"
        }
      }
    },
    "id": "00000000-0000-0000-0000-000000000001",
    "type": "incident_notification_rules"
  }
}
EOF
                        
##### 

```go
// Update incident notification rule 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"
	"github.com/google/uuid"
)

func main() {
	// there is a valid "notification_rule" in the system
	NotificationRuleDataID := uuid.MustParse(os.Getenv("NOTIFICATION_RULE_DATA_ID"))

	// there is a valid "incident_type" in the system
	IncidentTypeDataID := os.Getenv("INCIDENT_TYPE_DATA_ID")

	body := datadogV2.PutIncidentNotificationRuleRequest{
		Data: datadogV2.IncidentNotificationRuleUpdateData{
			Attributes: datadogV2.IncidentNotificationRuleCreateAttributes{
				Enabled: datadog.PtrBool(false),
				Conditions: []datadogV2.IncidentNotificationRuleConditionsItems{
					{
						Field: "severity",
						Values: []string{
							"SEV-1",
						},
					},
				},
				Handles: []string{
					"@updated-team-email@company.com",
				},
				Visibility: datadogV2.INCIDENTNOTIFICATIONRULECREATEATTRIBUTESVISIBILITY_PRIVATE.Ptr(),
				Trigger:    "incident_modified_trigger",
			},
			Relationships: &datadogV2.IncidentNotificationRuleCreateDataRelationships{
				IncidentType: &datadogV2.RelationshipToIncidentType{
					Data: datadogV2.RelationshipToIncidentTypeData{
						Id:   IncidentTypeDataID,
						Type: datadogV2.INCIDENTTYPETYPE_INCIDENT_TYPES,
					},
				},
			},
			Id:   NotificationRuleDataID,
			Type: datadogV2.INCIDENTNOTIFICATIONRULETYPE_INCIDENT_NOTIFICATION_RULES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateIncidentNotificationRule", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.UpdateIncidentNotificationRule(ctx, NotificationRuleDataID, body, *datadogV2.NewUpdateIncidentNotificationRuleOptionalParameters())

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

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

#### Instructions

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

```java
// Update incident notification rule 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.IncidentNotificationRule;
import com.datadog.api.client.v2.model.IncidentNotificationRuleConditionsItems;
import com.datadog.api.client.v2.model.IncidentNotificationRuleCreateAttributes;
import com.datadog.api.client.v2.model.IncidentNotificationRuleCreateAttributesVisibility;
import com.datadog.api.client.v2.model.IncidentNotificationRuleCreateDataRelationships;
import com.datadog.api.client.v2.model.IncidentNotificationRuleType;
import com.datadog.api.client.v2.model.IncidentNotificationRuleUpdateData;
import com.datadog.api.client.v2.model.IncidentTypeType;
import com.datadog.api.client.v2.model.PutIncidentNotificationRuleRequest;
import com.datadog.api.client.v2.model.RelationshipToIncidentType;
import com.datadog.api.client.v2.model.RelationshipToIncidentTypeData;
import java.util.Collections;
import java.util.UUID;

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

    // there is a valid "notification_rule" in the system
    UUID NOTIFICATION_RULE_DATA_ID = null;
    try {
      NOTIFICATION_RULE_DATA_ID = UUID.fromString(System.getenv("NOTIFICATION_RULE_DATA_ID"));
    } catch (IllegalArgumentException e) {
      System.err.println("Error parsing UUID: " + e.getMessage());
    }

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

    PutIncidentNotificationRuleRequest body =
        new PutIncidentNotificationRuleRequest()
            .data(
                new IncidentNotificationRuleUpdateData()
                    .attributes(
                        new IncidentNotificationRuleCreateAttributes()
                            .enabled(false)
                            .conditions(
                                Collections.singletonList(
                                    new IncidentNotificationRuleConditionsItems()
                                        .field("severity")
                                        .values(Collections.singletonList("SEV-1"))))
                            .handles(Collections.singletonList("@updated-team-email@company.com"))
                            .visibility(IncidentNotificationRuleCreateAttributesVisibility.PRIVATE)
                            .trigger("incident_modified_trigger"))
                    .relationships(
                        new IncidentNotificationRuleCreateDataRelationships()
                            .incidentType(
                                new RelationshipToIncidentType()
                                    .data(
                                        new RelationshipToIncidentTypeData()
                                            .id(INCIDENT_TYPE_DATA_ID)
                                            .type(IncidentTypeType.INCIDENT_TYPES))))
                    .id(NOTIFICATION_RULE_DATA_ID)
                    .type(IncidentNotificationRuleType.INCIDENT_NOTIFICATION_RULES));

    try {
      IncidentNotificationRule result =
          apiInstance.updateIncidentNotificationRule(NOTIFICATION_RULE_DATA_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#updateIncidentNotificationRule");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Update incident notification rule 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_notification_rule_conditions_items import (
    IncidentNotificationRuleConditionsItems,
)
from datadog_api_client.v2.model.incident_notification_rule_create_attributes import (
    IncidentNotificationRuleCreateAttributes,
)
from datadog_api_client.v2.model.incident_notification_rule_create_attributes_visibility import (
    IncidentNotificationRuleCreateAttributesVisibility,
)
from datadog_api_client.v2.model.incident_notification_rule_create_data_relationships import (
    IncidentNotificationRuleCreateDataRelationships,
)
from datadog_api_client.v2.model.incident_notification_rule_type import IncidentNotificationRuleType
from datadog_api_client.v2.model.incident_notification_rule_update_data import IncidentNotificationRuleUpdateData
from datadog_api_client.v2.model.incident_type_type import IncidentTypeType
from datadog_api_client.v2.model.put_incident_notification_rule_request import PutIncidentNotificationRuleRequest
from datadog_api_client.v2.model.relationship_to_incident_type import RelationshipToIncidentType
from datadog_api_client.v2.model.relationship_to_incident_type_data import RelationshipToIncidentTypeData

# there is a valid "notification_rule" in the system
NOTIFICATION_RULE_DATA_ID = environ["NOTIFICATION_RULE_DATA_ID"]

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

body = PutIncidentNotificationRuleRequest(
    data=IncidentNotificationRuleUpdateData(
        attributes=IncidentNotificationRuleCreateAttributes(
            enabled=False,
            conditions=[
                IncidentNotificationRuleConditionsItems(
                    field="severity",
                    values=[
                        "SEV-1",
                    ],
                ),
            ],
            handles=[
                "@updated-team-email@company.com",
            ],
            visibility=IncidentNotificationRuleCreateAttributesVisibility.PRIVATE,
            trigger="incident_modified_trigger",
        ),
        relationships=IncidentNotificationRuleCreateDataRelationships(
            incident_type=RelationshipToIncidentType(
                data=RelationshipToIncidentTypeData(
                    id=INCIDENT_TYPE_DATA_ID,
                    type=IncidentTypeType.INCIDENT_TYPES,
                ),
            ),
        ),
        id=NOTIFICATION_RULE_DATA_ID,
        type=IncidentNotificationRuleType.INCIDENT_NOTIFICATION_RULES,
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_incident_notification_rule"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.update_incident_notification_rule(id=NOTIFICATION_RULE_DATA_ID, body=body)

    print(response)
```

#### Instructions

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

```ruby
# Update incident notification rule returns "OK" response

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

# there is a valid "notification_rule" in the system
NOTIFICATION_RULE_DATA_ID = ENV["NOTIFICATION_RULE_DATA_ID"]

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

body = DatadogAPIClient::V2::PutIncidentNotificationRuleRequest.new({
  data: DatadogAPIClient::V2::IncidentNotificationRuleUpdateData.new({
    attributes: DatadogAPIClient::V2::IncidentNotificationRuleCreateAttributes.new({
      enabled: false,
      conditions: [
        DatadogAPIClient::V2::IncidentNotificationRuleConditionsItems.new({
          field: "severity",
          values: [
            "SEV-1",
          ],
        }),
      ],
      handles: [
        "@updated-team-email@company.com",
      ],
      visibility: DatadogAPIClient::V2::IncidentNotificationRuleCreateAttributesVisibility::PRIVATE,
      trigger: "incident_modified_trigger",
    }),
    relationships: DatadogAPIClient::V2::IncidentNotificationRuleCreateDataRelationships.new({
      incident_type: DatadogAPIClient::V2::RelationshipToIncidentType.new({
        data: DatadogAPIClient::V2::RelationshipToIncidentTypeData.new({
          id: INCIDENT_TYPE_DATA_ID,
          type: DatadogAPIClient::V2::IncidentTypeType::INCIDENT_TYPES,
        }),
      }),
    }),
    id: NOTIFICATION_RULE_DATA_ID,
    type: DatadogAPIClient::V2::IncidentNotificationRuleType::INCIDENT_NOTIFICATION_RULES,
  }),
})
p api_instance.update_incident_notification_rule(NOTIFICATION_RULE_DATA_ID, body)
```

#### Instructions

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

```rust
// Update incident notification rule returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentNotificationRuleOptionalParams;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleConditionsItems;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleCreateAttributes;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleCreateAttributesVisibility;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleCreateDataRelationships;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleType;
use datadog_api_client::datadogV2::model::IncidentNotificationRuleUpdateData;
use datadog_api_client::datadogV2::model::IncidentTypeType;
use datadog_api_client::datadogV2::model::PutIncidentNotificationRuleRequest;
use datadog_api_client::datadogV2::model::RelationshipToIncidentType;
use datadog_api_client::datadogV2::model::RelationshipToIncidentTypeData;

#[tokio::main]
async fn main() {
    // there is a valid "notification_rule" in the system
    let notification_rule_data_id =
        uuid::Uuid::parse_str(&std::env::var("NOTIFICATION_RULE_DATA_ID").unwrap())
            .expect("Invalid UUID");

    // there is a valid "incident_type" in the system
    let incident_type_data_id = std::env::var("INCIDENT_TYPE_DATA_ID").unwrap();
    let body = PutIncidentNotificationRuleRequest::new(
        IncidentNotificationRuleUpdateData::new(
            IncidentNotificationRuleCreateAttributes::new(
                vec![IncidentNotificationRuleConditionsItems::new(
                    "severity".to_string(),
                    vec!["SEV-1".to_string()],
                )],
                vec!["@updated-team-email@company.com".to_string()],
                "incident_modified_trigger".to_string(),
            )
            .enabled(false)
            .visibility(IncidentNotificationRuleCreateAttributesVisibility::PRIVATE),
            notification_rule_data_id.clone(),
            IncidentNotificationRuleType::INCIDENT_NOTIFICATION_RULES,
        )
        .relationships(
            IncidentNotificationRuleCreateDataRelationships::new().incident_type(
                RelationshipToIncidentType::new(RelationshipToIncidentTypeData::new(
                    incident_type_data_id.clone(),
                    IncidentTypeType::INCIDENT_TYPES,
                )),
            ),
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncidentNotificationRule", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident_notification_rule(
            notification_rule_data_id.clone(),
            body,
            UpdateIncidentNotificationRuleOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Update incident notification rule returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateIncidentNotificationRule"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

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

// 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.IncidentsApiUpdateIncidentNotificationRuleRequest = {
  body: {
    data: {
      attributes: {
        enabled: false,
        conditions: [
          {
            field: "severity",
            values: ["SEV-1"],
          },
        ],
        handles: ["@updated-team-email@company.com"],
        visibility: "private",
        trigger: "incident_modified_trigger",
      },
      relationships: {
        incidentType: {
          data: {
            id: INCIDENT_TYPE_DATA_ID,
            type: "incident_types",
          },
        },
      },
      id: NOTIFICATION_RULE_DATA_ID,
      type: "incident_notification_rules",
    },
  },
  id: NOTIFICATION_RULE_DATA_ID,
};

apiInstance
  .updateIncidentNotificationRule(params)
  .then((data: v2.IncidentNotificationRule) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Delete an incident notification rule{% #delete-an-incident-notification-rule %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                         |
| ----------------- | ------------------------------------------------------------------------------------ |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/incidents/config/notification-rules/{id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/incidents/config/notification-rules/{id}      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/incidents/config/notification-rules/{id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/incidents/config/notification-rules/{id} |

### Overview

Deletes a notification rule by its ID. This endpoint requires the `incident_notification_settings_write` permission.

OAuth apps require the `incident_notification_settings_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                 | Type   | Description                      |
| -------------------- | ------ | -------------------------------- |
| id [*required*] | string | The ID of the notification rule. |

#### Query Strings

| Name    | Type   | Description                                                                                                                                          |
| ------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| include | string | Comma-separated list of resources to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type`, `notification_template` |

### 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="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

##### 
                  \# Path parametersexport id="00000000-0000-0000-0000-000000000001"\# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/notification-rules/${id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Delete an incident notification rule returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from uuid import UUID

configuration = Configuration()
configuration.unstable_operations["delete_incident_notification_rule"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    api_instance.delete_incident_notification_rule(
        id=UUID("00000000-0000-0000-0000-000000000001"),
    )
```

#### Instructions

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

```ruby
# Delete an incident notification rule returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.delete_incident_notification_rule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
api_instance.delete_incident_notification_rule("00000000-0000-0000-0000-000000000001")
```

#### Instructions

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

```go
// Delete an incident notification rule returns "No Content" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteIncidentNotificationRule", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	r, err := api.DeleteIncidentNotificationRule(ctx, uuid.MustParse("00000000-0000-0000-0000-000000000001"), *datadogV2.NewDeleteIncidentNotificationRuleOptionalParameters())

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

#### Instructions

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

```java
// Delete an incident notification rule returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;
import java.util.UUID;

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

    try {
      apiInstance.deleteIncidentNotificationRule(
          UUID.fromString("00000000-0000-0000-0000-000000000001"));
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#deleteIncidentNotificationRule");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Delete an incident notification rule returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::DeleteIncidentNotificationRuleOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncidentNotificationRule", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .delete_incident_notification_rule(
            Uuid::parse_str("00000000-0000-0000-0000-000000000001").expect("invalid UUID"),
            DeleteIncidentNotificationRuleOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Delete an incident notification rule returns "No Content" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteIncidentNotificationRule"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiDeleteIncidentNotificationRuleRequest = {
  id: "00000000-0000-0000-0000-000000000001",
};

apiInstance
  .deleteIncidentNotificationRule(params)
  .then((data: any) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## List incident attachments{% #list-incident-attachments %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                 |
| ----------------- | ---------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/attachments |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/attachments |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/{incident_id}/attachments      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/{incident_id}/attachments      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/{incident_id}/attachments     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/attachments |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/attachments |

### Overview

List incident attachments. This endpoint requires the `incident_read` permission.

### Arguments

#### Path Parameters

| Name                          | Type   | Description               |
| ----------------------------- | ------ | ------------------------- |
| incident_id [*required*] | string | The UUID of the incident. |

#### Query Strings

| Name                    | Type   | Description                                                                           |
| ----------------------- | ------ | ------------------------------------------------------------------------------------- |
| filter[attachment_type] | string | Filter attachments by type. Supported values are `1` (`postmortem`) and `2` (`link`). |
| include                 | string | Resource to include in the response. Supported value: `last_modified_by_user`.        |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
A list of incident attachments.

| Parent field          | Field                           | Type            | Description                                                                        |
| --------------------- | ------------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|                       | data [*required*]          | [object]        |
| data                  | attributes [*required*]    | object          | The attachment's attributes.                                                       |
| attributes            | attachment                      | object          | The attachment object.                                                             |
| attachment            | documentUrl                     | string          | The URL of the attachment.                                                         |
| attachment            | title                           | string          | The title of the attachment.                                                       |
| attributes            | attachment_type                 | enum            | The type of the attachment. Allowed enum values: `postmortem,link`                 |
| attributes            | modified                        | date-time       | Timestamp when the attachment was last modified.                                   |
| data                  | id [*required*]            | string          | The unique identifier of the attachment.                                           |
| data                  | relationships [*required*] | object          | The attachment's resource relationships.                                           |
| relationships         | incident                        | object          | Relationship to incident.                                                          |
| incident              | data [*required*]          | object          | Relationship to incident object.                                                   |
| data                  | id [*required*]            | string          | A unique identifier that represents the incident.                                  |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                           |
| 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`                                  |
| data                  | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments` |
|                       | included                        | [ <oneOf>] |
| included              | Option 1                        | object          | User object returned by the API.                                                   |
| Option 1              | attributes                      | object          | Attributes of user object returned by the API.                                     |
| attributes            | email                           | string          | Email of the user.                                                                 |
| attributes            | handle                          | string          | Handle of the user.                                                                |
| attributes            | icon                            | string          | URL of the user's icon.                                                            |
| attributes            | name                            | string          | Name of the user.                                                                  |
| attributes            | uuid                            | string          | UUID of the user.                                                                  |
| Option 1              | id                              | string          | ID of the user.                                                                    |
| Option 1              | type                            | enum            | Users resource type. Allowed enum values: `users`                                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "attachment": {
          "documentUrl": "https://app.datadoghq.com/notebook/123/Postmortem-IR-123",
          "title": "Postmortem IR-123"
        },
        "attachment_type": "postmortem",
        "modified": "2025-01-01T01:01:01.000000001Z"
      },
      "id": "00000000-abcd-0002-0000-000000000000",
      "relationships": {
        "incident": {
          "data": {
            "id": "00000000-0000-0000-1234-000000000000",
            "type": "incidents"
          }
        },
        "last_modified_by_user": {
          "data": {
            "id": "00000000-0000-0000-2345-000000000000",
            "type": "users"
          }
        }
      },
      "type": "incident_attachments"
    }
  ],
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /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="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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/attachments" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
List incident attachments returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

configuration = Configuration()
configuration.unstable_operations["list_incident_attachments"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.list_incident_attachments(
        incident_id="incident_id",
    )

    print(response)
```

#### Instructions

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

```ruby
# List incident attachments returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.list_incident_attachments".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
p api_instance.list_incident_attachments("incident_id")
```

#### Instructions

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

```go
// List incident attachments 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListIncidentAttachments", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.ListIncidentAttachments(ctx, "incident_id", *datadogV2.NewListIncidentAttachmentsOptionalParameters())

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

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

#### Instructions

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

```java
// List incident attachments 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.AttachmentArray;

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

    try {
      AttachmentArray result = apiInstance.listIncidentAttachments("incident_id");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#listIncidentAttachments");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// List incident attachments returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::ListIncidentAttachmentsOptionalParams;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListIncidentAttachments", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .list_incident_attachments(
            "incident_id".to_string(),
            ListIncidentAttachmentsOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * List incident attachments returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listIncidentAttachments"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiListIncidentAttachmentsRequest = {
  incidentId: "incident_id",
};

apiInstance
  .listIncidentAttachments(params)
  .then((data: v2.AttachmentArray) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Create incident attachment{% #create-incident-attachment %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                  |
| ----------------- | ----------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/attachments |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/attachments |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/incidents/{incident_id}/attachments      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/incidents/{incident_id}/attachments      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/incidents/{incident_id}/attachments     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/attachments |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/attachments |

### Overview

Create an incident attachment. This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                          | Type   | Description               |
| ----------------------------- | ------ | ------------------------- |
| incident_id [*required*] | string | The UUID of the incident. |

#### Query Strings

| Name    | Type   | Description                                                                    |
| ------- | ------ | ------------------------------------------------------------------------------ |
| include | string | Resource to include in the response. Supported value: `last_modified_by_user`. |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                  | Type   | Description                                                                        |
| ------------ | ---------------------- | ------ | ---------------------------------------------------------------------------------- |
|              | data                   | object | Attachment data for a create request.                                              |
| data         | attributes             | object | The attributes for creating an attachment.                                         |
| attributes   | attachment             | object | The attachment object for creating an attachment.                                  |
| attachment   | documentUrl            | string | The URL of the attachment.                                                         |
| attachment   | title                  | string | The title of the attachment.                                                       |
| attributes   | attachment_type        | enum   | The type of the attachment. Allowed enum values: `postmortem,link`                 |
| data         | id                     | string |
| data         | type [*required*] | enum   | The incident attachment resource type. Allowed enum values: `incident_attachments` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "attachment": {
        "documentUrl": "https://app.datadoghq.com/notebook/ExampleIncident/Example-Incident",
        "title": "Example-Incident"
      },
      "attachment_type": "postmortem"
    },
    "type": "incident_attachments"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
An attachment response containing the attachment data and related objects.

| Parent field          | Field                           | Type            | Description                                                                        |
| --------------------- | ------------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|                       | data                            | object          | Attachment data from a response.                                                   |
| data                  | attributes [*required*]    | object          | The attachment's attributes.                                                       |
| attributes            | attachment                      | object          | The attachment object.                                                             |
| attachment            | documentUrl                     | string          | The URL of the attachment.                                                         |
| attachment            | title                           | string          | The title of the attachment.                                                       |
| attributes            | attachment_type                 | enum            | The type of the attachment. Allowed enum values: `postmortem,link`                 |
| attributes            | modified                        | date-time       | Timestamp when the attachment was last modified.                                   |
| data                  | id [*required*]            | string          | The unique identifier of the attachment.                                           |
| data                  | relationships [*required*] | object          | The attachment's resource relationships.                                           |
| relationships         | incident                        | object          | Relationship to incident.                                                          |
| incident              | data [*required*]          | object          | Relationship to incident object.                                                   |
| data                  | id [*required*]            | string          | A unique identifier that represents the incident.                                  |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                           |
| 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`                                  |
| data                  | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments` |
|                       | included                        | [ <oneOf>] |
| included              | Option 1                        | object          | User object returned by the API.                                                   |
| Option 1              | attributes                      | object          | Attributes of user object returned by the API.                                     |
| attributes            | email                           | string          | Email of the user.                                                                 |
| attributes            | handle                          | string          | Handle of the user.                                                                |
| attributes            | icon                            | string          | URL of the user's icon.                                                            |
| attributes            | name                            | string          | Name of the user.                                                                  |
| attributes            | uuid                            | string          | UUID of the user.                                                                  |
| Option 1              | id                              | string          | ID of the user.                                                                    |
| Option 1              | type                            | enum            | Users resource type. Allowed enum values: `users`                                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "attachment": {
        "documentUrl": "https://app.datadoghq.com/notebook/123/Postmortem-IR-123",
        "title": "Postmortem IR-123"
      },
      "attachment_type": "postmortem",
      "modified": "2025-01-01T01:01:01.000000001Z"
    },
    "id": "00000000-abcd-0002-0000-000000000000",
    "relationships": {
      "incident": {
        "data": {
          "id": "00000000-0000-0000-1234-000000000000",
          "type": "incidents"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_attachments"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /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="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

##### 
                          \# Path parametersexport incident_id="CHANGE_ME"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/attachments" \
-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": {
      "attachment": {
        "documentUrl": "https://app.datadoghq.com/notebook/ExampleIncident/Example-Incident",
        "title": "Example-Incident"
      },
      "attachment_type": "postmortem"
    },
    "type": "incident_attachments"
  }
}
EOF
                        
##### 

```go
// Create incident attachment returns "Created" 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() {
	body := datadogV2.CreateAttachmentRequest{
		Data: &datadogV2.CreateAttachmentRequestData{
			Attributes: &datadogV2.CreateAttachmentRequestDataAttributes{
				Attachment: &datadogV2.CreateAttachmentRequestDataAttributesAttachment{
					DocumentUrl: datadog.PtrString("https://app.datadoghq.com/notebook/123/Postmortem-IR-123"),
					Title:       datadog.PtrString("Postmortem-IR-123"),
				},
				AttachmentType: datadogV2.ATTACHMENTDATAATTRIBUTESATTACHMENTTYPE_POSTMORTEM.Ptr(),
			},
			Id:   datadog.PtrString("00000000-0000-0000-0000-000000000000"),
			Type: datadogV2.INCIDENTATTACHMENTTYPE_INCIDENT_ATTACHMENTS,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateIncidentAttachment", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.CreateIncidentAttachment(ctx, "incident_id", body, *datadogV2.NewCreateIncidentAttachmentOptionalParameters())

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

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

#### Instructions

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

```java
// Create incident attachment returns "Created" 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.Attachment;
import com.datadog.api.client.v2.model.AttachmentDataAttributesAttachmentType;
import com.datadog.api.client.v2.model.CreateAttachmentRequest;
import com.datadog.api.client.v2.model.CreateAttachmentRequestData;
import com.datadog.api.client.v2.model.CreateAttachmentRequestDataAttributes;
import com.datadog.api.client.v2.model.CreateAttachmentRequestDataAttributesAttachment;
import com.datadog.api.client.v2.model.IncidentAttachmentType;

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

    CreateAttachmentRequest body =
        new CreateAttachmentRequest()
            .data(
                new CreateAttachmentRequestData()
                    .attributes(
                        new CreateAttachmentRequestDataAttributes()
                            .attachment(
                                new CreateAttachmentRequestDataAttributesAttachment()
                                    .documentUrl(
                                        "https://app.datadoghq.com/notebook/123/Postmortem-IR-123")
                                    .title("Postmortem-IR-123"))
                            .attachmentType(AttachmentDataAttributesAttachmentType.POSTMORTEM))
                    .id("00000000-0000-0000-0000-000000000000")
                    .type(IncidentAttachmentType.INCIDENT_ATTACHMENTS));

    try {
      Attachment result = apiInstance.createIncidentAttachment("incident_id", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#createIncidentAttachment");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Create incident attachment returns "Created" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from datadog_api_client.v2.model.attachment_data_attributes_attachment_type import (
    AttachmentDataAttributesAttachmentType,
)
from datadog_api_client.v2.model.create_attachment_request import CreateAttachmentRequest
from datadog_api_client.v2.model.create_attachment_request_data import CreateAttachmentRequestData
from datadog_api_client.v2.model.create_attachment_request_data_attributes import CreateAttachmentRequestDataAttributes
from datadog_api_client.v2.model.create_attachment_request_data_attributes_attachment import (
    CreateAttachmentRequestDataAttributesAttachment,
)
from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType

body = CreateAttachmentRequest(
    data=CreateAttachmentRequestData(
        attributes=CreateAttachmentRequestDataAttributes(
            attachment=CreateAttachmentRequestDataAttributesAttachment(
                document_url="https://app.datadoghq.com/notebook/123/Postmortem-IR-123",
                title="Postmortem-IR-123",
            ),
            attachment_type=AttachmentDataAttributesAttachmentType.POSTMORTEM,
        ),
        id="00000000-0000-0000-0000-000000000000",
        type=IncidentAttachmentType.INCIDENT_ATTACHMENTS,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_incident_attachment"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.create_incident_attachment(incident_id="incident_id", body=body)

    print(response)
```

#### Instructions

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

```ruby
# Create incident attachment returns "Created" response

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

body = DatadogAPIClient::V2::CreateAttachmentRequest.new({
  data: DatadogAPIClient::V2::CreateAttachmentRequestData.new({
    attributes: DatadogAPIClient::V2::CreateAttachmentRequestDataAttributes.new({
      attachment: DatadogAPIClient::V2::CreateAttachmentRequestDataAttributesAttachment.new({
        document_url: "https://app.datadoghq.com/notebook/123/Postmortem-IR-123",
        title: "Postmortem-IR-123",
      }),
      attachment_type: DatadogAPIClient::V2::AttachmentDataAttributesAttachmentType::POSTMORTEM,
    }),
    id: "00000000-0000-0000-0000-000000000000",
    type: DatadogAPIClient::V2::IncidentAttachmentType::INCIDENT_ATTACHMENTS,
  }),
})
p api_instance.create_incident_attachment("incident_id", body)
```

#### Instructions

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

```rust
// Create incident attachment returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::CreateIncidentAttachmentOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::AttachmentDataAttributesAttachmentType;
use datadog_api_client::datadogV2::model::CreateAttachmentRequest;
use datadog_api_client::datadogV2::model::CreateAttachmentRequestData;
use datadog_api_client::datadogV2::model::CreateAttachmentRequestDataAttributes;
use datadog_api_client::datadogV2::model::CreateAttachmentRequestDataAttributesAttachment;
use datadog_api_client::datadogV2::model::IncidentAttachmentType;

#[tokio::main]
async fn main() {
    let body = CreateAttachmentRequest::new().data(
        CreateAttachmentRequestData::new(IncidentAttachmentType::INCIDENT_ATTACHMENTS)
            .attributes(
                CreateAttachmentRequestDataAttributes::new()
                    .attachment(
                        CreateAttachmentRequestDataAttributesAttachment::new()
                            .document_url(
                                "https://app.datadoghq.com/notebook/123/Postmortem-IR-123"
                                    .to_string(),
                            )
                            .title("Postmortem-IR-123".to_string()),
                    )
                    .attachment_type(AttachmentDataAttributesAttachmentType::POSTMORTEM),
            )
            .id("00000000-0000-0000-0000-000000000000".to_string()),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateIncidentAttachment", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .create_incident_attachment(
            "incident_id".to_string(),
            body,
            CreateIncidentAttachmentOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Create incident attachment returns "Created" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentAttachment"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiCreateIncidentAttachmentRequest = {
  body: {
    data: {
      attributes: {
        attachment: {
          documentUrl:
            "https://app.datadoghq.com/notebook/123/Postmortem-IR-123",
          title: "Postmortem-IR-123",
        },
        attachmentType: "postmortem",
      },
      id: "00000000-0000-0000-0000-000000000000",
      type: "incident_attachments",
    },
  },
  incidentId: "incident_id",
};

apiInstance
  .createIncidentAttachment(params)
  .then((data: v2.Attachment) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Delete incident attachment{% #delete-incident-attachment %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                    |
| ----------------- | ----------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/attachments/{attachment_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/attachments/{attachment_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/incidents/{incident_id}/attachments/{attachment_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/incidents/{incident_id}/attachments/{attachment_id}      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/incidents/{incident_id}/attachments/{attachment_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/attachments/{attachment_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/attachments/{attachment_id} |

### Overview

This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                            | Type   | Description               |
| ------------------------------- | ------ | ------------------------- |
| incident_id [*required*]   | string | The UUID of the incident. |
| attachment_id [*required*] | string | The ID of the attachment. |

### 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="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

##### 
                  \# Path parametersexport incident_id="CHANGE_ME"export attachment_id="00000000-0000-0000-0000-000000000001"\# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/attachments/${attachment_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
##### 

```python
"""
Delete incident attachment returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi

configuration = Configuration()
configuration.unstable_operations["delete_incident_attachment"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    api_instance.delete_incident_attachment(
        incident_id="incident_id",
        attachment_id="00000000-0000-0000-0000-000000000002",
    )
```

#### Instructions

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

```ruby
# Delete incident attachment returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.delete_incident_attachment".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new
api_instance.delete_incident_attachment("incident_id", "00000000-0000-0000-0000-000000000002")
```

#### Instructions

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

```go
// Delete incident attachment returns "No Content" response

package main

import (
	"context"
	"fmt"
	"os"

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

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteIncidentAttachment", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	r, err := api.DeleteIncidentAttachment(ctx, "incident_id", "00000000-0000-0000-0000-000000000002")

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

#### Instructions

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

```java
// Delete incident attachment returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.IncidentsApi;

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

    try {
      apiInstance.deleteIncidentAttachment("incident_id", "00000000-0000-0000-0000-000000000002");
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#deleteIncidentAttachment");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Delete incident attachment returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use serde_json::Value;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteIncidentAttachment", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .delete_incident_attachment(
            "incident_id".to_string(),
            Value::from("00000000-0000-0000-0000-000000000002"),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Delete incident attachment returns "No Content" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteIncidentAttachment"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiDeleteIncidentAttachmentRequest = {
  incidentId: "incident_id",
  attachmentId: "00000000-0000-0000-0000-000000000002",
};

apiInstance
  .deleteIncidentAttachment(params)
  .then((data: any) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Update incident attachment{% #update-incident-attachment %}

{% tab title="v2" %}
**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                                   |
| ----------------- | ---------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/incidents/{incident_id}/attachments/{attachment_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/incidents/{incident_id}/attachments/{attachment_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/incidents/{incident_id}/attachments/{attachment_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/incidents/{incident_id}/attachments/{attachment_id}      |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/incidents/{incident_id}/attachments/{attachment_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/incidents/{incident_id}/attachments/{attachment_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/incidents/{incident_id}/attachments/{attachment_id} |

### Overview

This endpoint requires the `incident_write` permission.

OAuth apps require the `incident_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes/#incidents) to access this endpoint.



### Arguments

#### Path Parameters

| Name                            | Type   | Description               |
| ------------------------------- | ------ | ------------------------- |
| incident_id [*required*]   | string | The UUID of the incident. |
| attachment_id [*required*] | string | The ID of the attachment. |

#### Query Strings

| Name    | Type   | Description                                                                    |
| ------- | ------ | ------------------------------------------------------------------------------ |
| include | string | Resource to include in the response. Supported value: `last_modified_by_user`. |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                  | Type   | Description                                                                        |
| ------------ | ---------------------- | ------ | ---------------------------------------------------------------------------------- |
|              | data                   | object | Attachment data for an update request.                                             |
| data         | attributes             | object | The attributes for updating an attachment.                                         |
| attributes   | attachment             | object | The updated attachment object.                                                     |
| attachment   | documentUrl            | string | The updated URL for the attachment.                                                |
| attachment   | title                  | string | The updated title for the attachment.                                              |
| data         | id                     | string | The unique identifier of the attachment.                                           |
| data         | type [*required*] | enum   | The incident attachment resource type. Allowed enum values: `incident_attachments` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "attachment": {
        "documentUrl": "https://app.datadoghq.com/notebook/124/Example-Incident",
        "title": "Example-Incident"
      }
    },
    "id": "00000000-abcd-0002-0000-000000000000",
    "type": "incident_attachments"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
An attachment response containing the attachment data and related objects.

| Parent field          | Field                           | Type            | Description                                                                        |
| --------------------- | ------------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|                       | data                            | object          | Attachment data from a response.                                                   |
| data                  | attributes [*required*]    | object          | The attachment's attributes.                                                       |
| attributes            | attachment                      | object          | The attachment object.                                                             |
| attachment            | documentUrl                     | string          | The URL of the attachment.                                                         |
| attachment            | title                           | string          | The title of the attachment.                                                       |
| attributes            | attachment_type                 | enum            | The type of the attachment. Allowed enum values: `postmortem,link`                 |
| attributes            | modified                        | date-time       | Timestamp when the attachment was last modified.                                   |
| data                  | id [*required*]            | string          | The unique identifier of the attachment.                                           |
| data                  | relationships [*required*] | object          | The attachment's resource relationships.                                           |
| relationships         | incident                        | object          | Relationship to incident.                                                          |
| incident              | data [*required*]          | object          | Relationship to incident object.                                                   |
| data                  | id [*required*]            | string          | A unique identifier that represents the incident.                                  |
| data                  | type [*required*]          | enum            | Incident resource type. Allowed enum values: `incidents`                           |
| 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`                                  |
| data                  | type [*required*]          | enum            | The incident attachment resource type. Allowed enum values: `incident_attachments` |
|                       | included                        | [ <oneOf>] |
| included              | Option 1                        | object          | User object returned by the API.                                                   |
| Option 1              | attributes                      | object          | Attributes of user object returned by the API.                                     |
| attributes            | email                           | string          | Email of the user.                                                                 |
| attributes            | handle                          | string          | Handle of the user.                                                                |
| attributes            | icon                            | string          | URL of the user's icon.                                                            |
| attributes            | name                            | string          | Name of the user.                                                                  |
| attributes            | uuid                            | string          | UUID of the user.                                                                  |
| Option 1              | id                              | string          | ID of the user.                                                                    |
| Option 1              | type                            | enum            | Users resource type. Allowed enum values: `users`                                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "attachment": {
        "documentUrl": "https://app.datadoghq.com/notebook/123/Postmortem-IR-123",
        "title": "Postmortem IR-123"
      },
      "attachment_type": "postmortem",
      "modified": "2025-01-01T01:01:01.000000001Z"
    },
    "id": "00000000-abcd-0002-0000-000000000000",
    "relationships": {
      "incident": {
        "data": {
          "id": "00000000-0000-0000-1234-000000000000",
          "type": "incidents"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "00000000-0000-0000-2345-000000000000",
          "type": "users"
        }
      }
    },
    "type": "incident_attachments"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /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="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

##### 
                          \# Path parametersexport incident_id="CHANGE_ME"export attachment_id="00000000-0000-0000-0000-000000000001"\# Curl commandcurl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/${incident_id}/attachments/${attachment_id}" \
-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": {
      "attachment": {
        "documentUrl": "https://app.datadoghq.com/notebook/124/Example-Incident",
        "title": "Example-Incident"
      }
    },
    "id": "00000000-abcd-0002-0000-000000000000",
    "type": "incident_attachments"
  }
}
EOF
                        
##### 

```go
// Update incident attachment 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() {
	body := datadogV2.PatchAttachmentRequest{
		Data: &datadogV2.PatchAttachmentRequestData{
			Attributes: &datadogV2.PatchAttachmentRequestDataAttributes{
				Attachment: &datadogV2.PatchAttachmentRequestDataAttributesAttachment{
					DocumentUrl: datadog.PtrString("https://app.datadoghq.com/notebook/124/Postmortem-IR-124"),
					Title:       datadog.PtrString("Postmortem-IR-124"),
				},
			},
			Type: datadogV2.INCIDENTATTACHMENTTYPE_INCIDENT_ATTACHMENTS,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateIncidentAttachment", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.UpdateIncidentAttachment(ctx, "incident_id", "00000000-0000-0000-0000-000000000002", body, *datadogV2.NewUpdateIncidentAttachmentOptionalParameters())

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

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

#### Instructions

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

```java
// Update incident attachment 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.Attachment;
import com.datadog.api.client.v2.model.IncidentAttachmentType;
import com.datadog.api.client.v2.model.PatchAttachmentRequest;
import com.datadog.api.client.v2.model.PatchAttachmentRequestData;
import com.datadog.api.client.v2.model.PatchAttachmentRequestDataAttributes;
import com.datadog.api.client.v2.model.PatchAttachmentRequestDataAttributesAttachment;

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

    PatchAttachmentRequest body =
        new PatchAttachmentRequest()
            .data(
                new PatchAttachmentRequestData()
                    .attributes(
                        new PatchAttachmentRequestDataAttributes()
                            .attachment(
                                new PatchAttachmentRequestDataAttributesAttachment()
                                    .documentUrl(
                                        "https://app.datadoghq.com/notebook/124/Postmortem-IR-124")
                                    .title("Postmortem-IR-124")))
                    .type(IncidentAttachmentType.INCIDENT_ATTACHMENTS));

    try {
      Attachment result =
          apiInstance.updateIncidentAttachment(
              "incident_id", "00000000-0000-0000-0000-000000000002", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling IncidentsApi#updateIncidentAttachment");
      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/?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
"""
Update incident attachment returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.incidents_api import IncidentsApi
from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType
from datadog_api_client.v2.model.patch_attachment_request import PatchAttachmentRequest
from datadog_api_client.v2.model.patch_attachment_request_data import PatchAttachmentRequestData
from datadog_api_client.v2.model.patch_attachment_request_data_attributes import PatchAttachmentRequestDataAttributes
from datadog_api_client.v2.model.patch_attachment_request_data_attributes_attachment import (
    PatchAttachmentRequestDataAttributesAttachment,
)

body = PatchAttachmentRequest(
    data=PatchAttachmentRequestData(
        attributes=PatchAttachmentRequestDataAttributes(
            attachment=PatchAttachmentRequestDataAttributesAttachment(
                document_url="https://app.datadoghq.com/notebook/124/Postmortem-IR-124",
                title="Postmortem-IR-124",
            ),
        ),
        type=IncidentAttachmentType.INCIDENT_ATTACHMENTS,
    ),
)

configuration = Configuration()
configuration.unstable_operations["update_incident_attachment"] = True
with ApiClient(configuration) as api_client:
    api_instance = IncidentsApi(api_client)
    response = api_instance.update_incident_attachment(
        incident_id="incident_id", attachment_id="00000000-0000-0000-0000-000000000002", body=body
    )

    print(response)
```

#### Instructions

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

```ruby
# Update incident attachment returns "OK" response

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

body = DatadogAPIClient::V2::PatchAttachmentRequest.new({
  data: DatadogAPIClient::V2::PatchAttachmentRequestData.new({
    attributes: DatadogAPIClient::V2::PatchAttachmentRequestDataAttributes.new({
      attachment: DatadogAPIClient::V2::PatchAttachmentRequestDataAttributesAttachment.new({
        document_url: "https://app.datadoghq.com/notebook/124/Postmortem-IR-124",
        title: "Postmortem-IR-124",
      }),
    }),
    type: DatadogAPIClient::V2::IncidentAttachmentType::INCIDENT_ATTACHMENTS,
  }),
})
p api_instance.update_incident_attachment("incident_id", "00000000-0000-0000-0000-000000000002", body)
```

#### Instructions

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

```rust
// Update incident attachment returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::api_incidents::UpdateIncidentAttachmentOptionalParams;
use datadog_api_client::datadogV2::model::IncidentAttachmentType;
use datadog_api_client::datadogV2::model::PatchAttachmentRequest;
use datadog_api_client::datadogV2::model::PatchAttachmentRequestData;
use datadog_api_client::datadogV2::model::PatchAttachmentRequestDataAttributes;
use datadog_api_client::datadogV2::model::PatchAttachmentRequestDataAttributesAttachment;
use serde_json::Value;

#[tokio::main]
async fn main() {
    let body = PatchAttachmentRequest::new().data(
        PatchAttachmentRequestData::new(IncidentAttachmentType::INCIDENT_ATTACHMENTS).attributes(
            PatchAttachmentRequestDataAttributes::new().attachment(
                PatchAttachmentRequestDataAttributesAttachment::new()
                    .document_url(
                        "https://app.datadoghq.com/notebook/124/Postmortem-IR-124".to_string(),
                    )
                    .title("Postmortem-IR-124".to_string()),
            ),
        ),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateIncidentAttachment", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .update_incident_attachment(
            "incident_id".to_string(),
            Value::from("00000000-0000-0000-0000-000000000002"),
            body,
            UpdateIncidentAttachmentOptionalParams::default(),
        )
        .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/?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Update incident attachment returns "OK" response
 */

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

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateIncidentAttachment"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiUpdateIncidentAttachmentRequest = {
  body: {
    data: {
      attributes: {
        attachment: {
          documentUrl:
            "https://app.datadoghq.com/notebook/124/Postmortem-IR-124",
          title: "Postmortem-IR-124",
        },
      },
      type: "incident_attachments",
    },
  },
  incidentId: "incident_id",
  attachmentId: "00000000-0000-0000-0000-000000000002",
};

apiInstance
  .updateIncidentAttachment(params)
  .then((data: v2.Attachment) => {
    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/?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

## Get global incident settings{% #get-global-incident-settings %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                              |
| ----------------- | ------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/config/global/settings |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/config/global/settings |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/config/global/settings      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/config/global/settings      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/config/global/settings     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/config/global/settings |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/config/global/settings |

### Overview

Retrieve global incident settings for the organization.

### Response

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

| Parent field | Field                                    | Type      | Description                                                                             |
| ------------ | ---------------------------------------- | --------- | --------------------------------------------------------------------------------------- |
|              | data [*required*]                   | object    |
| data         | attributes [*required*]             | object    | Global incident settings attributes                                                     |
| attributes   | analytics_dashboard_id [*required*] | string    | The analytics dashboard ID                                                              |
| attributes   | created [*required*]                | date-time | Timestamp when the settings were created                                                |
| attributes   | modified [*required*]               | date-time | Timestamp when the settings were last modified                                          |
| data         | id [*required*]                     | string    | The unique identifier for the global incident settings                                  |
| data         | type [*required*]                   | enum      | Global incident settings resource type Allowed enum values: `incidents_global_settings` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "analytics_dashboard_id": "abc-123-def",
      "created": "2026-01-13T17:15:56.557278191Z",
      "modified": "2026-01-13T17:15:56.557278191Z"
    },
    "id": "f8b9a915-ed85-48b4-9071-ceba567a3db5",
    "type": "incidents_global_settings"
  }
}
```

{% /tab %}

{% /tab %}

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

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "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

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/global/settings" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Update global incident settings{% #update-global-incident-settings %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                |
| ----------------- | --------------------------------------------------------------------------- |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/incidents/config/global/settings |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/incidents/config/global/settings |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/incidents/config/global/settings      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/incidents/config/global/settings      |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/incidents/config/global/settings     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/incidents/config/global/settings |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/incidents/config/global/settings |

### Overview

Update global incident settings for the organization.

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                  | Type   | Description                                                                             |
| ------------ | ---------------------- | ------ | --------------------------------------------------------------------------------------- |
|              | data [*required*] | object |
| data         | attributes             | object | Global incident settings attributes                                                     |
| attributes   | analytics_dashboard_id | string | The analytics dashboard ID                                                              |
| data         | type [*required*] | enum   | Global incident settings resource type Allowed enum values: `incidents_global_settings` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "analytics_dashboard_id": "abc-123-def"
    },
    "type": "incidents_global_settings"
  }
}
```

{% /tab %}

### Response

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

| Parent field | Field                                    | Type      | Description                                                                             |
| ------------ | ---------------------------------------- | --------- | --------------------------------------------------------------------------------------- |
|              | data [*required*]                   | object    |
| data         | attributes [*required*]             | object    | Global incident settings attributes                                                     |
| attributes   | analytics_dashboard_id [*required*] | string    | The analytics dashboard ID                                                              |
| attributes   | created [*required*]                | date-time | Timestamp when the settings were created                                                |
| attributes   | modified [*required*]               | date-time | Timestamp when the settings were last modified                                          |
| data         | id [*required*]                     | string    | The unique identifier for the global incident settings                                  |
| data         | type [*required*]                   | enum      | Global incident settings resource type Allowed enum values: `incidents_global_settings` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "analytics_dashboard_id": "abc-123-def",
      "created": "2026-01-13T17:15:56.557278191Z",
      "modified": "2026-01-13T17:15:56.557278191Z"
    },
    "id": "f8b9a915-ed85-48b4-9071-ceba567a3db5",
    "type": "incidents_global_settings"
  }
}
```

{% /tab %}

{% /tab %}

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

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "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

##### 
                  \# Curl commandcurl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/global/settings" \
-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": {
    "type": "incidents_global_settings"
  }
}
EOF
                
{% /tab %}

## List global incident handles{% #list-global-incident-handles %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                      |
| ----------------- | --------------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/incidents/config/global/incident-handles      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/incidents/config/global/incident-handles      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/incidents/config/global/incident-handles     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/incidents/config/global/incident-handles |

### Overview

Retrieve a list of global incident handles.

### Arguments

#### Query Strings

| Name    | Type   | Description                                                          |
| ------- | ------ | -------------------------------------------------------------------- |
| include | string | Comma-separated list of related resources to include in the response |

### Response

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

| Parent field                  | Field                                   | Type            | Description                                                                                                                                 |
| ----------------------------- | --------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]                  | [object]        |
| data                          | attributes [*required*]            | object          | Incident handle attributes for responses                                                                                                    |
| attributes                    | created_at [*required*]            | date-time       | Timestamp when the handle was created                                                                                                       |
| attributes                    | fields [*required*]                | object          | Dynamic fields associated with the handle                                                                                                   |
| fields                        | severity                                | [string]        | Severity levels associated with the handle                                                                                                  |
| attributes                    | modified_at [*required*]           | date-time       | Timestamp when the handle was last modified                                                                                                 |
| attributes                    | name [*required*]                  | string          | The handle name                                                                                                                             |
| data                          | id [*required*]                    | string          | The ID of the incident handle                                                                                                               |
| data                          | relationships                           | object          |
| relationships                 | commander_user                          | object          |
| commander_user                | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| relationships                 | created_by_user [*required*]       | object          |
| created_by_user               | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| relationships                 | incident_type [*required*]         | object          |
| incident_type                 | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| relationships                 | last_modified_by_user [*required*] | object          |
| last_modified_by_user         | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| data                          | type [*required*]                  | enum            | Incident handle resource type Allowed enum values: `incidents_handles`                                                                      |
|                               | included                                | [ <oneOf>] | Included related resources                                                                                                                  |
| included                      | Option 1                                | object          | User object returned by the API.                                                                                                            |
| Option 1                      | attributes                              | object          | Attributes of user object returned by the API.                                                                                              |
| attributes                    | email                                   | string          | Email of the user.                                                                                                                          |
| attributes                    | handle                                  | string          | Handle of the user.                                                                                                                         |
| attributes                    | icon                                    | string          | URL of the user's icon.                                                                                                                     |
| attributes                    | name                                    | string          | Name of the user.                                                                                                                           |
| attributes                    | uuid                                    | string          | UUID of the user.                                                                                                                           |
| Option 1                      | id                                      | string          | ID of the user.                                                                                                                             |
| Option 1                      | type                                    | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| included                      | Option 2                                | object          | Incident type response data.                                                                                                                |
| Option 2                      | attributes                              | object          | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                               | date-time       | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                               | string          | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                          | string          | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                              | date-time       | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| Option 2                      | id [*required*]                    | string          | The incident type's ID.                                                                                                                     |
| Option 2                      | 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`                                                                                           |
| 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`                                                                                           |
| 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.                                                                                                         |
| Option 2                      | type [*required*]                  | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2026-01-13T17:15:52.726905Z",
        "fields": {
          "severity": [
            "SEV-1"
          ]
        },
        "modified_at": "2026-01-13T17:15:52.726905Z",
        "name": "@incident-sev-1"
      },
      "id": "12ceee6d-a7c0-4407-bc54-30e54140d7f0",
      "relationships": {
        "commander_user": {
          "data": {
            "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
            "type": "incident_types"
          }
        },
        "created_by_user": {
          "data": {
            "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
            "type": "incident_types"
          }
        },
        "incident_type": {
          "data": {
            "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
            "type": "incident_types"
          }
        },
        "last_modified_by_user": {
          "data": {
            "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
            "type": "incident_types"
          }
        }
      },
      "type": "incidents_handles"
    }
  ],
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /tab %}

{% /tab %}

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

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "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

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/global/incident-handles" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Create global incident handle{% #create-global-incident-handle %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                       |
| ----------------- | ---------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/incidents/config/global/incident-handles      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/incidents/config/global/incident-handles      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/incidents/config/global/incident-handles     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/incidents/config/global/incident-handles |

### Overview

Create a new global incident handle.

### Arguments

#### Query Strings

| Name    | Type   | Description                                                          |
| ------- | ------ | -------------------------------------------------------------------- |
| include | string | Comma-separated list of related resources to include in the response |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field   | Field                           | Type     | Description                                                            |
| -------------- | ------------------------------- | -------- | ---------------------------------------------------------------------- |
|                | data [*required*]          | object   |
| data           | attributes [*required*]    | object   | Incident handle attributes for requests                                |
| attributes     | fields                          | object   | Dynamic fields associated with the handle                              |
| fields         | severity                        | [string] | Severity levels associated with the handle                             |
| attributes     | name [*required*]          | string   | The handle name                                                        |
| data           | id                              | string   | The ID of the incident handle (required for PUT requests)              |
| data           | relationships                   | object   |
| relationships  | commander_user                  | object   |
| commander_user | data [*required*]          | object   |
| data           | id [*required*]            | string   | The ID of the related resource                                         |
| data           | type [*required*]          | string   | The type of the related resource                                       |
| relationships  | incident_type [*required*] | object   |
| incident_type  | data [*required*]          | object   |
| data           | id [*required*]            | string   | The ID of the related resource                                         |
| data           | type [*required*]          | string   | The type of the related resource                                       |
| data           | type [*required*]          | enum     | Incident handle resource type Allowed enum values: `incidents_handles` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "fields": {
        "severity": [
          "SEV-1"
        ]
      },
      "name": "@incident-sev-1"
    },
    "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
    "relationships": {
      "commander_user": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      },
      "incident_type": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      }
    },
    "type": "incidents_handles"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}

| Parent field                  | Field                                   | Type            | Description                                                                                                                                 |
| ----------------------------- | --------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]                  | object          |
| data                          | attributes [*required*]            | object          | Incident handle attributes for responses                                                                                                    |
| attributes                    | created_at [*required*]            | date-time       | Timestamp when the handle was created                                                                                                       |
| attributes                    | fields [*required*]                | object          | Dynamic fields associated with the handle                                                                                                   |
| fields                        | severity                                | [string]        | Severity levels associated with the handle                                                                                                  |
| attributes                    | modified_at [*required*]           | date-time       | Timestamp when the handle was last modified                                                                                                 |
| attributes                    | name [*required*]                  | string          | The handle name                                                                                                                             |
| data                          | id [*required*]                    | string          | The ID of the incident handle                                                                                                               |
| data                          | relationships                           | object          |
| relationships                 | commander_user                          | object          |
| commander_user                | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| relationships                 | created_by_user [*required*]       | object          |
| created_by_user               | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| relationships                 | incident_type [*required*]         | object          |
| incident_type                 | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| relationships                 | last_modified_by_user [*required*] | object          |
| last_modified_by_user         | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| data                          | type [*required*]                  | enum            | Incident handle resource type Allowed enum values: `incidents_handles`                                                                      |
|                               | included                                | [ <oneOf>] | Included related resources                                                                                                                  |
| included                      | Option 1                                | object          | User object returned by the API.                                                                                                            |
| Option 1                      | attributes                              | object          | Attributes of user object returned by the API.                                                                                              |
| attributes                    | email                                   | string          | Email of the user.                                                                                                                          |
| attributes                    | handle                                  | string          | Handle of the user.                                                                                                                         |
| attributes                    | icon                                    | string          | URL of the user's icon.                                                                                                                     |
| attributes                    | name                                    | string          | Name of the user.                                                                                                                           |
| attributes                    | uuid                                    | string          | UUID of the user.                                                                                                                           |
| Option 1                      | id                                      | string          | ID of the user.                                                                                                                             |
| Option 1                      | type                                    | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| included                      | Option 2                                | object          | Incident type response data.                                                                                                                |
| Option 2                      | attributes                              | object          | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                               | date-time       | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                               | string          | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                          | string          | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                              | date-time       | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| Option 2                      | id [*required*]                    | string          | The incident type's ID.                                                                                                                     |
| Option 2                      | 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`                                                                                           |
| 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`                                                                                           |
| 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.                                                                                                         |
| Option 2                      | type [*required*]                  | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2026-01-13T17:15:52.726905Z",
      "fields": {
        "severity": [
          "SEV-1"
        ]
      },
      "modified_at": "2026-01-13T17:15:52.726905Z",
      "name": "@incident-sev-1"
    },
    "id": "12ceee6d-a7c0-4407-bc54-30e54140d7f0",
    "relationships": {
      "commander_user": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      },
      "created_by_user": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      },
      "incident_type": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      }
    },
    "type": "incidents_handles"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /tab %}

{% /tab %}

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

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "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

##### 
                  \# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/global/incident-handles" \
-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": {
      "name": "@incident-sev-1"
    },
    "relationships": {
      "commander_user": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      },
      "incident_type": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      }
    },
    "type": "incidents_handles"
  }
}
EOF
                
{% /tab %}

## Update global incident handle{% #update-global-incident-handle %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                      |
| ----------------- | --------------------------------------------------------------------------------- |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v2/incidents/config/global/incident-handles      |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v2/incidents/config/global/incident-handles      |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v2/incidents/config/global/incident-handles     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v2/incidents/config/global/incident-handles |

### Overview

Update an existing global incident handle.

### Arguments

#### Query Strings

| Name    | Type   | Description                                                          |
| ------- | ------ | -------------------------------------------------------------------- |
| include | string | Comma-separated list of related resources to include in the response |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field   | Field                           | Type     | Description                                                            |
| -------------- | ------------------------------- | -------- | ---------------------------------------------------------------------- |
|                | data [*required*]          | object   |
| data           | attributes [*required*]    | object   | Incident handle attributes for requests                                |
| attributes     | fields                          | object   | Dynamic fields associated with the handle                              |
| fields         | severity                        | [string] | Severity levels associated with the handle                             |
| attributes     | name [*required*]          | string   | The handle name                                                        |
| data           | id                              | string   | The ID of the incident handle (required for PUT requests)              |
| data           | relationships                   | object   |
| relationships  | commander_user                  | object   |
| commander_user | data [*required*]          | object   |
| data           | id [*required*]            | string   | The ID of the related resource                                         |
| data           | type [*required*]          | string   | The type of the related resource                                       |
| relationships  | incident_type [*required*] | object   |
| incident_type  | data [*required*]          | object   |
| data           | id [*required*]            | string   | The ID of the related resource                                         |
| data           | type [*required*]          | string   | The type of the related resource                                       |
| data           | type [*required*]          | enum     | Incident handle resource type Allowed enum values: `incidents_handles` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "fields": {
        "severity": [
          "SEV-1"
        ]
      },
      "name": "@incident-sev-1"
    },
    "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
    "relationships": {
      "commander_user": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      },
      "incident_type": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      }
    },
    "type": "incidents_handles"
  }
}
```

{% /tab %}

### Response

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

| Parent field                  | Field                                   | Type            | Description                                                                                                                                 |
| ----------------------------- | --------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]                  | object          |
| data                          | attributes [*required*]            | object          | Incident handle attributes for responses                                                                                                    |
| attributes                    | created_at [*required*]            | date-time       | Timestamp when the handle was created                                                                                                       |
| attributes                    | fields [*required*]                | object          | Dynamic fields associated with the handle                                                                                                   |
| fields                        | severity                                | [string]        | Severity levels associated with the handle                                                                                                  |
| attributes                    | modified_at [*required*]           | date-time       | Timestamp when the handle was last modified                                                                                                 |
| attributes                    | name [*required*]                  | string          | The handle name                                                                                                                             |
| data                          | id [*required*]                    | string          | The ID of the incident handle                                                                                                               |
| data                          | relationships                           | object          |
| relationships                 | commander_user                          | object          |
| commander_user                | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| relationships                 | created_by_user [*required*]       | object          |
| created_by_user               | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| relationships                 | incident_type [*required*]         | object          |
| incident_type                 | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| relationships                 | last_modified_by_user [*required*] | object          |
| last_modified_by_user         | data [*required*]                  | object          |
| data                          | id [*required*]                    | string          | The ID of the related resource                                                                                                              |
| data                          | type [*required*]                  | string          | The type of the related resource                                                                                                            |
| data                          | type [*required*]                  | enum            | Incident handle resource type Allowed enum values: `incidents_handles`                                                                      |
|                               | included                                | [ <oneOf>] | Included related resources                                                                                                                  |
| included                      | Option 1                                | object          | User object returned by the API.                                                                                                            |
| Option 1                      | attributes                              | object          | Attributes of user object returned by the API.                                                                                              |
| attributes                    | email                                   | string          | Email of the user.                                                                                                                          |
| attributes                    | handle                                  | string          | Handle of the user.                                                                                                                         |
| attributes                    | icon                                    | string          | URL of the user's icon.                                                                                                                     |
| attributes                    | name                                    | string          | Name of the user.                                                                                                                           |
| attributes                    | uuid                                    | string          | UUID of the user.                                                                                                                           |
| Option 1                      | id                                      | string          | ID of the user.                                                                                                                             |
| Option 1                      | type                                    | enum            | Users resource type. Allowed enum values: `users`                                                                                           |
| included                      | Option 2                                | object          | Incident type response data.                                                                                                                |
| Option 2                      | attributes                              | object          | Incident type's attributes.                                                                                                                 |
| attributes                    | createdAt                               | date-time       | Timestamp when the incident type was created.                                                                                               |
| attributes                    | createdBy                               | string          | A unique identifier that represents the user that created the incident type.                                                                |
| 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. |
| attributes                    | lastModifiedBy                          | string          | A unique identifier that represents the user that last modified the incident type.                                                          |
| attributes                    | modifiedAt                              | date-time       | Timestamp when the incident type was last modified.                                                                                         |
| 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.                                                             |
| Option 2                      | id [*required*]                    | string          | The incident type's ID.                                                                                                                     |
| Option 2                      | 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`                                                                                           |
| 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`                                                                                           |
| 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.                                                                                                         |
| Option 2                      | type [*required*]                  | enum            | Incident type resource type. Allowed enum values: `incident_types`                                                                          |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2026-01-13T17:15:52.726905Z",
      "fields": {
        "severity": [
          "SEV-1"
        ]
      },
      "modified_at": "2026-01-13T17:15:52.726905Z",
      "name": "@incident-sev-1"
    },
    "id": "12ceee6d-a7c0-4407-bc54-30e54140d7f0",
    "relationships": {
      "commander_user": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      },
      "created_by_user": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      },
      "incident_type": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      }
    },
    "type": "incidents_handles"
  },
  "included": [
    {
      "attributes": {
        "email": "string",
        "handle": "string",
        "icon": "string",
        "name": "string",
        "uuid": "string"
      },
      "id": "string",
      "type": "users"
    }
  ]
}
```

{% /tab %}

{% /tab %}

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

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "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

##### 
                  \# Curl commandcurl -X PUT "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/global/incident-handles" \
-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": {
      "name": "@incident-sev-1"
    },
    "relationships": {
      "commander_user": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      },
      "incident_type": {
        "data": {
          "id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          "type": "incident_types"
        }
      }
    },
    "type": "incidents_handles"
  }
}
EOF
                
{% /tab %}

## Delete global incident handle{% #delete-global-incident-handle %}

{% tab title="v2" %}
**Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                         |
| ----------------- | ------------------------------------------------------------------------------------ |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/incidents/config/global/incident-handles      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/incidents/config/global/incident-handles      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/incidents/config/global/incident-handles     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/incidents/config/global/incident-handles |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/incidents/config/global/incident-handles |

### Overview

Delete a global incident handle.

### Response

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

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

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "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

##### 
                  \# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/incidents/config/global/incident-handles" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}