For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
      • POSTCreate scheduled changes workflow
      • DELDelete scheduled changes workflow
      • GETGet a scheduled change
      • GETList scheduled changes
      • PATCHUpdate scheduled changes workflow
    • Segments
    • Tags
    • Teams
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewScheduled Changes

Update scheduled changes workflow

PATCH
/api/v2/projects/:projectKey/flags/:featureFlagKey/environments/:environmentKey/scheduled-changes/:id
PATCH
/api/v2/projects/:projectKey/flags/:featureFlagKey/environments/:environmentKey/scheduled-changes/:id
$curl -X PATCH https://app.launchdarkly.com/api/v2/projects/projectKey/flags/featureFlagKey/environments/environmentKey/scheduled-changes/id \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "instructions": [
> {
> "kind": "replaceScheduledChangesInstructions",
> "value": [
> {
> "kind": "turnFlagOff"
> }
> ]
> }
> ],
> "comment": "Optional comment describing the update to the scheduled changes"
>}'
1{
2 "_id": "12ab3c45de678910abc12345",
3 "_creationDate": 1654123897062,
4 "_maintainerId": "12ab3c45de678910abc12345",
5 "_version": 1,
6 "executionDate": 1636558831870,
7 "instructions": [
8 "[ { \"kind\": \"turnFlagOn\" }]"
9 ],
10 "_maintainerServiceTokenId": "string",
11 "conflicts": null,
12 "_links": {}
13}
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](https://launchdarkly.com/docs/api#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following `kind` instructions for updating scheduled changes. <details> <summary>Click to expand instructions for <strong>updating scheduled changes</strong></summary> #### deleteScheduledChange Removes the scheduled change. Here's an example: ```json { "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: ```json { "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: ```json { "instructions": [ { "kind": "updateScheduledChangesExecutionDate", "value": 1754092860000 } ] } ``` </details>
Was this page helpful?
Previous

Segments

Next
Built with

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:

1{
2 "instructions": [{ "kind": "deleteScheduledChange" }]
3}

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:

1{
2 "instructions": [
3 {
4 "kind": "replaceScheduledChangesInstructions",
5 "value": [ {"kind": "turnFlagOff"} ]
6 }
7 ]
8}

updateScheduledChangesExecutionDate

Updates the execution date for the scheduled changes.

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

Here’s an example:

1{
2 "instructions": [
3 {
4 "kind": "updateScheduledChangesExecutionDate",
5 "value": 1754092860000
6 }
7 ]
8}

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key
featureFlagKeystringRequiredformat: "string"
The feature flag key
environmentKeystringRequiredformat: "string"
The environment key
idstringRequiredformat: "string"
The scheduled change ID

Query parameters

ignoreConflictsbooleanOptional

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

Request

This endpoint expects an object.
instructionslist of maps from strings to anyRequired

The instructions to perform when updating. This should be an array with objects that look like <code>{“kind”: “update_action”}</code>. Some instructions also require a <code>value</code> field in the array element.

commentstringOptional
Optional comment describing the update to the scheduled changes

Response

Scheduled changes response
_idstring
The ID of this scheduled change
_creationDatelong
Timestamp of when the scheduled change was created
_maintainerIdstring
The ID of the scheduled change maintainer
_versioninteger
Version of the scheduled change
executionDatelong
When the scheduled changes should be executed
instructionslist of maps from strings to any
The actions to perform on the execution date for these scheduled changes
_maintainerServiceTokenIdstring
The ID of the service token that created or updated this scheduled change
conflictsany
Details on any conflicting scheduled changes
_linksmap from strings to objects
The location and content type of related resources

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
405
Method Not Allowed Error
409
Conflict Error
429
Too Many Requests Error