Skip to content
Select themeSelect language

`POST /api/undo/{id}/execute` — confirm + run an undo action by id (the prominent "Undo now" affordance in run-detail / live-mode). Executes the reversal immediately (inside or skipping the grace window); the service authz's the caller against the action's task workspace and CAS-claims the row so a double-tap or a racing grace sweep runs the reversal exactly once.

POST
/api/undo/{id}/execute
curl --request POST \
--url https://example.com/api/undo/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/execute \
--cookie supacloud_session=<supacloud_session>
id
required
string format: uuid

Undo-action ID to confirm + execute

The executed undo action in its terminal state

Media typeapplication/json

One persisted task_undo_actions row — the durable undo/rollback record. payload/result stay raw serde_json::Value so a forward-compatible shape round-trips without a schema bump (mirrors TaskToolApproval).

object
created_at
required
string format: date-time
created_by
string | null format: uuid
executed_at
string | null format: date-time
grace_until
string | null format: date-time
id
required
string format: uuid
kind
required

The reversal class. Runtime String; the spec narrows it to the closed [UndoKind] (revert_pr | reverse_deploy | redeploy_last_good).

string
Allowed values: revert_pr reverse_deploy redeploy_last_good
payload
required

The raw reversal input (forward-compatible). Runtime stays serde_json::Value; the spec types it as an open map.

object
key
additional properties
result

The reversal outcome (e.g. result.pr_url), forward-compatible. Runtime stays serde_json::Value; the spec types it as an open map.

object | null
run_id
string | null format: uuid
state
required

The lifecycle state. Runtime String; the spec narrows it to the closed [UndoState] (pending | grace | executed | expired | failed).

string
Allowed values: pending grace executed expired failed
task_id
required
string format: uuid
Example
{
"kind": "revert_pr",
"state": "pending"
}

Authentication required

Media typeapplication/json

The canonical JSON body of every error response — the single source of truth the frontend binds to. Every AppError serializes as this exact shape, and the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is what the frontend error schema is generated from, so there is no hand-written error schema on either end.

object
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden bad_request unprocessable precondition_failed conflict method_not_allowed rate_limited quota_exceeded database_error docker_error vault_error internal_error
details
One of:
null
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
Example
{
"code": "not_found"
}

Permission denied

Media typeapplication/json

The canonical JSON body of every error response — the single source of truth the frontend binds to. Every AppError serializes as this exact shape, and the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is what the frontend error schema is generated from, so there is no hand-written error schema on either end.

object
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden bad_request unprocessable precondition_failed conflict method_not_allowed rate_limited quota_exceeded database_error docker_error vault_error internal_error
details
One of:
null
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
Example
{
"code": "not_found"
}

Undo action not found

Media typeapplication/json

The canonical JSON body of every error response — the single source of truth the frontend binds to. Every AppError serializes as this exact shape, and the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is what the frontend error schema is generated from, so there is no hand-written error schema on either end.

object
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden bad_request unprocessable precondition_failed conflict method_not_allowed rate_limited quota_exceeded database_error docker_error vault_error internal_error
details
One of:
null
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
Example
{
"code": "not_found"
}

Structured server error

Media typeapplication/json

The canonical JSON body of every error response — the single source of truth the frontend binds to. Every AppError serializes as this exact shape, and the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is what the frontend error schema is generated from, so there is no hand-written error schema on either end.

object
code
required

Machine-readable, stable error code.

string
Allowed values: not_found unauthorized forbidden bad_request unprocessable precondition_failed conflict method_not_allowed rate_limited quota_exceeded database_error docker_error vault_error internal_error
details
One of:
null
error
required

Human-readable message (the server’s English text; the client may localize by code).

string
Example
{
"code": "not_found"
}