Scheduled changes

Scheduled flag changes is an Enterprise feature

Scheduled flag changes is available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.

Schedule the specified flag targeting changes to take effect at the selected time. You may schedule multiple changes for a flag each with a different ExecutionDate. To learn more, read Scheduled flag changes.

Several of the endpoints in the scheduled changes API require a scheduled change ID. The scheduled change ID is returned as part of the Create scheduled changes workflow and List scheduled changes responses. It is the _id field, or the _id field of each element in the items array.

List scheduled changes

Get a list of scheduled changes that will be applied to the feature flag.

Request
path Parameters
projectKey
required
string <string>

The project key

featureFlagKey
required
string <string>

The feature flag key

environmentKey
required
string <string>

The environment key

Responses
200

Scheduled changes collection response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

get/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes
Request samples
Response samples
application/json
{
  • "items": [
    ],
  • "_links": {
    }
}

Create scheduled changes workflow

Create scheduled changes for a feature flag. If the ignoreConficts query parameter is false and there are conflicts between these instructions and existing scheduled changes, the request will fail. If the parameter is true and there are conflicts, the request will succeed.

Request
path Parameters
projectKey
required
string <string>

The project key

featureFlagKey
required
string <string>

The feature flag key

environmentKey
required
string <string>

The environment key

query Parameters
ignoreConflicts
boolean

Whether to succeed (true) or fail (false) when these instructions conflict with existing scheduled changes

Request Body schema: application/json
required
comment
string

Optional comment describing the scheduled changes

executionDate
required
integer <int64> (UnixMillis)
required
Array of objects (Instructions)
Responses
201

Scheduled changes response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

405

Method not allowed

409

Status conflict

429

Rate limited

post/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes
Request samples
application/json
{
  • "comment": "Optional comment describing the scheduled changes",
  • "executionDate": 1718467200000,
  • "instructions": [
    ]
}
Response samples
application/json
{
  • "_id": "string",
  • "_creationDate": 0,
  • "_maintainerId": "12ab3c45de678910abc12345",
  • "_version": 1,
  • "executionDate": 0,
  • "instructions": [
    ],
  • "conflicts": null,
  • "_links": {
    }
}

Get a scheduled change

Get a scheduled change that will be applied to the feature flag by ID.

Request
path Parameters
projectKey
required
string <string>

The project key

featureFlagKey
required
string <string>

The feature flag key

environmentKey
required
string <string>

The environment key

id
required
string <string>

The scheduled change id

Responses
200

Scheduled changes response

401

Invalid access token

404

Invalid resource identifier

429

Rate limited

get/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id}
Request samples
Response samples
application/json
{
  • "_id": "string",
  • "_creationDate": 0,
  • "_maintainerId": "12ab3c45de678910abc12345",
  • "_version": 1,
  • "executionDate": 0,
  • "instructions": [
    ],
  • "conflicts": null,
  • "_links": {
    }
}

Update scheduled changes workflow

Update a scheduled change, overriding existing instructions with the new ones. Updating a scheduled change uses the semantic patch format.

To make a semantic patch request, you must append domain-model=launchdarkly.semanticpatch to your Content-Type header. To learn more, read Updates using semantic patch.

Instructions

Semantic patch requests support the following kind instructions for updating scheduled changes.

Click to expand instructions for updating scheduled changes

deleteScheduledChange

Removes the scheduled change.

Here's an example:

{
  "instructions": [{ "kind": "deleteScheduledChange" }]
}

replaceScheduledChangesInstructions

Removes the existing scheduled changes and replaces them with the new instructions.

Parameters
  • value: An array of the new actions to perform when the execution date for these scheduled changes arrives. Supported scheduled actions are turnFlagOn and turnFlagOff.

Here's an example that replaces the scheduled changes with new instructions to turn flag targeting off:

{
  "instructions": [
    {
      "kind": "replaceScheduledChangesInstructions",
      "value": [ {"kind": "turnFlagOff"} ]
    }
  ]
}

updateScheduledChangesExecutionDate

Updates the execution date for the scheduled changes.

Parameters
  • value: the new execution date, in Unix milliseconds.

Here's an example:

{
  "instructions": [
    {
      "kind": "updateScheduledChangesExecutionDate",
      "value": 1754092860000
    }
  ]
}
Request
path Parameters
projectKey
required
string <string>

The project key

featureFlagKey
required
string <string>

The feature flag key

environmentKey
required
string <string>

The environment key

id
required
string <string>

The scheduled change ID

query Parameters
ignoreConflicts
boolean

Whether to succeed (true) or fail (false) when these new instructions conflict with existing scheduled changes

Request Body schema: application/json
required
comment
string

Optional comment describing the update to the scheduled changes

required
Array of objects (Instructions)
Responses
200

Scheduled changes response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

405

Method not allowed

409

Status conflict

429

Rate limited

patch/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id}
Request samples
application/json
{
  • "comment": "Optional comment describing the update to the scheduled changes",
  • "instructions": [
    ]
}
Response samples
application/json
{
  • "_id": "string",
  • "_creationDate": 0,
  • "_maintainerId": "12ab3c45de678910abc12345",
  • "_version": 1,
  • "executionDate": 0,
  • "instructions": [
    ],
  • "conflicts": null,
  • "_links": {
    }
}

Delete scheduled changes workflow

Delete a scheduled changes workflow.

Request
path Parameters
projectKey
required
string <string>

The project key

featureFlagKey
required
string <string>

The feature flag key

environmentKey
required
string <string>

The environment key

id
required
string <string>

The scheduled change id

Responses
204

Action succeeded

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

405

Method not allowed

409

Status conflict

429

Rate limited

delete/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/scheduled-changes/{id}
Request samples
Response samples
application/json
{
  • "code": "unauthorized",
  • "message": "Invalid access token"
}