---
title: "Mark a deployment as failed by version"
method: PATCH
path: "/api/v2/dora/deployments"
tags: ["Delivery Performance"]
---

# Mark a deployment as failed by version

`PATCH /api/v2/dora/deployments`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/dora/deployments`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/dora/deployments/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update a deployment's change failure status, identifying the deployment by its service, environment, and version instead of its ID. Use this to mark a deployment as a change failure or back to stable. You can optionally include remediation details to enable failed deployment recovery time calculation. If multiple deployments match the given service, environment, and version, the most recently finished one is updated.

## Request body

- DORADeploymentPatchByVersionRequest: Request to patch a DORA deployment event identified by service, environment, and version.
  - `data` DORADeploymentPatchByVersionRequestData, required: The JSON:API data for patching a deployment identified by service, environment, and version.
    - `attributes` DORADeploymentPatchByVersionRequestAttributes, required: Attributes for patching a DORA deployment event identified by service, environment, and version.
      - `change_failure` boolean, required: Indicates whether the deployment resulted in a change failure.
      - `env` string, required: The environment the deployment was performed in.
      - `remediation` union: 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.
        - DORADeploymentPatchByVersionRemediationByID: Remediation details identified by the ID of the remediation deployment.
          - `id` string, required: The ID of the remediation deployment.
          - `type` 'rollback' | 'rollforward', required: The type of remediation action taken. Required when the failed deployment must be linked to a remediation deployment.
        - DORADeploymentPatchByVersionRemediationByVersion: Remediation details identified by the version of the remediation deployment, matched against the same service and environment as the failed deployment.
          - `type` 'rollback' | 'rollforward', required: The type of remediation action taken. Required when the failed deployment must be linked to a remediation deployment.
          - `version` string, required: The version of the remediation deployment.
      - `service` string, required: The name of the service that was deployed.
      - `version` string, required: The version deployed. This can be seen in the Service Catalog or in the APM Deployment Tracking.
    - `type` 'dora_deployment_patch_request', required: JSON:API type for DORA deployment patch request.

## Response `202`

Accepted

## Other responses

- `400`: Bad Request
- `403`: Not Authorized
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
