/v1/workspaces/{workspace_id}/scheduled-changes/{scheduled_change_id}/cancelAuthCancel a scheduled change
Cancels a pending scheduled change. A scheduled change request goes back to `approved`.
Path parameters
scheduled_change_id*string · uuidId of the scheduled change.
workspace_id*string · uuidId of the workspace.
Request body
notestringA note for the history (at most 500 characters).
Example: "Roll out the new checkout to everyone (FLAG-142)"
Response · 200 The cancelled scheduled change.
id*string · uuidId of the scheduled change.
workspace_id*string · uuidThe workspace.
project_id*string · uuidThe project.
config_id*string · uuidThe config.
setting_id*string · uuidThe setting.
setting_key*stringThe setting's key.
Example: "new_checkout"
environment_id*string · uuidThe environment.
environment_key*stringThe environment's key.
Example: "production"
operation*object`patch` applies its edits to whatever the value is at `run_at`; `replace` (and an approved change request) applies only if the value is still at `base_version`, else it fails.
Example: "patch"
payload*objectWhat will be written: the patch fields (`value`, `percentage_attribute`, `clear_rules`) or the whole targeting.
base_version*integer`replace` only: the `version` the change must still find.
Example: 7
change_request_id*string · uuidThe approved change request this applies.
run_at*string · date-timeWhen it runs (to within about 30 seconds).
status*objectState.
Example: "pending"
note*stringThe note the history entry gets.
Example: "Launch at 09:00"
created_by*objectWho scheduled it.
applied_change_id*string · uuidThe history entry it wrote.
executed_at*string · date-timeWhen it ran.
last_error*objectWhy it failed.
created_at*string · date-timeWhen it was scheduled.
updated_at*string · date-timeWhen it last changed state.
Example
Request
POST https://api.flags.productcraft.co/v1/workspaces/{workspace_id}/scheduled-changes/{scheduled_change_id}/cancel
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"note": "Roll out the new checkout to everyone (FLAG-142)"
}import { Flags } from "@productcraft/flags";
// Reads PRODUCTCRAFT_API_KEY from the environment
const flags = new Flags();
const scheduledChange = await flags.scheduledChanges.cancel("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { note: "Roll out the new checkout to everyone (FLAG-142)" });flags.scheduledChanges.cancel(scheduledChangeId, params?, options?): Flags.ScheduledChange
Response
{
"id": "00000000-0000-0000-0000-000000000000",
"workspace_id": "00000000-0000-0000-0000-000000000000",
"project_id": "00000000-0000-0000-0000-000000000000",
"config_id": "00000000-0000-0000-0000-000000000000",
"setting_id": "00000000-0000-0000-0000-000000000000",
"setting_key": "new_checkout",
"environment_id": "00000000-0000-0000-0000-000000000000",
"environment_key": "production",
"operation": "patch",
"payload": {},
"base_version": 7,
"change_request_id": "00000000-0000-0000-0000-000000000000",
"run_at": "2026-01-01T00:00:00.000Z",
"status": "pending",
"note": "Launch at 09:00",
"created_by": {},
"applied_change_id": "00000000-0000-0000-0000-000000000000",
"executed_at": "2026-01-01T00:00:00.000Z",
"last_error": {},
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}