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

# Change Management

View and manage change requests within Change Management. See the [Case Management page](https://docs.datadoghq.com/service_management/case_management.md) for more information.

## Create a change request{% #create-a-change-request %}

{% tab title="v2" %}
**Note**: This endpoint is in preview 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/change-management/change-request |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/change-management/change-request |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/change-management/change-request      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/change-management/change-request      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/change-management/change-request  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/change-management/change-request     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/change-management/change-request |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/change-management/change-request |

### Overview

Create a new change request.

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



### Request

#### Body Data (required)

Change request payload.

{% tab title="Model" %}

| Parent field | Field                                   | Type      | Description                                                                            |
| ------------ | --------------------------------------- | --------- | -------------------------------------------------------------------------------------- |
|              | data [*required*]                  | object    | Data object to create a change request.                                                |
| data         | attributes [*required*]            | object    | Attributes for creating a change request.                                              |
| attributes   | change_request_linked_incident_uuid     | string    | The UUID of an incident to link to the change request.                                 |
| attributes   | change_request_maintenance_window_query | string    | The maintenance window query for the change request.                                   |
| attributes   | change_request_plan                     | string    | The plan associated with the change request.                                           |
| attributes   | change_request_risk                     | enum      | The risk level of the change request. Allowed enum values: `UNDEFINED,LOW,MEDIUM,HIGH` |
| attributes   | change_request_type                     | enum      | The type of the change request. Allowed enum values: `NORMAL,STANDARD,EMERGENCY`       |
| attributes   | description                             | string    | The description of the change request.                                                 |
| attributes   | end_date                                | date-time | The planned end date of the change request.                                            |
| attributes   | project_id                              | string    | The project UUID to associate with the change request.                                 |
| attributes   | requested_teams                         | [string]  | A list of team handles to request decisions from.                                      |
| attributes   | start_date                              | date-time | The planned start date of the change request.                                          |
| attributes   | title [*required*]                 | string    | The title of the change request.                                                       |
| data         | type [*required*]                  | enum      | Change request resource type. Allowed enum values: `change_request`                    |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "change_request_linked_incident_uuid": "00000000-0000-0000-0000-000000000000",
      "change_request_maintenance_window_query": "",
      "change_request_plan": "1. Deploy to staging 2. Run tests 3. Deploy to production",
      "change_request_risk": "LOW",
      "change_request_type": "NORMAL",
      "description": "Deploying new payment service v2.1",
      "end_date": "2024-01-02T15:00:00Z",
      "project_id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
      "requested_teams": [
        "team-handle-1"
      ],
      "start_date": "2024-01-01T03:00:00Z",
      "title": "Deploy new payment service"
    },
    "type": "change_request"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response object for a change request.

