---
title: "Update deployment"
method: PATCH
path: "/api/v2/engineering-insights/deployments/{deploymentID}"
tags: ["Insights deployments (beta)"]
---

# Update deployment

`PATCH /api/v2/engineering-insights/deployments/{deploymentID}`

Update a deployment by ID. Updating a deployment uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](https://launchdarkly.com/docs/api#updates).<br/><br/>The deployment ID is returned as part of the [List deployments](https://launchdarkly.com/docs/api/insights-deployments-beta/get-deployments) response. It is the `id` field of each element in the `items` array.

## Path parameters

- `deploymentID` string, string, required — The deployment ID

## Request body

- PatchOperation[]
  - `op` string, required — The type of operation to perform
  - `path` string, required — A JSON Pointer string specifying the part of the document to operate on
  - `value` string — A JSON value used in "add", "replace", and "test" operations

## Response `200`

Deployment response

- DeploymentRep
  - `id` string, uuid, required — The deployment ID
  - `applicationKey` string, required — The application key
  - `applicationVersion` string, required — The application version
  - `startedAt` integer, required
  - `endedAt` integer
  - `durationMs` integer — The duration of the deployment in milliseconds
  - `status` string, required
  - `kind` string, required
  - `active` boolean, required — Whether the deployment is active
  - `metadata` object — The metadata associated with the deployment
  - `archived` boolean, required — Whether the deployment is archived
  - `environmentKey` string, required — The environment key
  - `numberOfContributors` integer, required — The number of contributors
  - `numberOfPullRequests` integer, required — The number of pull requests
  - `linesAdded` integer, required — The number of lines added
  - `linesDeleted` integer, required — The number of lines deleted
  - `leadTime` integer, required — The total lead time from first commit to deployment end in milliseconds
  - `pullRequests` PullRequestCollectionRep
    - `totalCount` integer, required — The total number of pull requests
    - `items` PullRequestRep[], required — A list of pull requests
      - `id` string, uuid, required — The pull request internal ID
      - `externalId` string, required — The pull request number
      - `title` string, required — The pull request title
      - `status` string, required — The pull request status
      - `author` string, required — The pull request author
      - `createTime` integer, required
      - `mergeTime` integer
      - `mergeCommitKey` string — The pull request merge commit key
      - `baseCommitKey` string, required — The pull request base commit key
      - `headCommitKey` string, required — The pull request head commit key
      - `filesChanged` integer, required — The number of files changed
      - `linesAdded` integer, required — The number of lines added
      - `linesDeleted` integer, required — The number of lines deleted
      - `url` string, required — The pull request URL
      - `deployments` DeploymentCollectionRep
        - `totalCount` integer, required — The total number of deployments
        - `items` DeploymentRep[], required — A list of deployments
        - `_links` object — The location and content type of related resources
      - `flagReferences` FlagReferenceCollectionRep
        - `totalCount` integer, required — The total number of flag references
        - `items` FlagReferenceRep[], required — A list of flag references
          - `projectKey` string, required — The project key
          - `flagKey` string, required — The flag key
          - `referencesAdded` integer, required — The number of references added
          - `referencesRemoved` integer, required — The number of references removed
      - `leadTime` PullRequestLeadTimeRep
        - `codingDurationMs` integer, required — The coding duration in milliseconds
        - `reviewDurationMs` integer — The review duration in milliseconds
        - `maxWaitDurationMs` integer — The max wait duration between merge time and deploy start time in milliseconds
        - `avgWaitDurationMs` integer — The average wait duration between merge time and deploy start time in milliseconds
        - `maxDeployDurationMs` integer — The max deploy duration in milliseconds
        - `avgDeployDurationMs` integer — The average deploy duration in milliseconds
        - `maxTotalLeadTimeMs` integer — The max total lead time in milliseconds
        - `avgTotalLeadTimeMs` integer — The average total lead time in milliseconds
    - `_links` object — The location and content type of related resources
  - `flagReferences` FlagReferenceCollectionRep
    - `totalCount` integer, required — The total number of flag references
    - `items` FlagReferenceRep[], required — A list of flag references
      - `projectKey` string, required — The project key
      - `flagKey` string, required — The flag key
      - `referencesAdded` integer, required — The number of references added
      - `referencesRemoved` integer, required — The number of references removed
  - `leadTimeStages` LeadTimeStagesRep
    - `codingDurationMs` integer, required — The coding duration in milliseconds
    - `reviewDurationMs` integer — The review duration in milliseconds
    - `waitDurationMs` integer — The wait duration between merge time and deploy start time in milliseconds
    - `deployDurationMs` integer — The deploy duration in milliseconds
    - `totalLeadTimeMs` integer — The total lead time in milliseconds

## Other responses

- `400` — Invalid request
- `401` — Invalid access token
- `403` — Forbidden
- `404` — Invalid resource identifier
- `429` — Rate limited

---

[API](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api.md) · [All operations](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/launchdarkly/launchdarkly-rest-api/revisions/69c5c9aafe78/schema)
