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

# Create global incident handle{% #create-global-incident-handle %}
Copy pageCopied
{% 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      |
| us2.ddog-gov.com  | POST https://api.us2.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 object representing an incident handle in a create or update request.                    |
| 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 to associate with an incident handle in a create or update request.             |
| relationships  | commander_user                  | object   | A single relationship object for an incident handle, wrapping the related resource data.      |
| commander_user | data [*required*]          | object   | Relationship data for an incident handle, containing the ID and type of the related resource. |
| 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   | A single relationship object for an incident handle, wrapping the related resource data.      |
| incident_type  | data [*required*]          | object   | Relationship data for an incident handle, containing the ID and type of the related resource. |
| 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" %}
Response payload for a single incident handle, including the handle data and related resources.

| Parent field                  | Field                                   | Type            | Description                                                                                                                                 |
| ----------------------------- | --------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|                               | data [*required*]                  | object          | Data object representing an incident handle in a response.                                                                                  |
| 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 associated with an incident handle response, including linked users and incident type.                                        |
| relationships                 | commander_user                          | object          | A single relationship object for an incident handle, wrapping the related resource data.                                                    |
| commander_user                | data [*required*]                  | object          | Relationship data for an incident handle, containing the ID and type of the related resource.                                               |
| 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          | A single relationship object for an incident handle, wrapping the related resource data.                                                    |
| created_by_user               | data [*required*]                  | object          | Relationship data for an incident handle, containing the ID and type of the related resource.                                               |
| 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          | A single relationship object for an incident handle, wrapping the related resource data.                                                    |
| incident_type                 | data [*required*]                  | object          | Relationship data for an incident handle, containing the ID and type of the related resource.                                               |
| 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          | A single relationship object for an incident handle, wrapping the related resource data.                                                    |
| last_modified_by_user         | data [*required*]                  | object          | Relationship data for an incident handle, containing the ID and type of the related resource.                                               |
| 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

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.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": {
      "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"
  }
}
EOF 
                
##### 

```python
"""
Create global incident handle 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_handle_attributes_fields import IncidentHandleAttributesFields
from datadog_api_client.v2.model.incident_handle_attributes_request import IncidentHandleAttributesRequest
from datadog_api_client.v2.model.incident_handle_data_request import IncidentHandleDataRequest
from datadog_api_client.v2.model.incident_handle_relationship import IncidentHandleRelationship
from datadog_api_client.v2.model.incident_handle_relationship_data import IncidentHandleRelationshipData
from datadog_api_client.v2.model.incident_handle_relationships_request import IncidentHandleRelationshipsRequest
from datadog_api_client.v2.model.incident_handle_request import IncidentHandleRequest
from datadog_api_client.v2.model.incident_handle_type import IncidentHandleType

body = IncidentHandleRequest(
    data=IncidentHandleDataRequest(
        attributes=IncidentHandleAttributesRequest(
            fields=IncidentHandleAttributesFields(
                severity=[
                    "SEV-1",
                ],
            ),
            name="@incident-sev-1",
        ),
        id="b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
        relationships=IncidentHandleRelationshipsRequest(
            commander_user=IncidentHandleRelationship(
                data=IncidentHandleRelationshipData(
                    id="f7b538b1-ed7c-4e84-82de-fdf84a539d40",
                    type="incident_types",
                ),
            ),
            incident_type=IncidentHandleRelationship(
                data=IncidentHandleRelationshipData(
                    id="f7b538b1-ed7c-4e84-82de-fdf84a539d40",
                    type="incident_types",
                ),
            ),
        ),
        type=IncidentHandleType.INCIDENTS_HANDLES,
    ),
)

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

    print(response)
```

#### Instructions

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

```ruby
# Create global incident handle returns "Created" response

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

body = DatadogAPIClient::V2::IncidentHandleRequest.new({
  data: DatadogAPIClient::V2::IncidentHandleDataRequest.new({
    attributes: DatadogAPIClient::V2::IncidentHandleAttributesRequest.new({
      fields: DatadogAPIClient::V2::IncidentHandleAttributesFields.new({
        severity: [
          "SEV-1",
        ],
      }),
      name: "@incident-sev-1",
    }),
    id: "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
    relationships: DatadogAPIClient::V2::IncidentHandleRelationshipsRequest.new({
      commander_user: DatadogAPIClient::V2::IncidentHandleRelationship.new({
        data: DatadogAPIClient::V2::IncidentHandleRelationshipData.new({
          id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          type: "incident_types",
        }),
      }),
      incident_type: DatadogAPIClient::V2::IncidentHandleRelationship.new({
        data: DatadogAPIClient::V2::IncidentHandleRelationshipData.new({
          id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
          type: "incident_types",
        }),
      }),
    }),
    type: DatadogAPIClient::V2::IncidentHandleType::INCIDENTS_HANDLES,
  }),
})
p api_instance.create_global_incident_handle(body)
```

#### Instructions

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