| Parent field             | Field                                                     | Type            | Description                                                                                 |
| ------------------------ | --------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------- |
|                          | data [*required*]                                    | object          | Data object for a change request response.                                                  |
| data                     | attributes [*required*]                              | object          | Attributes of a change request response.                                                    |
| attributes               | archived_at                                               | date-time       | Timestamp of when the change request was archived.                                          |
| attributes               | attributes [*required*]                              | object          | Custom attributes of the change request as key-value pairs.                                 |
| additionalProperties     | <any-key>                                                 | [string]        |
| attributes               | change_request_linked_incident_uuid [*required*]     | string          | The UUID of the linked incident.                                                            |
| attributes               | change_request_maintenance_window_query [*required*] | string          | The maintenance window query for the change request.                                        |
| attributes               | change_request_plan [*required*]                     | string          | The plan associated with the change request.                                                |
| attributes               | change_request_risk [*required*]                     | enum            | The risk level of the change request. Allowed enum values: `UNDEFINED,LOW,MEDIUM,HIGH`      |
| attributes               | change_request_type [*required*]                     | enum            | The type of the change request. Allowed enum values: `NORMAL,STANDARD,EMERGENCY`            |
| attributes               | closed_at                                                 | date-time       | Timestamp of when the change request was closed.                                            |
| attributes               | created_at [*required*]                              | date-time       | Timestamp of when the change request was created.                                           |
| attributes               | creation_source [*required*]                         | string          | The source from which the change request was created.                                       |
| attributes               | description [*required*]                             | string          | The description of the change request.                                                      |
| attributes               | end_date                                                  | date-time       | The planned end date of the change request.                                                 |
| attributes               | key [*required*]                                     | string          | The human-readable key of the change request.                                               |
| attributes               | modified_at [*required*]                             | date-time       | Timestamp of when the change request was last modified.                                     |
| attributes               | plan_notebook_id [*required*]                        | int64           | The notebook ID associated with the change request plan.                                    |
| attributes               | priority [*required*]                                | string          | The priority of the change request.                                                         |
| attributes               | project_id [*required*]                              | string          | The project UUID associated with the change request.                                        |
| attributes               | start_date                                                | date-time       | The planned start date of the change request.                                               |
| attributes               | status [*required*]                                  | string          | The current status of the change request.                                                   |
| attributes               | title [*required*]                                   | string          | The title of the change request.                                                            |
| attributes               | type [*required*]                                    | string          | The case type.                                                                              |
| data                     | id [*required*]                                      | string          | The identifier of the change request.                                                       |
| data                     | relationships                                             | object          | Relationships of a change request.                                                          |
| relationships            | change_request_decisions [*required*]                | object          | Relationship to change request decisions.                                                   |
| change_request_decisions | data [*required*]                                    | [object]        | Array of decision relationship data.                                                        |
| data                     | id [*required*]                                      | string          | The decision UUID.                                                                          |
| data                     | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |
| relationships            | created_by [*required*]                              | object          | Relationship to a user.                                                                     |
| created_by               | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| data                     | type [*required*]                                    | enum            | Change request resource type. Allowed enum values: `change_request`                         |
|                          | included                                                  | [ <oneOf>] | Included resources related to the change request.                                           |
| included                 | Option 1                                                  | object          | An included user resource.                                                                  |
| Option 1                 | attributes [*required*]                              | object          | Attributes of an included user.                                                             |
| attributes               | email [*required*]                                   | string          | The email of the user.                                                                      |
| attributes               | handle [*required*]                                  | string          | The handle of the user.                                                                     |
| attributes               | name [*required*]                                    | string          | The name of the user.                                                                       |
| Option 1                 | id [*required*]                                      | string          | The user UUID.                                                                              |
| Option 1                 | type [*required*]                                    | string          | The resource type.                                                                          |
| included                 | Option 2                                                  | object          | An included change request decision resource.                                               |
| Option 2                 | attributes [*required*]                              | object          | Attributes of a change request decision in a response.                                      |
| attributes               | change_request_status [*required*]                   | enum            | The status of a change request decision. Allowed enum values: `REQUESTED,APPROVED,DECLINED` |
| attributes               | decided_at [*required*]                              | date-time       | Timestamp of when the decision was made.                                                    |
| attributes               | decision_reason [*required*]                         | string          | The reason for the decision.                                                                |
| attributes               | deleted_at [*required*]                              | date-time       | Timestamp of when the decision was deleted.                                                 |
| attributes               | request_reason [*required*]                          | string          | The reason for requesting the decision.                                                     |
| attributes               | requested_at [*required*]                            | date-time       | Timestamp of when the decision was requested.                                               |
| Option 2                 | id [*required*]                                      | string          | The decision UUID.                                                                          |
| Option 2                 | relationships                                             | object          | Relationships of a change request decision.                                                 |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_by_user [*required*]                       | object          | Relationship to a user.                                                                     |
| requested_by_user        | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_user [*required*]                          | object          | Relationship to a user.                                                                     |
| requested_user           | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| Option 2                 | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "change_request_linked_incident_uuid": "",
      "change_request_maintenance_window_query": "",
      "change_request_plan": "",
      "change_request_risk": "LOW",
      "change_request_type": "NORMAL",
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2024-01-01T00:00:00Z",
      "creation_source": "CS_MANUAL",
      "description": "Deploying new payment service v2.1",
      "end_date": "2024-01-02T15:00:00Z",
      "key": "CHM-1234",
      "modified_at": "2024-01-01T00:00:00Z",
      "plan_notebook_id": 0,
      "priority": "NOT_DEFINED",
      "project_id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
      "start_date": "2024-01-01T03:00:00Z",
      "status": "OPEN",
      "title": "Deploy new payment service",
      "type": "CHANGE_REQUEST"
    },
    "id": "CHM-1234",
    "relationships": {
      "change_request_decisions": {
        "data": [
          {
            "id": "decision-id-0",
            "type": "change_request_decision"
          }
        ]
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "change_request"
  },
  "included": [
    {
      "attributes": {
        "email": "john.doe@example.com",
        "handle": "john.doe@example.com",
        "name": "John Doe"
      },
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "user"
    }
  ]
}
```

{% /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="403" %}
Forbidden
{% 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/change-management/change-request" \
-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": {
      "change_request_linked_incident_uuid": "00000000-0000-0000-0000-000000000000",
      "change_request_maintenance_window_query": "",
      "change_request_plan": "1. Deploy to staging 2. Run tests 3. Deploy to production",
      "change_request_risk": "LOW",
      "change_request_type": "NORMAL",
      "description": "Deploying new payment service v2.1",
      "end_date": "2024-01-02T15:00:00Z",
      "project_id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
      "requested_teams": [
        "team-handle-1"
      ],
      "start_date": "2024-01-01T03:00:00Z",
      "title": "Deploy new payment service"
    },
    "type": "change_request"
  }
}
EOF 
                
##### 

```python
"""
Create a change request returns "Created" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.change_management_api import ChangeManagementApi
from datadog_api_client.v2.model.change_request_change_type import ChangeRequestChangeType
from datadog_api_client.v2.model.change_request_create_attributes import ChangeRequestCreateAttributes
from datadog_api_client.v2.model.change_request_create_data import ChangeRequestCreateData
from datadog_api_client.v2.model.change_request_create_request import ChangeRequestCreateRequest
from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType
from datadog_api_client.v2.model.change_request_risk_level import ChangeRequestRiskLevel
from datetime import datetime
from dateutil.tz import tzutc

body = ChangeRequestCreateRequest(
    data=ChangeRequestCreateData(
        attributes=ChangeRequestCreateAttributes(
            change_request_linked_incident_uuid="00000000-0000-0000-0000-000000000000",
            change_request_maintenance_window_query="",
            change_request_plan="1. Deploy to staging 2. Run tests 3. Deploy to production",
            change_request_risk=ChangeRequestRiskLevel.LOW,
            change_request_type=ChangeRequestChangeType.NORMAL,
            description="Deploying new payment service v2.1",
            end_date=datetime(2024, 1, 2, 15, 0, tzinfo=tzutc()),
            project_id="d4bbe1af-f36e-42f1-87c1-493ca35c320e",
            requested_teams=[
                "team-handle-1",
            ],
            start_date=datetime(2024, 1, 1, 3, 0, tzinfo=tzutc()),
            title="Deploy new payment service",
        ),
        type=ChangeRequestResourceType.CHANGE_REQUEST,
    ),
)

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

    print(response)
```

#### Instructions

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

```ruby
# Create a change request returns "Created" response

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

body = DatadogAPIClient::V2::ChangeRequestCreateRequest.new({
  data: DatadogAPIClient::V2::ChangeRequestCreateData.new({
    attributes: DatadogAPIClient::V2::ChangeRequestCreateAttributes.new({
      change_request_linked_incident_uuid: "00000000-0000-0000-0000-000000000000",
      change_request_maintenance_window_query: "",
      change_request_plan: "1. Deploy to staging 2. Run tests 3. Deploy to production",
      change_request_risk: DatadogAPIClient::V2::ChangeRequestRiskLevel::LOW,
      change_request_type: DatadogAPIClient::V2::ChangeRequestChangeType::NORMAL,
      description: "Deploying new payment service v2.1",
      end_date: "2024-01-02T15:00:00Z",
      project_id: "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
      requested_teams: [
        "team-handle-1",
      ],
      start_date: "2024-01-01T03:00:00Z",
      title: "Deploy new payment service",
    }),
    type: DatadogAPIClient::V2::ChangeRequestResourceType::CHANGE_REQUEST,
  }),
})
p api_instance.create_change_request(body)
```

#### Instructions

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

```go
// Create a change request 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() {
	body := datadogV2.ChangeRequestCreateRequest{
		Data: datadogV2.ChangeRequestCreateData{
			Attributes: datadogV2.ChangeRequestCreateAttributes{
				ChangeRequestLinkedIncidentUuid:     datadog.PtrString("00000000-0000-0000-0000-000000000000"),
				ChangeRequestMaintenanceWindowQuery: datadog.PtrString(""),
				ChangeRequestPlan:                   datadog.PtrString("1. Deploy to staging 2. Run tests 3. Deploy to production"),
				ChangeRequestRisk:                   datadogV2.CHANGEREQUESTRISKLEVEL_LOW.Ptr(),
				ChangeRequestType:                   datadogV2.CHANGEREQUESTCHANGETYPE_NORMAL.Ptr(),
				Description:                         datadog.PtrString("Deploying new payment service v2.1"),
				EndDate:                             datadog.PtrTime(time.Date(2024, 1, 2, 15, 0, 0, 0, time.UTC)),
				ProjectId:                           datadog.PtrString("d4bbe1af-f36e-42f1-87c1-493ca35c320e"),
				RequestedTeams: []string{
					"team-handle-1",
				},
				StartDate: datadog.PtrTime(time.Date(2024, 1, 1, 3, 0, 0, 0, time.UTC)),
				Title:     "Deploy new payment service",
			},
			Type: datadogV2.CHANGEREQUESTRESOURCETYPE_CHANGE_REQUEST,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateChangeRequest", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewChangeManagementApi(apiClient)
	resp, r, err := api.CreateChangeRequest(ctx, body)

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

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

#### Instructions

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

```java
// Create a change request returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ChangeManagementApi;
import com.datadog.api.client.v2.model.ChangeRequestChangeType;
import com.datadog.api.client.v2.model.ChangeRequestCreateAttributes;
import com.datadog.api.client.v2.model.ChangeRequestCreateData;
import com.datadog.api.client.v2.model.ChangeRequestCreateRequest;
import com.datadog.api.client.v2.model.ChangeRequestResourceType;
import com.datadog.api.client.v2.model.ChangeRequestResponse;
import com.datadog.api.client.v2.model.ChangeRequestRiskLevel;
import java.time.OffsetDateTime;
import java.util.Collections;

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

    ChangeRequestCreateRequest body =
        new ChangeRequestCreateRequest()
            .data(
                new ChangeRequestCreateData()
                    .attributes(
                        new ChangeRequestCreateAttributes()
                            .changeRequestLinkedIncidentUuid("00000000-0000-0000-0000-000000000000")
                            .changeRequestMaintenanceWindowQuery("")
                            .changeRequestPlan(
                                "1. Deploy to staging 2. Run tests 3. Deploy to production")
                            .changeRequestRisk(ChangeRequestRiskLevel.LOW)
                            .changeRequestType(ChangeRequestChangeType.NORMAL)
                            .description("Deploying new payment service v2.1")
                            .endDate(OffsetDateTime.parse("2024-01-02T15:00:00Z"))
                            .projectId("d4bbe1af-f36e-42f1-87c1-493ca35c320e")
                            .requestedTeams(Collections.singletonList("team-handle-1"))
                            .startDate(OffsetDateTime.parse("2024-01-01T03:00:00Z"))
                            .title("Deploy new payment service"))
                    .type(ChangeRequestResourceType.CHANGE_REQUEST));

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

#### Instructions

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

```rust
// Create a change request returns "Created" response
use chrono::{DateTime, Utc};
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_change_management::ChangeManagementAPI;
use datadog_api_client::datadogV2::model::ChangeRequestChangeType;
use datadog_api_client::datadogV2::model::ChangeRequestCreateAttributes;
use datadog_api_client::datadogV2::model::ChangeRequestCreateData;
use datadog_api_client::datadogV2::model::ChangeRequestCreateRequest;
use datadog_api_client::datadogV2::model::ChangeRequestResourceType;
use datadog_api_client::datadogV2::model::ChangeRequestRiskLevel;

#[tokio::main]
async fn main() {
    let body = ChangeRequestCreateRequest::new(ChangeRequestCreateData::new(
        ChangeRequestCreateAttributes::new("Deploy new payment service".to_string())
            .change_request_linked_incident_uuid("00000000-0000-0000-0000-000000000000".to_string())
            .change_request_maintenance_window_query("".to_string())
            .change_request_plan(
                "1. Deploy to staging 2. Run tests 3. Deploy to production".to_string(),
            )
            .change_request_risk(ChangeRequestRiskLevel::LOW)
            .change_request_type(ChangeRequestChangeType::NORMAL)
            .description("Deploying new payment service v2.1".to_string())
            .end_date(
                DateTime::parse_from_rfc3339("2024-01-02T15:00:00+00:00")
                    .expect("Failed to parse datetime")
                    .with_timezone(&Utc),
            )
            .project_id("d4bbe1af-f36e-42f1-87c1-493ca35c320e".to_string())
            .requested_teams(vec!["team-handle-1".to_string()])
            .start_date(
                DateTime::parse_from_rfc3339("2024-01-01T03:00:00+00:00")
                    .expect("Failed to parse datetime")
                    .with_timezone(&Utc),
            ),
        ChangeRequestResourceType::CHANGE_REQUEST,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateChangeRequest", true);
    let api = ChangeManagementAPI::with_config(configuration);
    let resp = api.create_change_request(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

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

```typescript
/**
 * Create a change request returns "Created" response
 */

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

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

const params: v2.ChangeManagementApiCreateChangeRequestRequest = {
  body: {
    data: {
      attributes: {
        changeRequestLinkedIncidentUuid: "00000000-0000-0000-0000-000000000000",
        changeRequestMaintenanceWindowQuery: "",
        changeRequestPlan:
          "1. Deploy to staging 2. Run tests 3. Deploy to production",
        changeRequestRisk: "LOW",
        changeRequestType: "NORMAL",
        description: "Deploying new payment service v2.1",
        endDate: new Date(2024, 1, 2, 15, 0, 0, 0),
        projectId: "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
        requestedTeams: ["team-handle-1"],
        startDate: new Date(2024, 1, 1, 3, 0, 0, 0),
        title: "Deploy new payment service",
      },
      type: "change_request",
    },
  },
};

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

#### Instructions

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

## Get a change request{% #get-a-change-request %}

{% tab title="v2" %}
**Note**: This endpoint is in preview 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/change-management/change-request/{change_request_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/change-management/change-request/{change_request_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/change-management/change-request/{change_request_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/change-management/change-request/{change_request_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/change-management/change-request/{change_request_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/change-management/change-request/{change_request_id} |

### Overview

Get the details of a change request by its ID.

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



### Arguments

#### Path Parameters

| Name                                | Type   | Description                           |
| ----------------------------------- | ------ | ------------------------------------- |
| change_request_id [*required*] | string | The identifier of the change request. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response object for a change request.

| Parent field             | Field                                                     | Type            | Description                                                                                 |
| ------------------------ | --------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------- |
|                          | data [*required*]                                    | object          | Data object for a change request response.                                                  |
| data                     | attributes [*required*]                              | object          | Attributes of a change request response.                                                    |
| attributes               | archived_at                                               | date-time       | Timestamp of when the change request was archived.                                          |
| attributes               | attributes [*required*]                              | object          | Custom attributes of the change request as key-value pairs.                                 |
| additionalProperties     | <any-key>                                                 | [string]        |
| attributes               | change_request_linked_incident_uuid [*required*]     | string          | The UUID of the linked incident.                                                            |
| attributes               | change_request_maintenance_window_query [*required*] | string          | The maintenance window query for the change request.                                        |
| attributes               | change_request_plan [*required*]                     | string          | The plan associated with the change request.                                                |
| attributes               | change_request_risk [*required*]                     | enum            | The risk level of the change request. Allowed enum values: `UNDEFINED,LOW,MEDIUM,HIGH`      |
| attributes               | change_request_type [*required*]                     | enum            | The type of the change request. Allowed enum values: `NORMAL,STANDARD,EMERGENCY`            |
| attributes               | closed_at                                                 | date-time       | Timestamp of when the change request was closed.                                            |
| attributes               | created_at [*required*]                              | date-time       | Timestamp of when the change request was created.                                           |
| attributes               | creation_source [*required*]                         | string          | The source from which the change request was created.                                       |
| attributes               | description [*required*]                             | string          | The description of the change request.                                                      |
| attributes               | end_date                                                  | date-time       | The planned end date of the change request.                                                 |
| attributes               | key [*required*]                                     | string          | The human-readable key of the change request.                                               |
| attributes               | modified_at [*required*]                             | date-time       | Timestamp of when the change request was last modified.                                     |
| attributes               | plan_notebook_id [*required*]                        | int64           | The notebook ID associated with the change request plan.                                    |
| attributes               | priority [*required*]                                | string          | The priority of the change request.                                                         |
| attributes               | project_id [*required*]                              | string          | The project UUID associated with the change request.                                        |
| attributes               | start_date                                                | date-time       | The planned start date of the change request.                                               |
| attributes               | status [*required*]                                  | string          | The current status of the change request.                                                   |
| attributes               | title [*required*]                                   | string          | The title of the change request.                                                            |
| attributes               | type [*required*]                                    | string          | The case type.                                                                              |
| data                     | id [*required*]                                      | string          | The identifier of the change request.                                                       |
| data                     | relationships                                             | object          | Relationships of a change request.                                                          |
| relationships            | change_request_decisions [*required*]                | object          | Relationship to change request decisions.                                                   |
| change_request_decisions | data [*required*]                                    | [object]        | Array of decision relationship data.                                                        |
| data                     | id [*required*]                                      | string          | The decision UUID.                                                                          |
| data                     | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |
| relationships            | created_by [*required*]                              | object          | Relationship to a user.                                                                     |
| created_by               | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| data                     | type [*required*]                                    | enum            | Change request resource type. Allowed enum values: `change_request`                         |
|                          | included                                                  | [ <oneOf>] | Included resources related to the change request.                                           |
| included                 | Option 1                                                  | object          | An included user resource.                                                                  |
| Option 1                 | attributes [*required*]                              | object          | Attributes of an included user.                                                             |
| attributes               | email [*required*]                                   | string          | The email of the user.                                                                      |
| attributes               | handle [*required*]                                  | string          | The handle of the user.                                                                     |
| attributes               | name [*required*]                                    | string          | The name of the user.                                                                       |
| Option 1                 | id [*required*]                                      | string          | The user UUID.                                                                              |
| Option 1                 | type [*required*]                                    | string          | The resource type.                                                                          |
| included                 | Option 2                                                  | object          | An included change request decision resource.                                               |
| Option 2                 | attributes [*required*]                              | object          | Attributes of a change request decision in a response.                                      |
| attributes               | change_request_status [*required*]                   | enum            | The status of a change request decision. Allowed enum values: `REQUESTED,APPROVED,DECLINED` |
| attributes               | decided_at [*required*]                              | date-time       | Timestamp of when the decision was made.                                                    |
| attributes               | decision_reason [*required*]                         | string          | The reason for the decision.                                                                |
| attributes               | deleted_at [*required*]                              | date-time       | Timestamp of when the decision was deleted.                                                 |
| attributes               | request_reason [*required*]                          | string          | The reason for requesting the decision.                                                     |
| attributes               | requested_at [*required*]                            | date-time       | Timestamp of when the decision was requested.                                               |
| Option 2                 | id [*required*]                                      | string          | The decision UUID.                                                                          |
| Option 2                 | relationships                                             | object          | Relationships of a change request decision.                                                 |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_by_user [*required*]                       | object          | Relationship to a user.                                                                     |
| requested_by_user        | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_user [*required*]                          | object          | Relationship to a user.                                                                     |
| requested_user           | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| Option 2                 | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "change_request_linked_incident_uuid": "",
      "change_request_maintenance_window_query": "",
      "change_request_plan": "",
      "change_request_risk": "LOW",
      "change_request_type": "NORMAL",
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2024-01-01T00:00:00Z",
      "creation_source": "CS_MANUAL",
      "description": "Deploying new payment service v2.1",
      "end_date": "2024-01-02T15:00:00Z",
      "key": "CHM-1234",
      "modified_at": "2024-01-01T00:00:00Z",
      "plan_notebook_id": 0,
      "priority": "NOT_DEFINED",
      "project_id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
      "start_date": "2024-01-01T03:00:00Z",
      "status": "OPEN",
      "title": "Deploy new payment service",
      "type": "CHANGE_REQUEST"
    },
    "id": "CHM-1234",
    "relationships": {
      "change_request_decisions": {
        "data": [
          {
            "id": "decision-id-0",
            "type": "change_request_decision"
          }
        ]
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "change_request"
  },
  "included": [
    {
      "attributes": {
        "email": "john.doe@example.com",
        "handle": "john.doe@example.com",
        "name": "John Doe"
      },
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "user"
    }
  ]
}
```

{% /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="404" %}
Not Found
{% 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 parameters export change_request_id="CHM-1234" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/change-management/change-request/${change_request_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get a change request returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.change_management_api import ChangeManagementApi

configuration = Configuration()
configuration.unstable_operations["get_change_request"] = True
with ApiClient(configuration) as api_client:
    api_instance = ChangeManagementApi(api_client)
    response = api_instance.get_change_request(
        change_request_id="change_request_id",
    )

    print(response)
```

#### Instructions

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

```ruby
# Get a change request returns "OK" response

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

#### Instructions

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

```go
// Get a change request 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.GetChangeRequest", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewChangeManagementApi(apiClient)
	resp, r, err := api.GetChangeRequest(ctx, "change_request_id")

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

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

#### Instructions

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

```java
// Get a change request returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ChangeManagementApi;
import com.datadog.api.client.v2.model.ChangeRequestResponse;

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

    try {
      ChangeRequestResponse result = apiInstance.getChangeRequest("CHM-1234");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ChangeManagementApi#getChangeRequest");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

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

```rust
// Get a change request returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_change_management::ChangeManagementAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.GetChangeRequest", true);
    let api = ChangeManagementAPI::with_config(configuration);
    let resp = api
        .get_change_request("change_request_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.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get a change request returns "OK" response
 */

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

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

const params: v2.ChangeManagementApiGetChangeRequestRequest = {
  changeRequestId: "change_request_id",
};

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

#### Instructions

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

## Update a change request{% #update-a-change-request %}

{% tab title="v2" %}
**Note**: This endpoint is in preview 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/change-management/change-request/{change_request_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/change-management/change-request/{change_request_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/change-management/change-request/{change_request_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}  |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/change-management/change-request/{change_request_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/change-management/change-request/{change_request_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/change-management/change-request/{change_request_id} |

### Overview

Update the properties of a change request.

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



### Arguments

#### Path Parameters

| Name                                | Type   | Description                           |
| ----------------------------------- | ------ | ------------------------------------- |
| change_request_id [*required*] | string | The identifier of the change request. |

### Request

#### Body Data (required)

Change request update payload.

{% tab title="Model" %}

| Parent field             | Field                    | Type      | Description                                                                                 |
| ------------------------ | ------------------------ | --------- | ------------------------------------------------------------------------------------------- |
|                          | data [*required*]   | object    | Data object to update a change request.                                                     |
| data                     | attributes               | object    | Attributes for updating a change request.                                                   |
| attributes               | change_request_plan      | string    | The plan associated with the change request.                                                |
| attributes               | change_request_risk      | enum      | The risk level of the change request. Allowed enum values: `UNDEFINED,LOW,MEDIUM,HIGH`      |
| attributes               | change_request_type      | enum      | The type of the change request. Allowed enum values: `NORMAL,STANDARD,EMERGENCY`            |
| attributes               | end_date                 | date-time | The planned end date of the change request.                                                 |
| attributes               | id                       | string    | The identifier of the change request to update.                                             |
| attributes               | start_date               | date-time | The planned start date of the change request.                                               |
| data                     | relationships            | object    | Relationships for updating a change request.                                                |
| relationships            | change_request_decisions | object    | Relationship to change request decisions.                                                   |
| change_request_decisions | data [*required*]   | [object]  | Array of decision relationship data.                                                        |
| data                     | id [*required*]     | string    | The decision UUID.                                                                          |
| data                     | type [*required*]   | enum      | Change request decision resource type. Allowed enum values: `change_request_decision`       |
| data                     | type [*required*]   | enum      | Change request resource type. Allowed enum values: `change_request`                         |
|                          | included                 | [object]  | Included resources for the change request update.                                           |
| included                 | attributes               | object    | Attributes for creating a change request decision.                                          |
| attributes               | change_request_status    | enum      | The status of a change request decision. Allowed enum values: `REQUESTED,APPROVED,DECLINED` |
| attributes               | request_reason           | string    | The reason for requesting the decision.                                                     |
| included                 | id [*required*]     | string    | The decision identifier.                                                                    |
| included                 | relationships            | object    | Relationships for creating a change request decision.                                       |
| relationships            | requested_user           | object    | Relationship to a user.                                                                     |
| requested_user           | data [*required*]   | object    | User relationship data.                                                                     |
| data                     | id [*required*]     | string    | The user UUID.                                                                              |
| data                     | type [*required*]   | string    | The user resource type.                                                                     |
| included                 | type [*required*]   | enum      | Change request decision resource type. Allowed enum values: `change_request_decision`       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "change_request_plan": "Updated deployment plan",
      "change_request_risk": "LOW",
      "change_request_type": "NORMAL",
      "end_date": "2024-01-02T15:00:00Z",
      "id": "CHM-1234",
      "start_date": "2024-01-01T03:00:00Z"
    },
    "relationships": {
      "change_request_decisions": {
        "data": [
          {
            "id": "decision-id-0",
            "type": "change_request_decision"
          }
        ]
      }
    },
    "type": "change_request"
  },
  "included": [
    {
      "attributes": {
        "change_request_status": "REQUESTED",
        "request_reason": "Please review and approve this change"
      },
      "id": "decision-id-0",
      "relationships": {
        "requested_user": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        }
      },
      "type": "change_request_decision"
    }
  ]
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response object for a change request.

| Parent field             | Field                                                     | Type            | Description                                                                                 |
| ------------------------ | --------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------- |
|                          | data [*required*]                                    | object          | Data object for a change request response.                                                  |
| data                     | attributes [*required*]                              | object          | Attributes of a change request response.                                                    |
| attributes               | archived_at                                               | date-time       | Timestamp of when the change request was archived.                                          |
| attributes               | attributes [*required*]                              | object          | Custom attributes of the change request as key-value pairs.                                 |
| additionalProperties     | <any-key>                                                 | [string]        |
| attributes               | change_request_linked_incident_uuid [*required*]     | string          | The UUID of the linked incident.                                                            |
| attributes               | change_request_maintenance_window_query [*required*] | string          | The maintenance window query for the change request.                                        |
| attributes               | change_request_plan [*required*]                     | string          | The plan associated with the change request.                                                |
| attributes               | change_request_risk [*required*]                     | enum            | The risk level of the change request. Allowed enum values: `UNDEFINED,LOW,MEDIUM,HIGH`      |
| attributes               | change_request_type [*required*]                     | enum            | The type of the change request. Allowed enum values: `NORMAL,STANDARD,EMERGENCY`            |
| attributes               | closed_at                                                 | date-time       | Timestamp of when the change request was closed.                                            |
| attributes               | created_at [*required*]                              | date-time       | Timestamp of when the change request was created.                                           |
| attributes               | creation_source [*required*]                         | string          | The source from which the change request was created.                                       |
| attributes               | description [*required*]                             | string          | The description of the change request.                                                      |
| attributes               | end_date                                                  | date-time       | The planned end date of the change request.                                                 |
| attributes               | key [*required*]                                     | string          | The human-readable key of the change request.                                               |
| attributes               | modified_at [*required*]                             | date-time       | Timestamp of when the change request was last modified.                                     |
| attributes               | plan_notebook_id [*required*]                        | int64           | The notebook ID associated with the change request plan.                                    |
| attributes               | priority [*required*]                                | string          | The priority of the change request.                                                         |
| attributes               | project_id [*required*]                              | string          | The project UUID associated with the change request.                                        |
| attributes               | start_date                                                | date-time       | The planned start date of the change request.                                               |
| attributes               | status [*required*]                                  | string          | The current status of the change request.                                                   |
| attributes               | title [*required*]                                   | string          | The title of the change request.                                                            |
| attributes               | type [*required*]                                    | string          | The case type.                                                                              |
| data                     | id [*required*]                                      | string          | The identifier of the change request.                                                       |
| data                     | relationships                                             | object          | Relationships of a change request.                                                          |
| relationships            | change_request_decisions [*required*]                | object          | Relationship to change request decisions.                                                   |
| change_request_decisions | data [*required*]                                    | [object]        | Array of decision relationship data.                                                        |
| data                     | id [*required*]                                      | string          | The decision UUID.                                                                          |
| data                     | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |
| relationships            | created_by [*required*]                              | object          | Relationship to a user.                                                                     |
| created_by               | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| data                     | type [*required*]                                    | enum            | Change request resource type. Allowed enum values: `change_request`                         |
|                          | included                                                  | [ <oneOf>] | Included resources related to the change request.                                           |
| included                 | Option 1                                                  | object          | An included user resource.                                                                  |
| Option 1                 | attributes [*required*]                              | object          | Attributes of an included user.                                                             |
| attributes               | email [*required*]                                   | string          | The email of the user.                                                                      |
| attributes               | handle [*required*]                                  | string          | The handle of the user.                                                                     |
| attributes               | name [*required*]                                    | string          | The name of the user.                                                                       |
| Option 1                 | id [*required*]                                      | string          | The user UUID.                                                                              |
| Option 1                 | type [*required*]                                    | string          | The resource type.                                                                          |
| included                 | Option 2                                                  | object          | An included change request decision resource.                                               |
| Option 2                 | attributes [*required*]                              | object          | Attributes of a change request decision in a response.                                      |
| attributes               | change_request_status [*required*]                   | enum            | The status of a change request decision. Allowed enum values: `REQUESTED,APPROVED,DECLINED` |
| attributes               | decided_at [*required*]                              | date-time       | Timestamp of when the decision was made.                                                    |
| attributes               | decision_reason [*required*]                         | string          | The reason for the decision.                                                                |
| attributes               | deleted_at [*required*]                              | date-time       | Timestamp of when the decision was deleted.                                                 |
| attributes               | request_reason [*required*]                          | string          | The reason for requesting the decision.                                                     |
| attributes               | requested_at [*required*]                            | date-time       | Timestamp of when the decision was requested.                                               |
| Option 2                 | id [*required*]                                      | string          | The decision UUID.                                                                          |
| Option 2                 | relationships                                             | object          | Relationships of a change request decision.                                                 |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_by_user [*required*]                       | object          | Relationship to a user.                                                                     |
| requested_by_user        | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_user [*required*]                          | object          | Relationship to a user.                                                                     |
| requested_user           | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| Option 2                 | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "change_request_linked_incident_uuid": "",
      "change_request_maintenance_window_query": "",
      "change_request_plan": "",
      "change_request_risk": "LOW",
      "change_request_type": "NORMAL",
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2024-01-01T00:00:00Z",
      "creation_source": "CS_MANUAL",
      "description": "Deploying new payment service v2.1",
      "end_date": "2024-01-02T15:00:00Z",
      "key": "CHM-1234",
      "modified_at": "2024-01-01T00:00:00Z",
      "plan_notebook_id": 0,
      "priority": "NOT_DEFINED",
      "project_id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
      "start_date": "2024-01-01T03:00:00Z",
      "status": "OPEN",
      "title": "Deploy new payment service",
      "type": "CHANGE_REQUEST"
    },
    "id": "CHM-1234",
    "relationships": {
      "change_request_decisions": {
        "data": [
          {
            "id": "decision-id-0",
            "type": "change_request_decision"
          }
        ]
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "change_request"
  },
  "included": [
    {
      "attributes": {
        "email": "john.doe@example.com",
        "handle": "john.doe@example.com",
        "name": "John Doe"
      },
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "user"
    }
  ]
}
```

{% /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="403" %}
Forbidden
{% 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="404" %}
Not Found
{% 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
# 
 \# Path parameters export change_request_id="CHM-1234" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/change-management/change-request/${change_request_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": {
      "change_request_plan": "Updated deployment plan",
      "change_request_risk": "LOW",
      "change_request_type": "NORMAL",
      "end_date": "2024-01-02T15:00:00Z",
      "id": "CHM-1234",
      "start_date": "2024-01-01T03:00:00Z"
    },
    "relationships": {
      "change_request_decisions": {
        "data": [
          {
            "id": "decision-id-0"
          }
        ]
      }
    },
    "type": "change_request"
  },
  "included": [
    {
      "attributes": {
        "change_request_status": "REQUESTED",
        "request_reason": "Please review and approve this change"
      },
      "id": "decision-id-0",
      "type": "change_request_decision"
    }
  ]
}
EOF 
                
##### 

```python
"""
Update a change request returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.change_management_api import ChangeManagementApi
from datadog_api_client.v2.model.change_request_change_type import ChangeRequestChangeType
from datadog_api_client.v2.model.change_request_decision_create_attributes import ChangeRequestDecisionCreateAttributes
from datadog_api_client.v2.model.change_request_decision_create_item import ChangeRequestDecisionCreateItem
from datadog_api_client.v2.model.change_request_decision_create_relationships import (
    ChangeRequestDecisionCreateRelationships,
)
from datadog_api_client.v2.model.change_request_decision_relationship_data import ChangeRequestDecisionRelationshipData
from datadog_api_client.v2.model.change_request_decision_resource_type import ChangeRequestDecisionResourceType
from datadog_api_client.v2.model.change_request_decision_status_type import ChangeRequestDecisionStatusType
from datadog_api_client.v2.model.change_request_decisions_relationship import ChangeRequestDecisionsRelationship
from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType
from datadog_api_client.v2.model.change_request_risk_level import ChangeRequestRiskLevel
from datadog_api_client.v2.model.change_request_update_attributes import ChangeRequestUpdateAttributes
from datadog_api_client.v2.model.change_request_update_data import ChangeRequestUpdateData
from datadog_api_client.v2.model.change_request_update_relationships import ChangeRequestUpdateRelationships
from datadog_api_client.v2.model.change_request_update_request import ChangeRequestUpdateRequest
from datadog_api_client.v2.model.change_request_user_relationship import ChangeRequestUserRelationship
from datadog_api_client.v2.model.change_request_user_relationship_data import ChangeRequestUserRelationshipData
from datetime import datetime
from dateutil.tz import tzutc

