Skip to content

Cancel a pending scheduled action

POST
/admin/scheduled-actions/{id}/cancel

Cancels a scheduled action that hasn’t run yet, so it never runs. Any pending action can be cancelled, including a post an author scheduled to publish. You get the action back with state set to cancelled.

Cancelling doesn’t undo an action that has already run, and a cancelled action stays in the list. If the action has already run, failed or been cancelled, you get a 409 that names its current state, so cancelling twice is an error, not a no-op. An unknown id gets a 404.

Cancellations aren’t recorded in the audit log. You need system.admin.

id
required
string format: uuid

The id of the action to cancel, from the list.

The action after cancellation.

One scheduled action: an instruction to act on a target once scheduled_for has passed. The row stays after the action runs, fails or is cancelled.

object
id
required
string format: uuid
action
required

What to do. restrict and change_sensitivity change an asset’s sensitivity (restrict sets it to restricted); delete soft-deletes an asset; change_state moves an asset to another workflow state, or publishes or unpublishes a post; notify sends a notification about any kind of target.

string
Allowed values: restrict delete change_state change_sensitivity notify
target_kind
required
string
Allowed values: asset post collection user
target_id
required

The target’s id as text: a UUID for an asset, post or collection, or a user ref for a user.

string
params

Settings for the action. They’re only checked when it runs, so a mistake shows up as a failed action. change_sensitivity takes to (public, team, restricted or embargo); change_state takes a state code in to_state (for a post, published or wip) or a state id in to_state_id; delete takes an optional reason; notify takes recipient (a user ref, required unless the target is a user), verb and reason.

object
key
additional properties
any
scheduled_for
required

When the action becomes due. It never runs before this time, and it can run some time after it.

string format: date-time
state
required

pending until the action runs, then done or failed; cancelled if it was cancelled first. done can also mean nothing needed changing, for example a post that was already published.

string
Allowed values: pending done cancelled failed
error

Why the action failed. Only present when state is failed.

string
nullable
created_by

The user who scheduled the action. Left out when no user is behind it.

integer format: int64
nullable
created_at
required

When the action was scheduled. The list is ordered by this, not by scheduled_for.

string format: date-time
executed_at

When the action ran, whether it succeeded or failed. Left out while it’s pending and for cancelled actions.

string format: date-time
nullable

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}

Authenticated but missing required capabilities

object
error
required

Human-readable error summary

string
Example
the request could not be completed

Resource not found

object
error
required

Human-readable error summary

string
Example
the request could not be completed

The action isn’t pending: it has already run, failed or been cancelled. error names its current state.

object
error
required

Human-readable error summary

string
Example
the request could not be completed