```go
// Create global incident handle 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.IncidentHandleRequest{
		Data: datadogV2.IncidentHandleDataRequest{
			Attributes: datadogV2.IncidentHandleAttributesRequest{
				Fields: &datadogV2.IncidentHandleAttributesFields{
					Severity: []string{
						"SEV-1",
					},
				},
				Name: "@incident-sev-1",
			},
			Id: datadog.PtrString("b2494081-cdf0-4205-b366-4e1dd4fdf0bf"),
			Relationships: *datadogV2.NewNullableIncidentHandleRelationshipsRequest(&datadogV2.IncidentHandleRelationshipsRequest{
				CommanderUser: &datadogV2.IncidentHandleRelationship{
					Data: datadogV2.IncidentHandleRelationshipData{
						Id:   "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
						Type: "incident_types",
					},
				},
				IncidentType: datadogV2.IncidentHandleRelationship{
					Data: datadogV2.IncidentHandleRelationshipData{
						Id:   "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
						Type: "incident_types",
					},
				},
			}),
			Type: datadogV2.INCIDENTHANDLETYPE_INCIDENTS_HANDLES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateGlobalIncidentHandle", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewIncidentsApi(apiClient)
	resp, r, err := api.CreateGlobalIncidentHandle(ctx, body, *datadogV2.NewCreateGlobalIncidentHandleOptionalParameters())

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

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

#### Instructions

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

```java
// Create global incident handle 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.IncidentHandleAttributesFields;
import com.datadog.api.client.v2.model.IncidentHandleAttributesRequest;
import com.datadog.api.client.v2.model.IncidentHandleDataRequest;
import com.datadog.api.client.v2.model.IncidentHandleRelationship;
import com.datadog.api.client.v2.model.IncidentHandleRelationshipData;
import com.datadog.api.client.v2.model.IncidentHandleRelationshipsRequest;
import com.datadog.api.client.v2.model.IncidentHandleRequest;
import com.datadog.api.client.v2.model.IncidentHandleResponse;
import com.datadog.api.client.v2.model.IncidentHandleType;
import java.util.Collections;

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

    IncidentHandleRequest body =
        new IncidentHandleRequest()
            .data(
                new IncidentHandleDataRequest()
                    .attributes(
                        new IncidentHandleAttributesRequest()
                            .fields(
                                new IncidentHandleAttributesFields()
                                    .severity(Collections.singletonList("SEV-1")))
                            .name("@incident-sev-1"))
                    .id("b2494081-cdf0-4205-b366-4e1dd4fdf0bf")
                    .relationships(
                        new IncidentHandleRelationshipsRequest()
                            .commanderUser(
                                new IncidentHandleRelationship()
                                    .data(
                                        new IncidentHandleRelationshipData()
                                            .id("f7b538b1-ed7c-4e84-82de-fdf84a539d40")
                                            .type("incident_types")))
                            .incidentType(
                                new IncidentHandleRelationship()
                                    .data(
                                        new IncidentHandleRelationshipData()
                                            .id("f7b538b1-ed7c-4e84-82de-fdf84a539d40")
                                            .type("incident_types"))))
                    .type(IncidentHandleType.INCIDENTS_HANDLES));

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

#### Instructions

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

```rust
// Create global incident handle returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_incidents::CreateGlobalIncidentHandleOptionalParams;
use datadog_api_client::datadogV2::api_incidents::IncidentsAPI;
use datadog_api_client::datadogV2::model::IncidentHandleAttributesFields;
use datadog_api_client::datadogV2::model::IncidentHandleAttributesRequest;
use datadog_api_client::datadogV2::model::IncidentHandleDataRequest;
use datadog_api_client::datadogV2::model::IncidentHandleRelationship;
use datadog_api_client::datadogV2::model::IncidentHandleRelationshipData;
use datadog_api_client::datadogV2::model::IncidentHandleRelationshipsRequest;
use datadog_api_client::datadogV2::model::IncidentHandleRequest;
use datadog_api_client::datadogV2::model::IncidentHandleType;

#[tokio::main]
async fn main() {
    let body = IncidentHandleRequest::new(
        IncidentHandleDataRequest::new(
            IncidentHandleAttributesRequest::new("@incident-sev-1".to_string())
                .fields(IncidentHandleAttributesFields::new().severity(vec!["SEV-1".to_string()])),
            IncidentHandleType::INCIDENTS_HANDLES,
        )
        .id("b2494081-cdf0-4205-b366-4e1dd4fdf0bf".to_string())
        .relationships(Some(
            IncidentHandleRelationshipsRequest::new(IncidentHandleRelationship::new(
                IncidentHandleRelationshipData::new(
                    "f7b538b1-ed7c-4e84-82de-fdf84a539d40".to_string(),
                    "incident_types".to_string(),
                ),
            ))
            .commander_user(IncidentHandleRelationship::new(
                IncidentHandleRelationshipData::new(
                    "f7b538b1-ed7c-4e84-82de-fdf84a539d40".to_string(),
                    "incident_types".to_string(),
                ),
            )),
        )),
    );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateGlobalIncidentHandle", true);
    let api = IncidentsAPI::with_config(configuration);
    let resp = api
        .create_global_incident_handle(body, CreateGlobalIncidentHandleOptionalParams::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.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * Create global incident handle returns "Created" response
 */

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

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

const params: v2.IncidentsApiCreateGlobalIncidentHandleRequest = {
  body: {
    data: {
      attributes: {
        fields: {
          severity: ["SEV-1"],
        },
        name: "@incident-sev-1",
      },
      id: "b2494081-cdf0-4205-b366-4e1dd4fdf0bf",
      relationships: {
        commanderUser: {
          data: {
            id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
            type: "incident_types",
          },
        },
        incidentType: {
          data: {
            id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40",
            type: "incident_types",
          },
        },
      },
      type: "incidents_handles",
    },
  },
};

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

#### Instructions

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