---
title: Patcher un événement de déploiement
description: Mettre à jour le statut d'échec de modification d'un déploiement.
breadcrumbs: Documentation > API > Patcher un événement de déploiement
---

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

# Patcher un événement de déploiement

## v2 (latest)

| Datadog site      | API endpoint                                                                |
| ----------------- | --------------------------------------------------------------------------- |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/dora/deployments/{deployment_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/dora/deployments/{deployment_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/dora/deployments/{deployment_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/dora/deployments/{deployment_id}      |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/dora/deployments/{deployment_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/dora/deployments/{deployment_id} |
| uk1.datadoghq.com | PATCH https://api.uk1.datadoghq.com/api/v2/dora/deployments/{deployment_id} |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/dora/deployments/{deployment_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/dora/deployments/{deployment_id}  |

### Overview

Mettre à jour le statut d'échec de modification d'un déploiement. Utilisez cette option pour marquer un déploiement comme un échec de modification ou le remettre en état stable. Vous pouvez éventuellement inclure des détails de remédiation pour permettre le calcul du temps de récupération après un déploiement en échec.

This endpoint requires the `dora_metrics_write` permission.

### Arguments

#### Path Parameters

| Field                      | Type   | Description                     |
| -------------------------- | ------ | ------------------------------- |
| deployment_id [*required*] | string | The ID of the deployment event. |

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                   | Type    | Description                                                                                                                                                                                         |
| ------------ | ----------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object  | La requête de patch d'un événement de déploiement DORA.                                                                                                                                             |
| data         | attributes [*required*] | object  | Attributes for patching a DORA deployment event.                                                                                                                                                    |
| attributes   | change_failure          | boolean | Indicates whether the deployment resulted in a change failure.                                                                                                                                      |
| attributes   | remediation             | object  | Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time. Specify either `id` or `version` to identify the remediation deployment, but not both. |
| remediation  | id                      | string  | The ID of the remediation deployment. Use this or `version` to identify the remediation deployment, but not both.                                                                                   |
| remediation  | type                    | enum    | The type of remediation action taken. Required when the failed deployment must be linked to a remediation deployment. Allowed enum values: `rollback`, `rollforward`.                               |
| remediation  | version                 | string  | The version of the remediation deployment, matched against the same service and environment as the failed deployment. Use this or `id` to identify the remediation deployment, but not both.        |
| data         | id [*required*]         | string  | The ID of the deployment to patch.                                                                                                                                                                  |
| data         | type [*required*]       | enum    | JSON:API type for DORA deployment patch request. Allowed enum values: `dora_deployment_patch_request`. Default: `dora_deployment_patch_request`.                                                    |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "change_failure": true,
      "remediation": {
        "id": "eG42zNIkVjM",
        "type": "rollback",
        "version": "v1.2.4"
      }
    },
    "id": "z_RwVLi7v4Y",
    "type": "dora_deployment_patch_request"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="202" %}
Accepted
{% /tab %}

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

{% tabs %}
{% tab label="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 label="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 %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Not Authorized

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

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

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

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

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

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

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

### Code Example

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

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/dora/deployments/${deployment_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "change_failure": true,
      "remediation": {
        "id": "eG42zNIkVjM",
        "type": "rollback"
      }
    },
    "id": "z_RwVLi7v4Y",
    "type": "dora_deployment_patch_request"
  }
}
EOF
```
{% /tab %}
{% /tabs %}