body = ChangeRequestUpdateRequest(
    data=ChangeRequestUpdateData(
        attributes=ChangeRequestUpdateAttributes(
            change_request_plan="Updated deployment plan",
            change_request_risk=ChangeRequestRiskLevel.LOW,
            change_request_type=ChangeRequestChangeType.NORMAL,
            end_date=datetime(2024, 1, 2, 15, 0, tzinfo=tzutc()),
            id="CHM-1234",
            start_date=datetime(2024, 1, 1, 3, 0, tzinfo=tzutc()),
        ),
        relationships=ChangeRequestUpdateRelationships(
            change_request_decisions=ChangeRequestDecisionsRelationship(
                data=[
                    ChangeRequestDecisionRelationshipData(
                        id="decision-id-0",
                        type=ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION,
                    ),
                ],
            ),
        ),
        type=ChangeRequestResourceType.CHANGE_REQUEST,
    ),
    included=[
        ChangeRequestDecisionCreateItem(
            attributes=ChangeRequestDecisionCreateAttributes(
                change_request_status=ChangeRequestDecisionStatusType.REQUESTED,
                request_reason="Please review and approve this change",
            ),
            id="decision-id-0",
            relationships=ChangeRequestDecisionCreateRelationships(
                requested_user=ChangeRequestUserRelationship(
                    data=ChangeRequestUserRelationshipData(
                        id="00000000-0000-0000-0000-000000000000",
                        type="user",
                    ),
                ),
            ),
            type=ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION,
        ),
    ],
)

