Optimizely Flags Scheduling API

Schedule future flag ruleset changes and read environment change-approval settings. Five operations. Harvested verbatim from the provider's published OpenAPI 2026-08-13.

OpenAPI Specification

optimizely-feature-experimentation-optimizely-flags-scheduling-api-openapi.json Raw ↑
{"openapi":"3.0.0","info":{"title":"Optimizely Flags Scheduling API","version":"1.0.0","description":"This page documents how to use Optimizely Flags Scheduling API. These APIs allow you to turn a flag on/off, turn a \nrule on/off, change the traffic allocation of a rule and change the audience conditions of a rule.\n","x-logo":{"url":"https://app.optimizely.com/static/img/rebrand/logo.svg"}},"servers":[{"url":"http://localhost:3002/","description":"Local server"},{"url":"https://api.app.optimizely.com/flags-scheduling","description":"Production server"}],"tags":[{"name":"Change Approvals","description":"APIs to interact with approval of flag changes"},{"name":"Scheduled Changes","description":"APIs to interact with Scheduled Change of a flag"},{"name":"Scheduled Change","description":"APIs to interact with Scheduled Change of a flag in an environment"}],"paths":{"/projects/{project_id}/environments/{environment_id}/preferences":{"get":{"tags":["Change Approvals"],"operationId":"get_environment_approval_settings","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentApprovalSettingsResponse"}}}},"401":{"description":"Not Authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"details":"Not authenticated","status":401}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"description":"The id of the project for which the schedule is set.","required":true,"schema":{"title":"Project Id","type":"integer","description":"The id of the project for which the schedule is set."},"name":"project_id","in":"path"},{"description":"The id of the project for which the schedule is set.","required":true,"schema":{"title":"Environment Id","type":"integer","description":"The id of the environment for which the schedule is set."},"name":"environment_id","in":"path"}]}},"/projects/{project_id}/flags/{flag_key}/schedules":{"get":{"tags":["Scheduled Changes"],"summary":"List Scheduled changes of a flag","description":"List Scheduled changes of a flag\n","operationId":"list_scheduled_changes","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedSchedulesResponse"}}}},"401":{"description":"Not Authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"details":"Not authenticated","status":401}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"description":"The id of the project for which the schedule is set.","required":true,"schema":{"title":"Project Id","type":"integer","description":"The id of the project for which the schedule is set."},"name":"project_id","in":"path"},{"description":"The key of the flag for which the schedule is set.","required":true,"schema":{"title":"Flag Key","type":"string","description":"The key of the flag for which the schedule is set."},"name":"flag_key","in":"path"},{"description":"The key of the environment for which the schedule is set.","required":false,"schema":{"title":"Environment","type":"string","description":"Filter the schedule by environment key"},"name":"environment","example":"development","in":"query"},{"description":"Specify UTC the timestamp and get the list of the jobs which are scheduled after.","required":false,"schema":{"title":"Scheduled From","type":"string","description":"Specify UTC the timestamp and get the list of the jobs which are scheduled after.","format":"date-time"},"example":"2023-04-15T20:14+0000","name":"scheduled_from","in":"query"},{"description":"Specify UTC the timestamp and get the list of the jobs which are scheduled before.","required":false,"schema":{"title":"Scheduled Till","type":"string","description":"Specify UTC the timestamp and get the list of the jobs which are scheduled before.","format":"date-time"},"example":"2023-04-15T20:14+0000","name":"scheduled_till","in":"query"},{"description":"Pagination argument that specifies the page to return. The default value is 1.","required":false,"schema":{"title":"Page No","minimum":1,"type":"integer","description":"Pagination argument that specifies the page to return. The default value is 1.","default":1},"name":"page_no","in":"query"},{"description":" Pagination argument that specifies the maximum number of objects to return per request.\n                        Must be between 1 and 1000. The default value is 100.","required":false,"schema":{"title":"Page Size","maximum":1000,"minimum":1,"type":"integer","description":" Pagination argument that specifies the maximum number of objects to return per request.\n Must be between 1 and 1000. The default value is 100.","default":100},"name":"page_size","in":"query"},{"description":"Filter scheduled changes by actions which apply to a specific rule.\n\nFor filtering scheduled changes which apply to a specific rule, use the rule key.\n","required":false,"schema":{"title":"Applies To","type":"string","description":"Rule Key."},"name":"applies_to","in":"query"},{"description":"Order of sorting. Ascending or Descending value in short hand form (`asc` or `desc`)","required":false,"schema":{"title":"Sort order","$ref":"#/components/schemas/SortOrder","description":"Ascending or Descending value in short hand form (asc or desc). Always orders by schedule time."},"example":"asc","name":"order","in":"query"}]},"post":{"tags":["Scheduled Changes"],"summary":"Create a Schedule Change for a flag in an environment","description":"Create a Scheduled Change for a flag in an environment\n\nThe schedule change contains a set of actions to update the flag in that environment at a specific time\n","operationId":"create_scheduled_change","responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledChange"}}}},"401":{"description":"Not Authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"details":"Not authenticated","status":401}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"project_id","in":"path","schema":{"type":"integer"},"required":true},{"name":"flag_key","in":"path","schema":{"type":"string"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledChangeCreateRequest"}}},"required":true}}},"/projects/{project_id}/flags/{flag_key}/schedules/{schedule_id}":{"delete":{"tags":["Scheduled Change"],"summary":"Delete a Scheduled Change for a flag in an environment","description":"Delete a Scheduled Change for a flag in an environment\n","operationId":"delete_scheduled_change","responses":{"204":{"description":"Successful Response"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"details":"Job with id 123 is already deleted","status":400}}}},"401":{"description":"Not Authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"details":"Not authenticated","status":401}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"project_id","in":"path","schema":{"type":"integer"},"required":true},{"name":"flag_key","in":"path","schema":{"type":"string"},"required":true},{"name":"schedule_id","in":"path","schema":{"type":"integer"},"required":true}]},"patch":{"tags":["Scheduled Change"],"summary":"Update the Scheduled Change for a flag in an environment","description":"Update the Scheduled Change for a flag in an environment\n","operationId":"update_scheduled_change","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledChangeUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledChange"}}}},"401":{"description":"Not Authenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"details":"Not authenticated","status":401}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"details":"Job with id 10 not found","status":404}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"project_id","in":"path","schema":{"type":"integer"},"required":true},{"name":"flag_key","in":"path","schema":{"type":"string"},"required":true},{"name":"schedule_id","in":"path","schema":{"type":"integer"},"required":true}]}}},"components":{"securitySchemes":{"BearerAuth":{"description":"To get a personal token, see https://docs.developers.optimizely.com/web/docs/personal-token","type":"http","scheme":"bearer"}},"schemas":{"ErrorResponse":{"title":"ErrorResponse","required":["details","status"],"type":"object","properties":{"details":{"title":"Details","type":"string","description":"Details of Error."},"status":{"title":"Status","type":"integer","description":"Status code of the response.","example":400}}},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}},"status":{"title":"Status","type":"integer","description":"Status code of the response.","example":422}}},"PaginatedSchedulesResponse":{"title":"PaginatedSchedulesResponse","required":["items","total","has_more"],"type":"object","properties":{"items":{"title":"Scheduled Changes","type":"array","items":{"$ref":"#/components/schemas/ScheduledChange"},"description":"List of scheduled changes."},"total":{"title":"Total","type":"integer","description":"Total number of scheduled changes."},"has_more":{"title":"Has More","type":"boolean","description":"Boolean that indicates whether there are still any schedules left in the next page."}}},"ScheduledTime":{"title":"ScheduledTime","required":["time_zone","time","date"],"type":"object","properties":{"time":{"title":"Time","type":"string","description":"The schedule will run at this time. Expected format: hh:MM (24 hour)","example":"20:14"},"time_zone":{"title":"Time Zone","type":"string","description":"The timezone information for the scheduled time. Must be an IANA timezone.","example":"Etc/UTC"},"date":{"title":"Date","type":"string","description":"The schedule will run at this date. Expected format: yyyy-mm-dd.","example":"2023-07-30"}}},"EnvironmentApprovalSettings":{"title":"EnvironmentApprovalSettings","type":"object","properties":{"entity_type":{"type":"string","description":"The setting's entity type"},"required_approval_on_new_entities":{"type":"boolean","description":"Whether approval is required for new entities"},"default_preferences":{"type":"object","additionalProperties":{"type":"boolean"},"description":"Default rules related to environment approval setting"},"notification_recipients":{"type":"array","items":{"type":"string"},"description":"List of notification recipients"},"approver_user_ids":{"type":"array","items":{"type":"integer"},"description":"List of user IDs who can approve the changes"},"entities":{"type":"array","items":{"$ref":"#/components/schemas/EntityApprovalSettings"}}},"required":["entity_type","required_approval_on_new_entities","notification_recipients","approver_user_ids","entities"]},"EntityApprovalSettings":{"type":"object","properties":{"operation":{"type":"string","description":"Mode of operation for a particular entity"},"key":{"type":"string","description":"Key of the entity"},"entity_id":{"type":"integer","description":"Id of the entity"},"preferences":{"type":"object","additionalProperties":{"type":"boolean"},"description":"Preferences related to the entity"}},"required":["operation","key","entity_id"]},"EntityApprovalSettingsCreate":{"type":"object","properties":{"operation":{"type":"string","description":"Mode of operation for particular entity"},"key":{"type":"string","description":"Key of the entity"},"entity_id":{"type":"integer","description":"Id of the entity"},"preferences":{"type":"object","description":"Preferences related with the entity","additionalProperties":{"type":"boolean"}}},"required":["operation","key","entity_id"]},"EntityApprovalSettingsResponse":{"type":"object","properties":{"id":{"type":"integer","description":"Primary key"},"entity_id":{"type":"integer","description":"Id of the related entity"},"entity_key":{"type":"string","description":"Key of the related entity"},"environment_id":{"type":"integer","description":"Id of the related environment"},"project_id":{"type":"integer","description":"Id of the associated project"},"type":{"type":"string","description":"Type of the entity"},"preferences":{"type":"object","description":"Preferences related with the entity","additionalProperties":{"type":"boolean"}},"archived":{"type":"boolean","description":"Designates whether the entity is archived or not"}},"required":["id","entity_key","environment_id","preferences","archived"]},"EnvironmentApprovalSettingsCreate":{"type":"object","properties":{"entity_type":{"type":"string","description":"The setting's entity type"},"required_approval_on_new_entities":{"type":"boolean","description":"Denotes approval required status for new entities"},"default_preferences":{"type":"object","description":"Default rules related with environment approval setting","additionalProperties":{"type":"boolean"}},"notification_recipients":{"type":"array","items":{"type":"string"},"description":"List of notification recipients"},"approver_user_ids":{"type":"array","items":{"type":"integer"},"description":"List of user ids who can approve the changes"},"entities":{"type":"array","items":{"$ref":"#/components/schemas/EntityApprovalSettingsCreate"}}},"required":["entity_type","required_approval_on_new_entities","notification_recipients","approver_user_ids","entities"]},"EnvironmentApprovalSettingsResponse":{"type":"object","properties":{"id":{"type":"integer","description":"The unique identifier for the schedule"},"project_id":{"type":"integer","description":"The project id where the environment belongs"},"environment_id":{"type":"integer","description":"The environment id where action is happening"},"entity_type":{"type":"string","description":"The setting's entity type"},"require_approval_on_new_entities":{"type":"boolean","description":"Denotes approval required status for new entities"},"default_preferences":{"type":"object","additionalProperties":{"type":"boolean"},"description":"Default rules related with environment approval setting"},"notification_recipients":{"type":"array","items":{"type":"string"},"description":"List of notification recipients associated with the environment approval settings"},"approvers":{"type":"array","items":{"$ref":"#/components/schemas/ApproversResponse"},"description":"List of approvers"},"entities":{"type":"array","items":{"type":"object","description":"Related entity approval settings"}},"created_at":{"type":"string","format":"date-time","description":"Timestamp when the settings are created"},"updated_at":{"type":"string","format":"date-time","description":"Timestamp when the settings are updated"}},"required":["id","project_id","environment_id","entity_type","require_approval_on_new_entities","notification_recipients","approvers","entities","created_at","updated_at"]},"ApproversResponse":{"type":"object","properties":{"user_id":{"type":"integer","description":"The user id of the approver user"},"email":{"type":"string","description":"The email of the approver user"}},"required":["user_id","email"]},"EnvironmentApprovalSettingsUpdate":{"type":"object","properties":{"environment_id":{"type":"integer","description":"The environment id where action is happening"},"entity_type":{"type":"string","description":"The setting's entity type"},"required_approval_on_new_entities":{"type":"boolean","description":"Denotes approval required status for new entities"},"default_preferences":{"type":"object","description":"Default rules related with environment approval setting","additionalProperties":{"type":"boolean"}},"notification_recipients":{"type":"array","items":{"type":"string"},"description":"List of notification recipients"},"approver_user_ids":{"type":"array","items":{"type":"integer"},"description":"List of user ids who can approve the changes"},"entities":{"type":"array","items":{"$ref":"#/components/schemas/EntityApprovalSettingsCreate"}}},"required":["entity_type","required_approval_on_new_entities","notification_recipients","approver_user_ids","entities"]},"ScheduledTimeWithUTC":{"title":"ScheduledTimeWithUTC","required":["time_zone","time","date","utc_time"],"type":"object","properties":{"time":{"title":"Time","type":"string","description":"The schedule will run at this time. Expected format: hh:MM (24 hour)","example":"07:02"},"time_zone":{"title":"Time Zone","type":"string","description":"The timezone information for the scheduled time. Must be an IANA timezone.","example":"Etc/UTC"},"date":{"title":"Date","type":"string","description":"The schedule will run at this date. Expected format: yyyy-mm-dd.","example":"2023-07-30"},"utc_time":{"title":"UTC Time","type":"string","description":"The utc timestamp when the scheduled job will be executed.","example":"2023-07-30T07:02:00+0000"}}},"ScheduleAction":{"title":"ScheduleAction","required":["subject","changed_element","value"],"type":"object","properties":{"subject":{"type":"object","description":"The entity this action will apply to","properties":{"key":{"type":"string","description":"The identifier of the subject"},"type":{"type":"string","description":"The type of subject. Can be a flag or a rule of the flag","enum":["flag","rule"]}}},"changed_element":{"type":"string","enum":["status","percentage_included","audience_conditions"]},"value":{"description":"Value of the action. Can be of any type.","type":"object","$ref":"#/components/schemas/ActionValue"}}},"ScheduledChangeCreateRequest":{"title":"ScheduledChangeCreateRequest","required":["account_id","actions","schedule","environment"],"type":"object","properties":{"account_id":{"title":"Account Id","type":"integer","description":"The account the Project is associated with."},"actions":{"title":"Actions","type":"array","items":{"$ref":"#/components/schemas/ScheduleAction"},"description":"Schedule action details."},"schedule":{"title":"Schedule","allOf":[{"$ref":"#/components/schemas/ScheduledTime"}],"description":"Schedule details."},"environment":{"title":"Environment","type":"string"}}},"ScheduledChangeUpdateRequest":{"title":"ScheduledChangeUpdateRequest","type":"object","properties":{"actions":{"title":"Actions","type":"array","items":{"$ref":"#/components/schemas/ScheduleAction"},"description":"Schedule action details."},"schedule":{"title":"ScheduledTime","allOf":[{"$ref":"#/components/schemas/ScheduledTime"}],"description":"Schedule details."},"environment":{"title":"Environment","type":"string"}}},"ScheduledChange":{"title":"ScheduledChange","type":"object","required":["id","account_id","project_id","flag_key","environment","actions","schedule","status","completed_at","created_at","updated_at","updated_by","created_by"],"properties":{"id":{"title":"Id","type":"integer","description":"The unique identifier for the schedule."},"account_id":{"title":"Account Id","type":"integer","description":"The account the Project is associated with."},"project_id":{"title":"Project Id","type":"integer","description":"The id of the project for which the schedule is set."},"flag_key":{"title":"Flag Key","type":"string","description":"The Flag identifier"},"environment":{"title":"Environment","type":"string","description":"The Environment of the flag"},"actions":{"title":"Actions","type":"array","items":{"$ref":"#/components/schemas/ScheduleAction"},"description":"Schedule actions."},"schedule":{"title":"Schedule","allOf":[{"$ref":"#/components/schemas/ScheduledTimeWithUTC"}],"description":"Schedule details."},"status":{"title":"Status","type":"string","description":"The status of the scheduled job."},"completed_at":{"title":"Completed At","type":"string","nullable":true,"description":"The UTC timestamp when the schedule is completed.","format":"date-time","example":"2023-04-15T20:14+0000"},"updated_at":{"title":"Updated At","type":"string","description":"The UTC timestamp when the schedule is updated.","format":"date-time","example":"2023-04-15T20:14+0000"},"created_at":{"title":"Created At","type":"string","description":"The UTC timestamp when the schedule is created.","format":"date-time","example":"2023-04-15T20:14+0000"},"updated_by":{"title":"Updated By","type":"string","description":"The user who updated the schedule."},"created_by":{"title":"Created By","type":"string","description":"The user who created the schedule."}}},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"description":"Path to the invalid value"},"msg":{"title":"Message","type":"string","description":"Error message"},"type":{"title":"Error Type","type":"string","description":"Error type"}}},"ActionValue":{"title":"ActionValue","description":"The value of a schedule action.\n\nFor status change, value can be on/off. \n\nFor changing traffic percentage, value should be integer. For example, for 40% traffic, value should be 4000.\n","anyOf":[{"type":"string","enum":["on","off"]},{"type":"integer","example":5000}]},"SortOrder":{"title":"SortOrder","type":"string","enum":["asc","desc"]}}},"x-readme":{"explorer-enabled":true,"proxy-enabled":true}}