Scheduled changes
- Turn a flag on or off.
- Play or pause a rule.
- Update the percentage of traffic included in a rule.
- Update the targeted audience.
Note If you intend to change the traffic's ramp percentage after running the experiment, you will need to implement a user profile service before starting the experiment.
For information, see Ensure consistent user bucketing.
With the Flags Scheduling REST API
<Add_API_Key />
See the Optimizely Flags Scheduling API reference documentation for the available endpoints to schedule changes in Feature Experimentation.
Create a schedule change for a flag in an environment
Use the Create a Schedule Change for a flag in an environment API endpoint.
Endpoint – POST https://api.app.optimizely.com/flags-scheduling/projects/PROJECT_ID/flags/FLAG_KEY/schedules
Example request
curl --request POST \
--url https://api.app.optimizely.com/flags-scheduling/projects/PROJECT_ID/flags/scheduled_changes_flag/schedules \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'authorization: Bearer TOKEN' \
--data '
{
"schedule": {
"time": "11:00",
"time_zone": "Etc/UTC",
"date": "2025-09-16"
},
"account_id": ACCOUNT_ID,
"actions": [
{
"subject": {
"key": "a-b-test",
"type": "rule"
},
"changed_element": "status",
"value": "on"
}
],
"environment": "development"
}
'Example response
{
"id": 7695,
"project_id": PROJECT_ID,
"environment": "development",
"environment_id": ENVIRONMENT_ID,
"flag_key": "scheduled_changes_flag",
"created_at": "2025-09-15T19:53:59.083241",
"created_by": "[email protected]",
"updated_at": "2025-09-15T19:53:59.083241",
"updated_by": "[email protected]",
"completed_at": null,
"status": "pending",
"actions": [
{
"subject": {
"key": "a-b-test",
"type": "rule"
},
"changed_element": "status",
"value": "on"
}
],
"schedule": {
"date": "2025-09-16",
"time": "11:00",
"time_zone": "Etc/UTC",
"utc_time": "2025-09-16T11:00:00Z"
},
"revision": 1
}List scheduled changes of a flag
Use the List Scheduled changes of a flag API endpoint.
Endpoint – GET https://api.app.optimizely.com/flags-scheduling/projects/PROJECT_ID/flags/FLAG_KEY/schedules
Example request
curl --request GET \
--url 'https://api.app.optimizely.com/flags-scheduling/projects/PROJECT_ID/flags/FLAG_KEY/schedules?page_no=1&page_size=100' \
--header 'accept: application/json' \
--header 'authorization: Bearer TOKEN'Example response
{
"items": [
{
"id": 7694,
"project_id": PROJECT_ID,
"environment": "development",
"environment_id": ENVIRONMENT_ID,
"flag_key": "scheduled_changes_flag",
"created_at": "2025-09-15T19:44:35.447789",
"created_by": "[email protected]",
"updated_at": "2025-09-15T19:44:35.447789",
"updated_by": "[email protected]",
"completed_at": null,
"status": "pending",
"actions": [
{
"subject": {
"key": "scheduled_changes_flag",
"type": "flag"
},
"changed_element": "status",
"value": "on"
}
],
"schedule": {
"date": "2025-09-16",
"time": "12:30",
"time_zone": "America/Chicago",
"utc_time": "2025-09-16T17:30:00Z"
},
"revision": 1
}
],
"total": 1,
"has_more": false
}Update the scheduled change for a flag in an environment
Use the Update the Scheduled Change for a flag in an environment API endpoint.
Important For PATCH requests, first GET the current scheduled changes, merge only the fields you need to change, and then send the PATCH. This helps prevent overwriting existing settings you did not intend to modify.
Endpoint – PATCH https://api.app.optimizely.com/flags-scheduling/projects/PROJECT_ID/flags/FLAG_KEY/schedules/SCHEDULE_ID
- (Optional) Use the List scheduled changes of a flag API endpoint to find the SCHEDULE_ID.
- Call the update scheduled change API endpoint. The following example shows how to turn a flag off: Example request
curl --request PATCH \
--url https://api.app.optimizely.com/flags-scheduling/projects/PROJECT_ID/flags/scheduled_changes_flag/schedules/SCHEDULE_ID \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'authorization: Bearer TOKEN' \
--data '
{
"schedule": {
"time": "12:30",
"date": "2025-09-30",
"time_zone": "Etc/UTC"
},
"actions": [
{
"subject": {
"key": "scheduled_changes_flag",
"type": "flag"
},
"changed_element": "status",
"value": "off"
}
],
"environment": "development"
}
'Example response
{
"id": 7694,
"project_id": PROJECT_ID,
"environment": "development",
"environment_id": ENVIRONMENT_ID,
"flag_key": "scheduled_changes_flag",
"created_at": "2025-09-15T19:44:35.447789",
"created_by": "[email protected]",
"updated_at": "2025-09-15T20:39:50.799568",
"updated_by": "[email protected]",
"completed_at": null,
"status": "pending",
"actions": [
{
"subject": {
"key": "scheduled_changes_flag",
"type": "flag"
},
"changed_element": "status",
"value": "off"
}
],
"schedule": {
"date": "2025-09-30",
"time": "12:30",
"time_zone": "Etc/UTC",
"utc_time": "2025-09-30T12:30:00Z"
},
"revision": 1
}Delete a scheduled change for a flag in an environment
Use the Delete a Scheduled Change for a flag in an environment API endpoint.
Endpoint – DELETE https://api.app.optimizely.com/flags-scheduling/projects/PROJECT_ID/flags/FLAG_KEY/schedules/SCHEDULE_ID
- (Optional) Use the List scheduled changes of a flag API endpoint to find the SCHEDULE_ID.
- Call the delete a scheduled change API endpoint. Example request
curl --request DELETE \
--url https://api.app.optimizely.com/flags-scheduling/projects/PROJECT_ID/flags/scheduled_changes_flag/schedules/SCHEDULE_ID \
--header 'accept: application/json' \
--header 'authorization: Bearer TOKEN'Example response The endpoint returns no content if successful.
Create a scheduled change with the Feature Experimentation UI
See Manage scheduled changes in the user documentation for step-by-step examples.