---
title: "Patch release for flag"
method: PATCH
path: "/api/v2/flags/{projectKey}/{flagKey}/release"
tags: ["Releases (beta)"]
---

# Patch release for flag

`PATCH /api/v2/flags/{projectKey}/{flagKey}/release`

This endpoint is only available for releases that are part of a legacy release pipeline. Releases for new release pipelines should use the [Update phase status for release](https://launchdarkly.com/docs/api/releases-beta/update-phase-status) endpoint.

Update currently active release for a flag. Updating releases requires the [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) format. To learn more, read [Updates](https://launchdarkly.com/docs/api#updates).

You can only use this endpoint to mark a release phase complete or incomplete. To indicate which phase to update, use the array index in the `path`. For example, to mark the first phase of a release as complete, use the following request body:

```
  [
    {
      "op": "replace",
      "path": "/phase/0/complete",
      "value": true
    }
  ]
```

## Path parameters

- `projectKey` string, string, required — The project key
- `flagKey` string, string, required — The flag key

## 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`

Release response

- Release
  - `_links` object — The location and content type of related resources
  - `name` string, required — The release pipeline name
  - `releasePipelineKey` string, required — The release pipeline key
  - `releasePipelineDescription` string, required — The release pipeline description
  - `phases` ReleasePhase[], required — An ordered list of the release pipeline phases
    - `_id` string, required — The phase ID
    - `_name` string, required — The release phase name
    - `complete` boolean, required — Whether this phase is complete
    - `_creationDate` integer, required
    - `_completionDate` integer
    - `_completedBy` CompletedBy
      - `member` MemberSummary
        - `_links` object, required — The location and content type of related resources
        - `_id` string, required — The member's ID
        - `firstName` string — The member's first name
        - `lastName` string — The member's last name
        - `role` string, required — The member's base role. If the member has no additional roles, this role will be in effect.
        - `email` string, required — The member's email address
      - `token` TokenSummary
        - `_links` object
        - `_id` string
        - `name` string — The name of the token
        - `ending` string — The last few characters of the token
        - `serviceToken` boolean — Whether this is a service token
    - `_audiences` ReleaseAudience[], required — A logical grouping of one or more environments that share attributes for rolling out changes
      - `_id` string, required — The audience ID
      - `_links` object — The location and content type of related resources
      - `environment` EnvironmentSummary
        - `_links` object, required — The location and content type of related resources
        - `key` string, required — A project-unique key for the environment
        - `name` string, required — A human-friendly name for the environment
        - `color` string, required — The color used to indicate this environment in the UI
      - `name` string, required — The release phase name
      - `configuration` AudienceConfiguration
        - `releaseStrategy` string, required
        - `requireApproval` boolean, required — Whether or not the audience requires approval
        - `notifyMemberIds` string[] — An array of member IDs. These members are notified to review the approval request.
        - `notifyTeamKeys` string[] — An array of team keys. The members of these teams are notified to review the approval request.
        - `releaseGuardianConfiguration` ReleaseGuardianConfiguration
          - `monitoringWindowMilliseconds` integer, required — The monitoring window in milliseconds
          - `rolloutWeight` integer, required — The rollout weight percentage
          - `rollbackOnRegression` boolean, required — Whether or not to roll back on regression
          - `randomizationUnit` string — The randomization unit for the measured rollout
      - `segmentKeys` string[] — A list of segment keys
      - `status` string
      - `_ruleIds` string[] — The rules IDs added or updated by this audience
    - `status` string
    - `started` boolean — Whether or not this phase has started
    - `_startedDate` integer
    - `configuration` PhaseConfiguration
  - `_version` integer, required — The release version
  - `_releaseVariationId` string — The chosen release variation ID to use across all phases of a release
  - `_canceledAt` integer

## 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/b2724c5174d1/schema)