configuration = Configuration()
configuration.unstable_operations["update_change_request"] = True
with ApiClient(configuration) as api_client:
    api_instance = ChangeManagementApi(api_client)
    response = api_instance.update_change_request(change_request_id="change_request_id", body=body)

    print(response)
```

#### Instructions

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

```ruby
# Update a change request returns "OK" response

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

body = DatadogAPIClient::V2::ChangeRequestUpdateRequest.new({
  data: DatadogAPIClient::V2::ChangeRequestUpdateData.new({
    attributes: DatadogAPIClient::V2::ChangeRequestUpdateAttributes.new({
      change_request_plan: "Updated deployment plan",
      change_request_risk: DatadogAPIClient::V2::ChangeRequestRiskLevel::LOW,
      change_request_type: DatadogAPIClient::V2::ChangeRequestChangeType::NORMAL,
      end_date: "2024-01-02T15:00:00Z",
      id: "CHM-1234",
      start_date: "2024-01-01T03:00:00Z",
    }),
    relationships: DatadogAPIClient::V2::ChangeRequestUpdateRelationships.new({
      change_request_decisions: DatadogAPIClient::V2::ChangeRequestDecisionsRelationship.new({
        data: [
          DatadogAPIClient::V2::ChangeRequestDecisionRelationshipData.new({
            id: "decision-id-0",
            type: DatadogAPIClient::V2::ChangeRequestDecisionResourceType::CHANGE_REQUEST_DECISION,
          }),
        ],
      }),
    }),
    type: DatadogAPIClient::V2::ChangeRequestResourceType::CHANGE_REQUEST,
  }),
  included: [
    DatadogAPIClient::V2::ChangeRequestDecisionCreateItem.new({
      attributes: DatadogAPIClient::V2::ChangeRequestDecisionCreateAttributes.new({
        change_request_status: DatadogAPIClient::V2::ChangeRequestDecisionStatusType::REQUESTED,
        request_reason: "Please review and approve this change",
      }),
      id: "decision-id-0",
      relationships: DatadogAPIClient::V2::ChangeRequestDecisionCreateRelationships.new({
        requested_user: DatadogAPIClient::V2::ChangeRequestUserRelationship.new({
          data: DatadogAPIClient::V2::ChangeRequestUserRelationshipData.new({
            id: "00000000-0000-0000-0000-000000000000",
            type: "user",
          }),
        }),
      }),
      type: DatadogAPIClient::V2::ChangeRequestDecisionResourceType::CHANGE_REQUEST_DECISION,
    }),
  ],
})
p api_instance.update_change_request("change_request_id", body)
```

#### Instructions

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

```go
// Update a change request returns "OK" 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() {
	body := datadogV2.ChangeRequestUpdateRequest{
		Data: datadogV2.ChangeRequestUpdateData{
			Attributes: &datadogV2.ChangeRequestUpdateAttributes{
				ChangeRequestPlan: datadog.PtrString("Updated deployment plan"),
				ChangeRequestRisk: datadogV2.CHANGEREQUESTRISKLEVEL_LOW.Ptr(),
				ChangeRequestType: datadogV2.CHANGEREQUESTCHANGETYPE_NORMAL.Ptr(),
				EndDate:           datadog.PtrTime(time.Date(2024, 1, 2, 15, 0, 0, 0, time.UTC)),
				Id:                datadog.PtrString("CHM-1234"),
				StartDate:         datadog.PtrTime(time.Date(2024, 1, 1, 3, 0, 0, 0, time.UTC)),
			},
			Relationships: &datadogV2.ChangeRequestUpdateRelationships{
				ChangeRequestDecisions: &datadogV2.ChangeRequestDecisionsRelationship{
					Data: []datadogV2.ChangeRequestDecisionRelationshipData{
						{
							Id:   "decision-id-0",
							Type: datadogV2.CHANGEREQUESTDECISIONRESOURCETYPE_CHANGE_REQUEST_DECISION,
						},
					},
				},
			},
			Type: datadogV2.CHANGEREQUESTRESOURCETYPE_CHANGE_REQUEST,
		},
		Included: []datadogV2.ChangeRequestDecisionCreateItem{
			{
				Attributes: &datadogV2.ChangeRequestDecisionCreateAttributes{
					ChangeRequestStatus: datadogV2.CHANGEREQUESTDECISIONSTATUSTYPE_REQUESTED.Ptr(),
					RequestReason:       datadog.PtrString("Please review and approve this change"),
				},
				Id: "decision-id-0",
				Relationships: &datadogV2.ChangeRequestDecisionCreateRelationships{
					RequestedUser: &datadogV2.ChangeRequestUserRelationship{
						Data: *datadogV2.NewNullableChangeRequestUserRelationshipData(&datadogV2.ChangeRequestUserRelationshipData{
							Id:   "00000000-0000-0000-0000-000000000000",
							Type: "user",
						}),
					},
				},
				Type: datadogV2.CHANGEREQUESTDECISIONRESOURCETYPE_CHANGE_REQUEST_DECISION,
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateChangeRequest", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewChangeManagementApi(apiClient)
	resp, r, err := api.UpdateChangeRequest(ctx, "change_request_id", body)

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

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

#### Instructions

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

```java
// Update a change request returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ChangeManagementApi;
import com.datadog.api.client.v2.model.ChangeRequestChangeType;
import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateAttributes;
import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateItem;
import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateRelationships;
import com.datadog.api.client.v2.model.ChangeRequestDecisionRelationshipData;
import com.datadog.api.client.v2.model.ChangeRequestDecisionResourceType;
import com.datadog.api.client.v2.model.ChangeRequestDecisionStatusType;
import com.datadog.api.client.v2.model.ChangeRequestDecisionsRelationship;
import com.datadog.api.client.v2.model.ChangeRequestResourceType;
import com.datadog.api.client.v2.model.ChangeRequestResponse;
import com.datadog.api.client.v2.model.ChangeRequestRiskLevel;
import com.datadog.api.client.v2.model.ChangeRequestUpdateAttributes;
import com.datadog.api.client.v2.model.ChangeRequestUpdateData;
import com.datadog.api.client.v2.model.ChangeRequestUpdateRelationships;
import com.datadog.api.client.v2.model.ChangeRequestUpdateRequest;
import com.datadog.api.client.v2.model.ChangeRequestUserRelationship;
import com.datadog.api.client.v2.model.ChangeRequestUserRelationshipData;
import java.time.OffsetDateTime;
import java.util.Collections;

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

    ChangeRequestUpdateRequest body =
        new ChangeRequestUpdateRequest()
            .data(
                new ChangeRequestUpdateData()
                    .attributes(
                        new ChangeRequestUpdateAttributes()
                            .changeRequestPlan("Updated deployment plan")
                            .changeRequestRisk(ChangeRequestRiskLevel.LOW)
                            .changeRequestType(ChangeRequestChangeType.NORMAL)
                            .endDate(OffsetDateTime.parse("2024-01-02T15:00:00Z"))
                            .id("CHM-1234")
                            .startDate(OffsetDateTime.parse("2024-01-01T03:00:00Z")))
                    .relationships(
                        new ChangeRequestUpdateRelationships()
                            .changeRequestDecisions(
                                new ChangeRequestDecisionsRelationship()
                                    .data(
                                        Collections.singletonList(
                                            new ChangeRequestDecisionRelationshipData()
                                                .id("decision-id-0")
                                                .type(
                                                    ChangeRequestDecisionResourceType
                                                        .CHANGE_REQUEST_DECISION)))))
                    .type(ChangeRequestResourceType.CHANGE_REQUEST))
            .included(
                Collections.singletonList(
                    new ChangeRequestDecisionCreateItem()
                        .attributes(
                            new ChangeRequestDecisionCreateAttributes()
                                .changeRequestStatus(ChangeRequestDecisionStatusType.REQUESTED)
                                .requestReason("Please review and approve this change"))
                        .id("decision-id-0")
                        .relationships(
                            new ChangeRequestDecisionCreateRelationships()
                                .requestedUser(
                                    new ChangeRequestUserRelationship()
                                        .data(
                                            new ChangeRequestUserRelationshipData()
                                                .id("00000000-0000-0000-0000-000000000000")
                                                .type("user"))))
                        .type(ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION)));

    try {
      ChangeRequestResponse result = apiInstance.updateChangeRequest("CHM-1234", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ChangeManagementApi#updateChangeRequest");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

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

```rust
// Update a change request returns "OK" response
use chrono::{DateTime, Utc};
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_change_management::ChangeManagementAPI;
use datadog_api_client::datadogV2::model::ChangeRequestChangeType;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionCreateAttributes;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionCreateItem;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionCreateRelationships;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionRelationshipData;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionResourceType;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionStatusType;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionsRelationship;
use datadog_api_client::datadogV2::model::ChangeRequestResourceType;
use datadog_api_client::datadogV2::model::ChangeRequestRiskLevel;
use datadog_api_client::datadogV2::model::ChangeRequestUpdateAttributes;
use datadog_api_client::datadogV2::model::ChangeRequestUpdateData;
use datadog_api_client::datadogV2::model::ChangeRequestUpdateRelationships;
use datadog_api_client::datadogV2::model::ChangeRequestUpdateRequest;
use datadog_api_client::datadogV2::model::ChangeRequestUserRelationship;
use datadog_api_client::datadogV2::model::ChangeRequestUserRelationshipData;

#[tokio::main]
async fn main() {
    let body = ChangeRequestUpdateRequest::new(
        ChangeRequestUpdateData::new(ChangeRequestResourceType::CHANGE_REQUEST)
            .attributes(
                ChangeRequestUpdateAttributes::new()
                    .change_request_plan("Updated deployment plan".to_string())
                    .change_request_risk(ChangeRequestRiskLevel::LOW)
                    .change_request_type(ChangeRequestChangeType::NORMAL)
                    .end_date(
                        DateTime::parse_from_rfc3339("2024-01-02T15:00:00+00:00")
                            .expect("Failed to parse datetime")
                            .with_timezone(&Utc),
                    )
                    .id("CHM-1234".to_string())
                    .start_date(
                        DateTime::parse_from_rfc3339("2024-01-01T03:00:00+00:00")
                            .expect("Failed to parse datetime")
                            .with_timezone(&Utc),
                    ),
            )
            .relationships(
                ChangeRequestUpdateRelationships::new().change_request_decisions(
                    ChangeRequestDecisionsRelationship::new(vec![
                        ChangeRequestDecisionRelationshipData::new(
                            "decision-id-0".to_string(),
                            ChangeRequestDecisionResourceType::CHANGE_REQUEST_DECISION,
                        ),
                    ]),
                ),
            ),
    )
    .included(vec![ChangeRequestDecisionCreateItem::new(
        "decision-id-0".to_string(),
        ChangeRequestDecisionResourceType::CHANGE_REQUEST_DECISION,
    )
    .attributes(
        ChangeRequestDecisionCreateAttributes::new()
            .change_request_status(ChangeRequestDecisionStatusType::REQUESTED)
            .request_reason("Please review and approve this change".to_string()),
    )
    .relationships(
        ChangeRequestDecisionCreateRelationships::new().requested_user(
            ChangeRequestUserRelationship::new(Some(ChangeRequestUserRelationshipData::new(
                "00000000-0000-0000-0000-000000000000".to_string(),
                "user".to_string(),
            ))),
        ),
    )]);
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateChangeRequest", true);
    let api = ChangeManagementAPI::with_config(configuration);
    let resp = api
        .update_change_request("change_request_id".to_string(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

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

```typescript
/**
 * Update a change request returns "OK" response
 */

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

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

const params: v2.ChangeManagementApiUpdateChangeRequestRequest = {
  body: {
    data: {
      attributes: {
        changeRequestPlan: "Updated deployment plan",
        changeRequestRisk: "LOW",
        changeRequestType: "NORMAL",
        endDate: new Date(2024, 1, 2, 15, 0, 0, 0),
        id: "CHM-1234",
        startDate: new Date(2024, 1, 1, 3, 0, 0, 0),
      },
      relationships: {
        changeRequestDecisions: {
          data: [
            {
              id: "decision-id-0",
              type: "change_request_decision",
            },
          ],
        },
      },
      type: "change_request",
    },
    included: [
      {
        attributes: {
          changeRequestStatus: "REQUESTED",
          requestReason: "Please review and approve this change",
        },
        id: "decision-id-0",
        relationships: {
          requestedUser: {
            data: {
              id: "00000000-0000-0000-0000-000000000000",
              type: "user",
            },
          },
        },
        type: "change_request_decision",
      },
    ],
  },
  changeRequestId: "change_request_id",
};

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

#### Instructions

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

## Create a change request branch{% #create-a-change-request-branch %}

{% tab title="v2" %}
**Note**: This endpoint is in preview 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/change-management/change-request/{change_request_id}/branch |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/branch |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/change-management/change-request/{change_request_id}/branch      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}/branch      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}/branch  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/branch     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/branch |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/branch |

### Overview

Create a new branch in a repository for a change request.

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



### Arguments

#### Path Parameters

| Name                                | Type   | Description                           |
| ----------------------------------- | ------ | ------------------------------------- |
| change_request_id [*required*] | string | The identifier of the change request. |

### Request

#### Body Data (required)

Branch creation payload.

{% tab title="Model" %}

| Parent field | Field                         | Type   | Description                                                                       |
| ------------ | ----------------------------- | ------ | --------------------------------------------------------------------------------- |
|              | data [*required*]        | object | Data object to create a change request branch.                                    |
| data         | attributes [*required*]  | object | Attributes for creating a change request branch.                                  |
| attributes   | branch_name [*required*] | string | The name of the branch to create.                                                 |
| attributes   | repo_id [*required*]     | string | The repository identifier in the format owner/repository.                         |
| data         | type [*required*]        | enum   | Change request branch resource type. Allowed enum values: `change_request_branch` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "branch_name": "chm/CHM-1234",
      "repo_id": "DataDog/dd-source"
    },
    "type": "change_request_branch"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response object for a change request.

| Parent field             | Field                                                     | Type            | Description                                                                                 |
| ------------------------ | --------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------- |
|                          | data [*required*]                                    | object          | Data object for a change request response.                                                  |
| data                     | attributes [*required*]                              | object          | Attributes of a change request response.                                                    |
| attributes               | archived_at                                               | date-time       | Timestamp of when the change request was archived.                                          |
| attributes               | attributes [*required*]                              | object          | Custom attributes of the change request as key-value pairs.                                 |
| additionalProperties     | <any-key>                                                 | [string]        |
| attributes               | change_request_linked_incident_uuid [*required*]     | string          | The UUID of the linked incident.                                                            |
| attributes               | change_request_maintenance_window_query [*required*] | string          | The maintenance window query for the change request.                                        |
| attributes               | change_request_plan [*required*]                     | string          | The plan associated with the change request.                                                |
| attributes               | change_request_risk [*required*]                     | enum            | The risk level of the change request. Allowed enum values: `UNDEFINED,LOW,MEDIUM,HIGH`      |
| attributes               | change_request_type [*required*]                     | enum            | The type of the change request. Allowed enum values: `NORMAL,STANDARD,EMERGENCY`            |
| attributes               | closed_at                                                 | date-time       | Timestamp of when the change request was closed.                                            |
| attributes               | created_at [*required*]                              | date-time       | Timestamp of when the change request was created.                                           |
| attributes               | creation_source [*required*]                         | string          | The source from which the change request was created.                                       |
| attributes               | description [*required*]                             | string          | The description of the change request.                                                      |
| attributes               | end_date                                                  | date-time       | The planned end date of the change request.                                                 |
| attributes               | key [*required*]                                     | string          | The human-readable key of the change request.                                               |
| attributes               | modified_at [*required*]                             | date-time       | Timestamp of when the change request was last modified.                                     |
| attributes               | plan_notebook_id [*required*]                        | int64           | The notebook ID associated with the change request plan.                                    |
| attributes               | priority [*required*]                                | string          | The priority of the change request.                                                         |
| attributes               | project_id [*required*]                              | string          | The project UUID associated with the change request.                                        |
| attributes               | start_date                                                | date-time       | The planned start date of the change request.                                               |
| attributes               | status [*required*]                                  | string          | The current status of the change request.                                                   |
| attributes               | title [*required*]                                   | string          | The title of the change request.                                                            |
| attributes               | type [*required*]                                    | string          | The case type.                                                                              |
| data                     | id [*required*]                                      | string          | The identifier of the change request.                                                       |
| data                     | relationships                                             | object          | Relationships of a change request.                                                          |
| relationships            | change_request_decisions [*required*]                | object          | Relationship to change request decisions.                                                   |
| change_request_decisions | data [*required*]                                    | [object]        | Array of decision relationship data.                                                        |
| data                     | id [*required*]                                      | string          | The decision UUID.                                                                          |
| data                     | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |
| relationships            | created_by [*required*]                              | object          | Relationship to a user.                                                                     |
| created_by               | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| data                     | type [*required*]                                    | enum            | Change request resource type. Allowed enum values: `change_request`                         |
|                          | included                                                  | [ <oneOf>] | Included resources related to the change request.                                           |
| included                 | Option 1                                                  | object          | An included user resource.                                                                  |
| Option 1                 | attributes [*required*]                              | object          | Attributes of an included user.                                                             |
| attributes               | email [*required*]                                   | string          | The email of the user.                                                                      |
| attributes               | handle [*required*]                                  | string          | The handle of the user.                                                                     |
| attributes               | name [*required*]                                    | string          | The name of the user.                                                                       |
| Option 1                 | id [*required*]                                      | string          | The user UUID.                                                                              |
| Option 1                 | type [*required*]                                    | string          | The resource type.                                                                          |
| included                 | Option 2                                                  | object          | An included change request decision resource.                                               |
| Option 2                 | attributes [*required*]                              | object          | Attributes of a change request decision in a response.                                      |
| attributes               | change_request_status [*required*]                   | enum            | The status of a change request decision. Allowed enum values: `REQUESTED,APPROVED,DECLINED` |
| attributes               | decided_at [*required*]                              | date-time       | Timestamp of when the decision was made.                                                    |
| attributes               | decision_reason [*required*]                         | string          | The reason for the decision.                                                                |
| attributes               | deleted_at [*required*]                              | date-time       | Timestamp of when the decision was deleted.                                                 |
| attributes               | request_reason [*required*]                          | string          | The reason for requesting the decision.                                                     |
| attributes               | requested_at [*required*]                            | date-time       | Timestamp of when the decision was requested.                                               |
| Option 2                 | id [*required*]                                      | string          | The decision UUID.                                                                          |
| Option 2                 | relationships                                             | object          | Relationships of a change request decision.                                                 |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_by_user [*required*]                       | object          | Relationship to a user.                                                                     |
| requested_by_user        | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_user [*required*]                          | object          | Relationship to a user.                                                                     |
| requested_user           | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| Option 2                 | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "change_request_linked_incident_uuid": "",
      "change_request_maintenance_window_query": "",
      "change_request_plan": "",
      "change_request_risk": "LOW",
      "change_request_type": "NORMAL",
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2024-01-01T00:00:00Z",
      "creation_source": "CS_MANUAL",
      "description": "Deploying new payment service v2.1",
      "end_date": "2024-01-02T15:00:00Z",
      "key": "CHM-1234",
      "modified_at": "2024-01-01T00:00:00Z",
      "plan_notebook_id": 0,
      "priority": "NOT_DEFINED",
      "project_id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
      "start_date": "2024-01-01T03:00:00Z",
      "status": "OPEN",
      "title": "Deploy new payment service",
      "type": "CHANGE_REQUEST"
    },
    "id": "CHM-1234",
    "relationships": {
      "change_request_decisions": {
        "data": [
          {
            "id": "decision-id-0",
            "type": "change_request_decision"
          }
        ]
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "change_request"
  },
  "included": [
    {
      "attributes": {
        "email": "john.doe@example.com",
        "handle": "john.doe@example.com",
        "name": "John Doe"
      },
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "user"
    }
  ]
}
```

{% /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="404" %}
Not Found
{% 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
# 
 \# Path parameters export change_request_id="CHM-1234" \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/change-management/change-request/${change_request_id}/branch" \
-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": {
      "branch_name": "chm/CHM-1234",
      "repo_id": "DataDog/test-repo"
    },
    "type": "change_request_branch"
  }
}
EOF 
                
##### 

```python
"""
Create a change request branch returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.change_management_api import ChangeManagementApi
from datadog_api_client.v2.model.change_request_branch_create_attributes import ChangeRequestBranchCreateAttributes
from datadog_api_client.v2.model.change_request_branch_create_data import ChangeRequestBranchCreateData
from datadog_api_client.v2.model.change_request_branch_create_request import ChangeRequestBranchCreateRequest
from datadog_api_client.v2.model.change_request_branch_resource_type import ChangeRequestBranchResourceType

body = ChangeRequestBranchCreateRequest(
    data=ChangeRequestBranchCreateData(
        attributes=ChangeRequestBranchCreateAttributes(
            branch_name="chm/CHM-1234",
            repo_id="DataDog/dd-source",
        ),
        type=ChangeRequestBranchResourceType.CHANGE_REQUEST_BRANCH,
    ),
)

configuration = Configuration()
configuration.unstable_operations["create_change_request_branch"] = True
with ApiClient(configuration) as api_client:
    api_instance = ChangeManagementApi(api_client)
    response = api_instance.create_change_request_branch(change_request_id="change_request_id", body=body)

    print(response)
```

#### Instructions

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

```ruby
# Create a change request branch returns "OK" response

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

body = DatadogAPIClient::V2::ChangeRequestBranchCreateRequest.new({
  data: DatadogAPIClient::V2::ChangeRequestBranchCreateData.new({
    attributes: DatadogAPIClient::V2::ChangeRequestBranchCreateAttributes.new({
      branch_name: "chm/CHM-1234",
      repo_id: "DataDog/dd-source",
    }),
    type: DatadogAPIClient::V2::ChangeRequestBranchResourceType::CHANGE_REQUEST_BRANCH,
  }),
})
p api_instance.create_change_request_branch("change_request_id", body)
```

#### Instructions

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

```go
// Create a change request branch 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.ChangeRequestBranchCreateRequest{
		Data: datadogV2.ChangeRequestBranchCreateData{
			Attributes: datadogV2.ChangeRequestBranchCreateAttributes{
				BranchName: "chm/CHM-1234",
				RepoId:     "DataDog/dd-source",
			},
			Type: datadogV2.CHANGEREQUESTBRANCHRESOURCETYPE_CHANGE_REQUEST_BRANCH,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.CreateChangeRequestBranch", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewChangeManagementApi(apiClient)
	resp, r, err := api.CreateChangeRequestBranch(ctx, "change_request_id", body)

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

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

#### Instructions

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

```java
// Create a change request branch returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ChangeManagementApi;
import com.datadog.api.client.v2.model.ChangeRequestBranchCreateAttributes;
import com.datadog.api.client.v2.model.ChangeRequestBranchCreateData;
import com.datadog.api.client.v2.model.ChangeRequestBranchCreateRequest;
import com.datadog.api.client.v2.model.ChangeRequestBranchResourceType;
import com.datadog.api.client.v2.model.ChangeRequestResponse;

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

    ChangeRequestBranchCreateRequest body =
        new ChangeRequestBranchCreateRequest()
            .data(
                new ChangeRequestBranchCreateData()
                    .attributes(
                        new ChangeRequestBranchCreateAttributes()
                            .branchName("chm/CHM-1234")
                            .repoId("DataDog/dd-source"))
                    .type(ChangeRequestBranchResourceType.CHANGE_REQUEST_BRANCH));

    try {
      ChangeRequestResponse result = apiInstance.createChangeRequestBranch("CHM-1234", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ChangeManagementApi#createChangeRequestBranch");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

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

```rust
// Create a change request branch returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_change_management::ChangeManagementAPI;
use datadog_api_client::datadogV2::model::ChangeRequestBranchCreateAttributes;
use datadog_api_client::datadogV2::model::ChangeRequestBranchCreateData;
use datadog_api_client::datadogV2::model::ChangeRequestBranchCreateRequest;
use datadog_api_client::datadogV2::model::ChangeRequestBranchResourceType;

#[tokio::main]
async fn main() {
    let body = ChangeRequestBranchCreateRequest::new(ChangeRequestBranchCreateData::new(
        ChangeRequestBranchCreateAttributes::new(
            "chm/CHM-1234".to_string(),
            "DataDog/dd-source".to_string(),
        ),
        ChangeRequestBranchResourceType::CHANGE_REQUEST_BRANCH,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.CreateChangeRequestBranch", true);
    let api = ChangeManagementAPI::with_config(configuration);
    let resp = api
        .create_change_request_branch("change_request_id".to_string(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

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

```typescript
/**
 * Create a change request branch returns "OK" response
 */

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

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

const params: v2.ChangeManagementApiCreateChangeRequestBranchRequest = {
  body: {
    data: {
      attributes: {
        branchName: "chm/CHM-1234",
        repoId: "DataDog/dd-source",
      },
      type: "change_request_branch",
    },
  },
  changeRequestId: "change_request_id",
};

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

#### Instructions

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

## Update a change request decision{% #update-a-change-request-decision %}

{% tab title="v2" %}
**Note**: This endpoint is in preview 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/change-management/change-request/{change_request_id}/decisions/{decision_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}      |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}  |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id} |

### Overview

Update a decision on a change request, such as approving or declining it.

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



### Arguments

#### Path Parameters

| Name                                | Type   | Description                                    |
| ----------------------------------- | ------ | ---------------------------------------------- |
| change_request_id [*required*] | string | The identifier of the change request.          |
| decision_id [*required*]       | string | The identifier of the change request decision. |

### Request

#### Body Data (required)

Decision update payload.

{% tab title="Model" %}

| Parent field             | Field                                      | Type     | Description                                                                                 |
| ------------------------ | ------------------------------------------ | -------- | ------------------------------------------------------------------------------------------- |
|                          | data [*required*]                     | object   | Data object to update a change request decision.                                            |
| data                     | attributes                                 | object   | Attributes of the parent change request for a decision update.                              |
| attributes               | id                                         | string   | The identifier of the change request.                                                       |
| data                     | relationships                              | object   | Relationships for updating a change request decision.                                       |
| relationships            | change_request_decisions [*required*] | object   | Relationship to change request decisions.                                                   |
| change_request_decisions | data [*required*]                     | [object] | Array of decision relationship data.                                                        |
| data                     | id [*required*]                       | string   | The decision UUID.                                                                          |
| data                     | type [*required*]                     | enum     | Change request decision resource type. Allowed enum values: `change_request_decision`       |
| data                     | type [*required*]                     | enum     | Change request resource type. Allowed enum values: `change_request`                         |
|                          | included                                   | [object] | Included resources for the change request update.                                           |
| included                 | attributes                                 | object   | Attributes for creating a change request decision.                                          |
| attributes               | change_request_status                      | enum     | The status of a change request decision. Allowed enum values: `REQUESTED,APPROVED,DECLINED` |
| attributes               | request_reason                             | string   | The reason for requesting the decision.                                                     |
| included                 | id [*required*]                       | string   | The decision identifier.                                                                    |
| included                 | relationships                              | object   | Relationships for creating a change request decision.                                       |
| relationships            | requested_user                             | object   | Relationship to a user.                                                                     |
| requested_user           | data [*required*]                     | object   | User relationship data.                                                                     |
| data                     | id [*required*]                       | string   | The user UUID.                                                                              |
| data                     | type [*required*]                     | string   | The user resource type.                                                                     |
| included                 | type [*required*]                     | enum     | Change request decision resource type. Allowed enum values: `change_request_decision`       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "id": "CHM-1234"
    },
    "relationships": {
      "change_request_decisions": {
        "data": [
          {
            "id": "decision-id-0",
            "type": "change_request_decision"
          }
        ]
      }
    },
    "type": "change_request"
  },
  "included": [
    {
      "attributes": {
        "change_request_status": "REQUESTED",
        "request_reason": "Please review and approve this change"
      },
      "id": "decision-id-0",
      "relationships": {
        "requested_user": {
          "data": {
            "id": "00000000-0000-0000-0000-000000000000",
            "type": "user"
          }
        }
      },
      "type": "change_request_decision"
    }
  ]
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response object for a change request.

| Parent field             | Field                                                     | Type            | Description                                                                                 |
| ------------------------ | --------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------- |
|                          | data [*required*]                                    | object          | Data object for a change request response.                                                  |
| data                     | attributes [*required*]                              | object          | Attributes of a change request response.                                                    |
| attributes               | archived_at                                               | date-time       | Timestamp of when the change request was archived.                                          |
| attributes               | attributes [*required*]                              | object          | Custom attributes of the change request as key-value pairs.                                 |
| additionalProperties     | <any-key>                                                 | [string]        |
| attributes               | change_request_linked_incident_uuid [*required*]     | string          | The UUID of the linked incident.                                                            |
| attributes               | change_request_maintenance_window_query [*required*] | string          | The maintenance window query for the change request.                                        |
| attributes               | change_request_plan [*required*]                     | string          | The plan associated with the change request.                                                |
| attributes               | change_request_risk [*required*]                     | enum            | The risk level of the change request. Allowed enum values: `UNDEFINED,LOW,MEDIUM,HIGH`      |
| attributes               | change_request_type [*required*]                     | enum            | The type of the change request. Allowed enum values: `NORMAL,STANDARD,EMERGENCY`            |
| attributes               | closed_at                                                 | date-time       | Timestamp of when the change request was closed.                                            |
| attributes               | created_at [*required*]                              | date-time       | Timestamp of when the change request was created.                                           |
| attributes               | creation_source [*required*]                         | string          | The source from which the change request was created.                                       |
| attributes               | description [*required*]                             | string          | The description of the change request.                                                      |
| attributes               | end_date                                                  | date-time       | The planned end date of the change request.                                                 |
| attributes               | key [*required*]                                     | string          | The human-readable key of the change request.                                               |
| attributes               | modified_at [*required*]                             | date-time       | Timestamp of when the change request was last modified.                                     |
| attributes               | plan_notebook_id [*required*]                        | int64           | The notebook ID associated with the change request plan.                                    |
| attributes               | priority [*required*]                                | string          | The priority of the change request.                                                         |
| attributes               | project_id [*required*]                              | string          | The project UUID associated with the change request.                                        |
| attributes               | start_date                                                | date-time       | The planned start date of the change request.                                               |
| attributes               | status [*required*]                                  | string          | The current status of the change request.                                                   |
| attributes               | title [*required*]                                   | string          | The title of the change request.                                                            |
| attributes               | type [*required*]                                    | string          | The case type.                                                                              |
| data                     | id [*required*]                                      | string          | The identifier of the change request.                                                       |
| data                     | relationships                                             | object          | Relationships of a change request.                                                          |
| relationships            | change_request_decisions [*required*]                | object          | Relationship to change request decisions.                                                   |
| change_request_decisions | data [*required*]                                    | [object]        | Array of decision relationship data.                                                        |
| data                     | id [*required*]                                      | string          | The decision UUID.                                                                          |
| data                     | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |
| relationships            | created_by [*required*]                              | object          | Relationship to a user.                                                                     |
| created_by               | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| data                     | type [*required*]                                    | enum            | Change request resource type. Allowed enum values: `change_request`                         |
|                          | included                                                  | [ <oneOf>] | Included resources related to the change request.                                           |
| included                 | Option 1                                                  | object          | An included user resource.                                                                  |
| Option 1                 | attributes [*required*]                              | object          | Attributes of an included user.                                                             |
| attributes               | email [*required*]                                   | string          | The email of the user.                                                                      |
| attributes               | handle [*required*]                                  | string          | The handle of the user.                                                                     |
| attributes               | name [*required*]                                    | string          | The name of the user.                                                                       |
| Option 1                 | id [*required*]                                      | string          | The user UUID.                                                                              |
| Option 1                 | type [*required*]                                    | string          | The resource type.                                                                          |
| included                 | Option 2                                                  | object          | An included change request decision resource.                                               |
| Option 2                 | attributes [*required*]                              | object          | Attributes of a change request decision in a response.                                      |
| attributes               | change_request_status [*required*]                   | enum            | The status of a change request decision. Allowed enum values: `REQUESTED,APPROVED,DECLINED` |
| attributes               | decided_at [*required*]                              | date-time       | Timestamp of when the decision was made.                                                    |
| attributes               | decision_reason [*required*]                         | string          | The reason for the decision.                                                                |
| attributes               | deleted_at [*required*]                              | date-time       | Timestamp of when the decision was deleted.                                                 |
| attributes               | request_reason [*required*]                          | string          | The reason for requesting the decision.                                                     |
| attributes               | requested_at [*required*]                            | date-time       | Timestamp of when the decision was requested.                                               |
| Option 2                 | id [*required*]                                      | string          | The decision UUID.                                                                          |
| Option 2                 | relationships                                             | object          | Relationships of a change request decision.                                                 |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_by_user [*required*]                       | object          | Relationship to a user.                                                                     |
| requested_by_user        | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_user [*required*]                          | object          | Relationship to a user.                                                                     |
| requested_user           | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| Option 2                 | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "change_request_linked_incident_uuid": "",
      "change_request_maintenance_window_query": "",
      "change_request_plan": "",
      "change_request_risk": "LOW",
      "change_request_type": "NORMAL",
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2024-01-01T00:00:00Z",
      "creation_source": "CS_MANUAL",
      "description": "Deploying new payment service v2.1",
      "end_date": "2024-01-02T15:00:00Z",
      "key": "CHM-1234",
      "modified_at": "2024-01-01T00:00:00Z",
      "plan_notebook_id": 0,
      "priority": "NOT_DEFINED",
      "project_id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
      "start_date": "2024-01-01T03:00:00Z",
      "status": "OPEN",
      "title": "Deploy new payment service",
      "type": "CHANGE_REQUEST"
    },
    "id": "CHM-1234",
    "relationships": {
      "change_request_decisions": {
        "data": [
          {
            "id": "decision-id-0",
            "type": "change_request_decision"
          }
        ]
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "change_request"
  },
  "included": [
    {
      "attributes": {
        "email": "john.doe@example.com",
        "handle": "john.doe@example.com",
        "name": "John Doe"
      },
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "user"
    }
  ]
}
```

{% /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="404" %}
Not Found
{% 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
# 
 \# Path parameters export change_request_id="CHM-1234" export decision_id="decision-id-0" \# Curl command curl -X PATCH "https://api.datadoghq.com/api/v2/change-management/change-request/${change_request_id}/decisions/${decision_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": {
      "id": "CHM-1234"
    },
    "relationships": {
      "change_request_decisions": {
        "data": [
          {
            "id": "decision-id-0"
          }
        ]
      }
    },
    "type": "change_request"
  },
  "included": [
    {
      "attributes": {
        "change_request_status": "REQUESTED",
        "request_reason": "Please review and approve this change"
      },
      "id": "decision-id-0",
      "type": "change_request_decision"
    }
  ]
}
EOF 
                
##### 

```python
"""
Update a change request decision returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.change_management_api import ChangeManagementApi
from datadog_api_client.v2.model.change_request_decision_create_attributes import ChangeRequestDecisionCreateAttributes
from datadog_api_client.v2.model.change_request_decision_create_item import ChangeRequestDecisionCreateItem
from datadog_api_client.v2.model.change_request_decision_create_relationships import (
    ChangeRequestDecisionCreateRelationships,
)
from datadog_api_client.v2.model.change_request_decision_relationship_data import ChangeRequestDecisionRelationshipData
from datadog_api_client.v2.model.change_request_decision_resource_type import ChangeRequestDecisionResourceType
from datadog_api_client.v2.model.change_request_decision_status_type import ChangeRequestDecisionStatusType
from datadog_api_client.v2.model.change_request_decision_update_data import ChangeRequestDecisionUpdateData
from datadog_api_client.v2.model.change_request_decision_update_data_attributes import (
    ChangeRequestDecisionUpdateDataAttributes,
)
from datadog_api_client.v2.model.change_request_decision_update_data_relationships import (
    ChangeRequestDecisionUpdateDataRelationships,
)
from datadog_api_client.v2.model.change_request_decision_update_request import ChangeRequestDecisionUpdateRequest
from datadog_api_client.v2.model.change_request_decisions_relationship import ChangeRequestDecisionsRelationship
from datadog_api_client.v2.model.change_request_resource_type import ChangeRequestResourceType
from datadog_api_client.v2.model.change_request_user_relationship import ChangeRequestUserRelationship
from datadog_api_client.v2.model.change_request_user_relationship_data import ChangeRequestUserRelationshipData

body = ChangeRequestDecisionUpdateRequest(
    data=ChangeRequestDecisionUpdateData(
        attributes=ChangeRequestDecisionUpdateDataAttributes(
            id="CHM-1234",
        ),
        relationships=ChangeRequestDecisionUpdateDataRelationships(
            change_request_decisions=ChangeRequestDecisionsRelationship(
                data=[
                    ChangeRequestDecisionRelationshipData(
                        id="decision-id-0",
                        type=ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION,
                    ),
                ],
            ),
        ),
        type=ChangeRequestResourceType.CHANGE_REQUEST,
    ),
    included=[
        ChangeRequestDecisionCreateItem(
            attributes=ChangeRequestDecisionCreateAttributes(
                change_request_status=ChangeRequestDecisionStatusType.REQUESTED,
                request_reason="Please review and approve this change",
            ),
            id="decision-id-0",
            relationships=ChangeRequestDecisionCreateRelationships(
                requested_user=ChangeRequestUserRelationship(
                    data=ChangeRequestUserRelationshipData(
                        id="00000000-0000-0000-0000-000000000000",
                        type="user",
                    ),
                ),
            ),
            type=ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION,
        ),
    ],
)

configuration = Configuration()
configuration.unstable_operations["update_change_request_decision"] = True
with ApiClient(configuration) as api_client:
    api_instance = ChangeManagementApi(api_client)
    response = api_instance.update_change_request_decision(
        change_request_id="change_request_id", decision_id="decision_id", body=body
    )

    print(response)
```

#### Instructions

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

```ruby
# Update a change request decision returns "OK" response

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

body = DatadogAPIClient::V2::ChangeRequestDecisionUpdateRequest.new({
  data: DatadogAPIClient::V2::ChangeRequestDecisionUpdateData.new({
    attributes: DatadogAPIClient::V2::ChangeRequestDecisionUpdateDataAttributes.new({
      id: "CHM-1234",
    }),
    relationships: DatadogAPIClient::V2::ChangeRequestDecisionUpdateDataRelationships.new({
      change_request_decisions: DatadogAPIClient::V2::ChangeRequestDecisionsRelationship.new({
        data: [
          DatadogAPIClient::V2::ChangeRequestDecisionRelationshipData.new({
            id: "decision-id-0",
            type: DatadogAPIClient::V2::ChangeRequestDecisionResourceType::CHANGE_REQUEST_DECISION,
          }),
        ],
      }),
    }),
    type: DatadogAPIClient::V2::ChangeRequestResourceType::CHANGE_REQUEST,
  }),
  included: [
    DatadogAPIClient::V2::ChangeRequestDecisionCreateItem.new({
      attributes: DatadogAPIClient::V2::ChangeRequestDecisionCreateAttributes.new({
        change_request_status: DatadogAPIClient::V2::ChangeRequestDecisionStatusType::REQUESTED,
        request_reason: "Please review and approve this change",
      }),
      id: "decision-id-0",
      relationships: DatadogAPIClient::V2::ChangeRequestDecisionCreateRelationships.new({
        requested_user: DatadogAPIClient::V2::ChangeRequestUserRelationship.new({
          data: DatadogAPIClient::V2::ChangeRequestUserRelationshipData.new({
            id: "00000000-0000-0000-0000-000000000000",
            type: "user",
          }),
        }),
      }),
      type: DatadogAPIClient::V2::ChangeRequestDecisionResourceType::CHANGE_REQUEST_DECISION,
    }),
  ],
})
p api_instance.update_change_request_decision("change_request_id", "decision_id", body)
```

#### Instructions

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

```go
// Update a change request decision 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.ChangeRequestDecisionUpdateRequest{
		Data: datadogV2.ChangeRequestDecisionUpdateData{
			Attributes: &datadogV2.ChangeRequestDecisionUpdateDataAttributes{
				Id: datadog.PtrString("CHM-1234"),
			},
			Relationships: &datadogV2.ChangeRequestDecisionUpdateDataRelationships{
				ChangeRequestDecisions: datadogV2.ChangeRequestDecisionsRelationship{
					Data: []datadogV2.ChangeRequestDecisionRelationshipData{
						{
							Id:   "decision-id-0",
							Type: datadogV2.CHANGEREQUESTDECISIONRESOURCETYPE_CHANGE_REQUEST_DECISION,
						},
					},
				},
			},
			Type: datadogV2.CHANGEREQUESTRESOURCETYPE_CHANGE_REQUEST,
		},
		Included: []datadogV2.ChangeRequestDecisionCreateItem{
			{
				Attributes: &datadogV2.ChangeRequestDecisionCreateAttributes{
					ChangeRequestStatus: datadogV2.CHANGEREQUESTDECISIONSTATUSTYPE_REQUESTED.Ptr(),
					RequestReason:       datadog.PtrString("Please review and approve this change"),
				},
				Id: "decision-id-0",
				Relationships: &datadogV2.ChangeRequestDecisionCreateRelationships{
					RequestedUser: &datadogV2.ChangeRequestUserRelationship{
						Data: *datadogV2.NewNullableChangeRequestUserRelationshipData(&datadogV2.ChangeRequestUserRelationshipData{
							Id:   "00000000-0000-0000-0000-000000000000",
							Type: "user",
						}),
					},
				},
				Type: datadogV2.CHANGEREQUESTDECISIONRESOURCETYPE_CHANGE_REQUEST_DECISION,
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateChangeRequestDecision", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewChangeManagementApi(apiClient)
	resp, r, err := api.UpdateChangeRequestDecision(ctx, "change_request_id", "decision_id", body)

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

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

#### Instructions

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

```java
// Update a change request decision returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ChangeManagementApi;
import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateAttributes;
import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateItem;
import com.datadog.api.client.v2.model.ChangeRequestDecisionCreateRelationships;
import com.datadog.api.client.v2.model.ChangeRequestDecisionRelationshipData;
import com.datadog.api.client.v2.model.ChangeRequestDecisionResourceType;
import com.datadog.api.client.v2.model.ChangeRequestDecisionStatusType;
import com.datadog.api.client.v2.model.ChangeRequestDecisionUpdateData;
import com.datadog.api.client.v2.model.ChangeRequestDecisionUpdateDataAttributes;
import com.datadog.api.client.v2.model.ChangeRequestDecisionUpdateDataRelationships;
import com.datadog.api.client.v2.model.ChangeRequestDecisionUpdateRequest;
import com.datadog.api.client.v2.model.ChangeRequestDecisionsRelationship;
import com.datadog.api.client.v2.model.ChangeRequestResourceType;
import com.datadog.api.client.v2.model.ChangeRequestResponse;
import com.datadog.api.client.v2.model.ChangeRequestUserRelationship;
import com.datadog.api.client.v2.model.ChangeRequestUserRelationshipData;
import java.util.Collections;

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

    ChangeRequestDecisionUpdateRequest body =
        new ChangeRequestDecisionUpdateRequest()
            .data(
                new ChangeRequestDecisionUpdateData()
                    .attributes(new ChangeRequestDecisionUpdateDataAttributes().id("CHM-1234"))
                    .relationships(
                        new ChangeRequestDecisionUpdateDataRelationships()
                            .changeRequestDecisions(
                                new ChangeRequestDecisionsRelationship()
                                    .data(
                                        Collections.singletonList(
                                            new ChangeRequestDecisionRelationshipData()
                                                .id("decision-id-0")
                                                .type(
                                                    ChangeRequestDecisionResourceType
                                                        .CHANGE_REQUEST_DECISION)))))
                    .type(ChangeRequestResourceType.CHANGE_REQUEST))
            .included(
                Collections.singletonList(
                    new ChangeRequestDecisionCreateItem()
                        .attributes(
                            new ChangeRequestDecisionCreateAttributes()
                                .changeRequestStatus(ChangeRequestDecisionStatusType.REQUESTED)
                                .requestReason("Please review and approve this change"))
                        .id("decision-id-0")
                        .relationships(
                            new ChangeRequestDecisionCreateRelationships()
                                .requestedUser(
                                    new ChangeRequestUserRelationship()
                                        .data(
                                            new ChangeRequestUserRelationshipData()
                                                .id("00000000-0000-0000-0000-000000000000")
                                                .type("user"))))
                        .type(ChangeRequestDecisionResourceType.CHANGE_REQUEST_DECISION)));

    try {
      ChangeRequestResponse result =
          apiInstance.updateChangeRequestDecision("CHM-1234", "decision-id-0", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ChangeManagementApi#updateChangeRequestDecision");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

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

```rust
// Update a change request decision returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_change_management::ChangeManagementAPI;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionCreateAttributes;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionCreateItem;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionCreateRelationships;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionRelationshipData;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionResourceType;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionStatusType;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionUpdateData;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionUpdateDataAttributes;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionUpdateDataRelationships;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionUpdateRequest;
use datadog_api_client::datadogV2::model::ChangeRequestDecisionsRelationship;
use datadog_api_client::datadogV2::model::ChangeRequestResourceType;
use datadog_api_client::datadogV2::model::ChangeRequestUserRelationship;
use datadog_api_client::datadogV2::model::ChangeRequestUserRelationshipData;

#[tokio::main]
async fn main() {
    let body = ChangeRequestDecisionUpdateRequest::new(
        ChangeRequestDecisionUpdateData::new(ChangeRequestResourceType::CHANGE_REQUEST)
            .attributes(ChangeRequestDecisionUpdateDataAttributes::new().id("CHM-1234".to_string()))
            .relationships(ChangeRequestDecisionUpdateDataRelationships::new(
                ChangeRequestDecisionsRelationship::new(vec![
                    ChangeRequestDecisionRelationshipData::new(
                        "decision-id-0".to_string(),
                        ChangeRequestDecisionResourceType::CHANGE_REQUEST_DECISION,
                    ),
                ]),
            )),
    )
    .included(vec![ChangeRequestDecisionCreateItem::new(
        "decision-id-0".to_string(),
        ChangeRequestDecisionResourceType::CHANGE_REQUEST_DECISION,
    )
    .attributes(
        ChangeRequestDecisionCreateAttributes::new()
            .change_request_status(ChangeRequestDecisionStatusType::REQUESTED)
            .request_reason("Please review and approve this change".to_string()),
    )
    .relationships(
        ChangeRequestDecisionCreateRelationships::new().requested_user(
            ChangeRequestUserRelationship::new(Some(ChangeRequestUserRelationshipData::new(
                "00000000-0000-0000-0000-000000000000".to_string(),
                "user".to_string(),
            ))),
        ),
    )]);
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.UpdateChangeRequestDecision", true);
    let api = ChangeManagementAPI::with_config(configuration);
    let resp = api
        .update_change_request_decision(
            "change_request_id".to_string(),
            "decision_id".to_string(),
            body,
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

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

```typescript
/**
 * Update a change request decision returns "OK" response
 */

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

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

const params: v2.ChangeManagementApiUpdateChangeRequestDecisionRequest = {
  body: {
    data: {
      attributes: {
        id: "CHM-1234",
      },
      relationships: {
        changeRequestDecisions: {
          data: [
            {
              id: "decision-id-0",
              type: "change_request_decision",
            },
          ],
        },
      },
      type: "change_request",
    },
    included: [
      {
        attributes: {
          changeRequestStatus: "REQUESTED",
          requestReason: "Please review and approve this change",
        },
        id: "decision-id-0",
        relationships: {
          requestedUser: {
            data: {
              id: "00000000-0000-0000-0000-000000000000",
              type: "user",
            },
          },
        },
        type: "change_request_decision",
      },
    ],
  },
  changeRequestId: "change_request_id",
  decisionId: "decision_id",
};

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

#### Instructions

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

## Delete a change request decision{% #delete-a-change-request-decision %}

{% tab title="v2" %}
**Note**: This endpoint is in preview 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/change-management/change-request/{change_request_id}/decisions/{decision_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}      |
| us2.ddog-gov.com  | DELETE https://api.us2.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}  |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id} |

### Overview

Delete a decision from a change request.

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



### Arguments

#### Path Parameters

| Name                                | Type   | Description                                    |
| ----------------------------------- | ------ | ---------------------------------------------- |
| change_request_id [*required*] | string | The identifier of the change request.          |
| decision_id [*required*]       | string | The identifier of the change request decision. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response object for a change request.

| Parent field             | Field                                                     | Type            | Description                                                                                 |
| ------------------------ | --------------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------- |
|                          | data [*required*]                                    | object          | Data object for a change request response.                                                  |
| data                     | attributes [*required*]                              | object          | Attributes of a change request response.                                                    |
| attributes               | archived_at                                               | date-time       | Timestamp of when the change request was archived.                                          |
| attributes               | attributes [*required*]                              | object          | Custom attributes of the change request as key-value pairs.                                 |
| additionalProperties     | <any-key>                                                 | [string]        |
| attributes               | change_request_linked_incident_uuid [*required*]     | string          | The UUID of the linked incident.                                                            |
| attributes               | change_request_maintenance_window_query [*required*] | string          | The maintenance window query for the change request.                                        |
| attributes               | change_request_plan [*required*]                     | string          | The plan associated with the change request.                                                |
| attributes               | change_request_risk [*required*]                     | enum            | The risk level of the change request. Allowed enum values: `UNDEFINED,LOW,MEDIUM,HIGH`      |
| attributes               | change_request_type [*required*]                     | enum            | The type of the change request. Allowed enum values: `NORMAL,STANDARD,EMERGENCY`            |
| attributes               | closed_at                                                 | date-time       | Timestamp of when the change request was closed.                                            |
| attributes               | created_at [*required*]                              | date-time       | Timestamp of when the change request was created.                                           |
| attributes               | creation_source [*required*]                         | string          | The source from which the change request was created.                                       |
| attributes               | description [*required*]                             | string          | The description of the change request.                                                      |
| attributes               | end_date                                                  | date-time       | The planned end date of the change request.                                                 |
| attributes               | key [*required*]                                     | string          | The human-readable key of the change request.                                               |
| attributes               | modified_at [*required*]                             | date-time       | Timestamp of when the change request was last modified.                                     |
| attributes               | plan_notebook_id [*required*]                        | int64           | The notebook ID associated with the change request plan.                                    |
| attributes               | priority [*required*]                                | string          | The priority of the change request.                                                         |
| attributes               | project_id [*required*]                              | string          | The project UUID associated with the change request.                                        |
| attributes               | start_date                                                | date-time       | The planned start date of the change request.                                               |
| attributes               | status [*required*]                                  | string          | The current status of the change request.                                                   |
| attributes               | title [*required*]                                   | string          | The title of the change request.                                                            |
| attributes               | type [*required*]                                    | string          | The case type.                                                                              |
| data                     | id [*required*]                                      | string          | The identifier of the change request.                                                       |
| data                     | relationships                                             | object          | Relationships of a change request.                                                          |
| relationships            | change_request_decisions [*required*]                | object          | Relationship to change request decisions.                                                   |
| change_request_decisions | data [*required*]                                    | [object]        | Array of decision relationship data.                                                        |
| data                     | id [*required*]                                      | string          | The decision UUID.                                                                          |
| data                     | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |
| relationships            | created_by [*required*]                              | object          | Relationship to a user.                                                                     |
| created_by               | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| data                     | type [*required*]                                    | enum            | Change request resource type. Allowed enum values: `change_request`                         |
|                          | included                                                  | [ <oneOf>] | Included resources related to the change request.                                           |
| included                 | Option 1                                                  | object          | An included user resource.                                                                  |
| Option 1                 | attributes [*required*]                              | object          | Attributes of an included user.                                                             |
| attributes               | email [*required*]                                   | string          | The email of the user.                                                                      |
| attributes               | handle [*required*]                                  | string          | The handle of the user.                                                                     |
| attributes               | name [*required*]                                    | string          | The name of the user.                                                                       |
| Option 1                 | id [*required*]                                      | string          | The user UUID.                                                                              |
| Option 1                 | type [*required*]                                    | string          | The resource type.                                                                          |
| included                 | Option 2                                                  | object          | An included change request decision resource.                                               |
| Option 2                 | attributes [*required*]                              | object          | Attributes of a change request decision in a response.                                      |
| attributes               | change_request_status [*required*]                   | enum            | The status of a change request decision. Allowed enum values: `REQUESTED,APPROVED,DECLINED` |
| attributes               | decided_at [*required*]                              | date-time       | Timestamp of when the decision was made.                                                    |
| attributes               | decision_reason [*required*]                         | string          | The reason for the decision.                                                                |
| attributes               | deleted_at [*required*]                              | date-time       | Timestamp of when the decision was deleted.                                                 |
| attributes               | request_reason [*required*]                          | string          | The reason for requesting the decision.                                                     |
| attributes               | requested_at [*required*]                            | date-time       | Timestamp of when the decision was requested.                                               |
| Option 2                 | id [*required*]                                      | string          | The decision UUID.                                                                          |
| Option 2                 | relationships                                             | object          | Relationships of a change request decision.                                                 |
| relationships            | modified_by [*required*]                             | object          | Relationship to a user.                                                                     |
| modified_by              | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_by_user [*required*]                       | object          | Relationship to a user.                                                                     |
| requested_by_user        | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| relationships            | requested_user [*required*]                          | object          | Relationship to a user.                                                                     |
| requested_user           | data [*required*]                                    | object          | User relationship data.                                                                     |
| data                     | id [*required*]                                      | string          | The user UUID.                                                                              |
| data                     | type [*required*]                                    | string          | The user resource type.                                                                     |
| Option 2                 | type [*required*]                                    | enum            | Change request decision resource type. Allowed enum values: `change_request_decision`       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "change_request_linked_incident_uuid": "",
      "change_request_maintenance_window_query": "",
      "change_request_plan": "",
      "change_request_risk": "LOW",
      "change_request_type": "NORMAL",
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2024-01-01T00:00:00Z",
      "creation_source": "CS_MANUAL",
      "description": "Deploying new payment service v2.1",
      "end_date": "2024-01-02T15:00:00Z",
      "key": "CHM-1234",
      "modified_at": "2024-01-01T00:00:00Z",
      "plan_notebook_id": 0,
      "priority": "NOT_DEFINED",
      "project_id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
      "start_date": "2024-01-01T03:00:00Z",
      "status": "OPEN",
      "title": "Deploy new payment service",
      "type": "CHANGE_REQUEST"
    },
    "id": "CHM-1234",
    "relationships": {
      "change_request_decisions": {
        "data": [
          {
            "id": "decision-id-0",
            "type": "change_request_decision"
          }
        ]
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "change_request"
  },
  "included": [
    {
      "attributes": {
        "email": "john.doe@example.com",
        "handle": "john.doe@example.com",
        "name": "John Doe"
      },
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "user"
    }
  ]
}
```

{% /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="404" %}
Not Found
{% 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 parameters export change_request_id="CHM-1234" export decision_id="decision-id-0" \# Curl command curl -X DELETE "https://api.datadoghq.com/api/v2/change-management/change-request/${change_request_id}/decisions/${decision_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Delete a change request decision returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.change_management_api import ChangeManagementApi

configuration = Configuration()
configuration.unstable_operations["delete_change_request_decision"] = True
with ApiClient(configuration) as api_client:
    api_instance = ChangeManagementApi(api_client)
    response = api_instance.delete_change_request_decision(
        change_request_id="change_request_id",
        decision_id="decision_id",
    )

    print(response)
```

#### Instructions

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

```ruby
# Delete a change request decision returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.delete_change_request_decision".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ChangeManagementAPI.new
p api_instance.delete_change_request_decision("change_request_id", "decision_id")
```

#### Instructions

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

```go
// Delete a change request decision 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.DeleteChangeRequestDecision", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewChangeManagementApi(apiClient)
	resp, r, err := api.DeleteChangeRequestDecision(ctx, "change_request_id", "decision_id")

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

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

#### Instructions

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

```java
// Delete a change request decision returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ChangeManagementApi;
import com.datadog.api.client.v2.model.ChangeRequestResponse;

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

    try {
      ChangeRequestResponse result =
          apiInstance.deleteChangeRequestDecision("CHM-1234", "decision-id-0");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ChangeManagementApi#deleteChangeRequestDecision");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

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

```rust
// Delete a change request decision returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_change_management::ChangeManagementAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteChangeRequestDecision", true);
    let api = ChangeManagementAPI::with_config(configuration);
    let resp = api
        .delete_change_request_decision("change_request_id".to_string(), "decision_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.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Delete a change request decision returns "OK" response
 */

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

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

const params: v2.ChangeManagementApiDeleteChangeRequestDecisionRequest = {
  changeRequestId: "change_request_id",
  decisionId: "decision_id",
};

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

#### Instructions

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