Skip to main content
POST

Authorizations

Authorization
string
header
required

Headers

LD-API-Version
enum<string>
required

Version of the endpoint.

Available options:
beta

Path Parameters

projectKey
string
required
flagKey
string
required
environmentKey
string
required

Body

application/json
originalVariationId
string<uuid>
required

ID of the variation the release starts from. The release gradually moves traffic from it to the target variation, and moves traffic back to it if the release reverts.

targetVariationId
string<uuid>
required

ID of the variation being released. The release gradually moves traffic to it from the original variation, and moves traffic back to the original variation if the release reverts.

beforeRuleId
string

Insert the newly created rule or phase rules before this rule. If omitted, append them to the end of the rule list.

releasePlanKey
string

Key of an environment release plan in this environment. The plan supplies randomizationUnit, phases, metrics, advancementMode, and cleanupBehavior, so omit them. Omit this field to configure the release inline.

Minimum string length: 1
randomizationUnit
string

Key of an existing, non-archived context kind in the project that the release randomizes on, such as user. Each phase's rule must include the clause {"contextKind": "<unit>", "attribute": "kind", "op": "in", "values": ["<unit>"]}. Required unless releasePlanKey is set.

Minimum string length: 1
advancementMode
enum<string>

How the release moves between phases. Required when phases has more than one entry; a single-phase release ignores it and may omit it. Omit when releasePlanKey is set.

Available options:
manual,
automatic
phases
object[]

Ordered phases of the release. Required unless releasePlanKey is set.

Minimum array length: 1

One phase of a release. Each phase creates a flag rule unless it sets ruleId.

Example:
metrics
object[]

Metrics shared by every phase. Omit or pass an empty array for a progressive release. Metric groups cannot be listed inline; a release plan's metric groups expand into their member metrics at start. Omit when releasePlanKey is set.

bypassHealthChecks
enum<string>[]

Health check kinds that do not block this request. LaunchDarkly still runs and enforces every health check kind not listed here.

A release health check:

  • flag_evaluations_any: The flag has recently been evaluated.
  • flag_evaluations_with_context: The flag has recently been evaluated for contexts of the randomizationUnit kind.
  • metric_events_any: Guarded releases only. The metric has received events.
  • metric_events_with_context: Guarded releases only. The metric has received events for contexts of the randomizationUnit kind.
Available options:
flag_evaluations_any,
flag_evaluations_with_context,
metric_events_any,
metric_events_with_context
Example:
cleanupBehavior
enum<string>

What happens to the release rules after the release completes. Omit for leave_rules_in_place. Omit when releasePlanKey is set.

Available options:
remove_rules_and_update_default_rule,
leave_rules_in_place
comment
string

Optional comment written to the flag's audit-log entry.

Response

Environment release created and started.

A flag release in one environment, made up of one or more ordered phases. The top-level status is derived from the phases: it reflects the active phase, reports waiting between successfully completed phases, and reports the terminal outcome of the release.

id
string<uuid>
required
status
enum<string>
required

High-level status of an environment release or release phase.

  • pending: The release or phase has not started.
  • in_progress: The release or phase is progressing without requiring action.
  • waiting: The release is partially rolled out, but is paused and waiting for action from the user.
  • completed: The release or phase reached the target variation.
  • reverted: The release or phase returned to the original variation.
Available options:
pending,
in_progress,
waiting,
completed,
reverted
projectKey
string
required
environmentKey
string
required
flagKey
string
required
originalVariationId
string<uuid>
required

ID of the variation the release started from.

originalVariationValue
any
required

The value of the variation. This may be a string, boolean, number, JSON object, or array.

targetVariationId
string<uuid>
required

ID of the variation being released.

targetVariationValue
any
required

The value of the variation. This may be a string, boolean, number, JSON object, or array.

randomizationUnit
string
required

Key of the context kind the release randomizes on.

cleanupBehavior
enum<string>
required

What happens to the release rules when the final phase completes, either on its own or because a stop rolls it forward while it's running:

  • remove_rules_and_update_default_rule: The release rules are removed and the default rule serves the target variation.
  • leave_rules_in_place: The release rules stay and serve the target variation.

In every other case, including a revert, it has no effect: release rules left on the flag keep serving the variation the release ended on, ahead of rules added later without beforeRuleId.

Available options:
remove_rules_and_update_default_rule,
leave_rules_in_place
kind
enum<string>
required

Whether the release uses metric monitoring.

Available options:
progressive,
guarded
metrics
object[]
required
phases
object[]
required
Minimum array length: 1
currentPhaseIndex
integer | null
required

Zero-based index of the active phase. Null before the first phase, between phases, and after the release reaches a terminal status.

Required range: x >= 0
advancementMode
enum<string>
required

Whether a multi-phase release advances to the next phase automatically once the current phase's steps complete, or waits for an explicit advance. Has no effect on a single-phase release.

Available options:
manual,
automatic
createdAt
integer<int64>
required

Creation time in Unix milliseconds.

statusReason
enum<string>

Additional detail for a waiting, completed, or reverted status. The field may be absent for a waiting status when there is no specific reason. waiting_phase_ended appears only on the release, never on a phase. It means a phase of a multi-phase release with advancementMode manual ended and the release must be advanced to the next phase. reverted_discarded means the phase ended without a regression or a member rolling it back. A running phase is discarded when the flag changes underneath it, for example when the flag is turned off, archived, or deleted. A pending phase is discarded when the release ends before it starts, either because an earlier phase reverted or because the release was stopped with a resolution that removes pending phases. A release reports reverted_discarded only when the last phase that started was discarded.

Available options:
waiting_regression_detected,
waiting_phase_ended,
completed_automatic,
completed_manual,
reverted_regression_detected,
reverted_manual,
reverted_discarded,
reverted_insufficient_data
startedAt
integer<int64>
read-only

Start of the first phase in Unix milliseconds. Absent until a phase has started.

endedAt
integer<int64>
read-only

End of the last started phase in Unix milliseconds. Present only after the release reaches a terminal status of completed or reverted.