Revert an applied action
Undo an applied action by proposing and immediately applying the compensating change, computed server-side from the original row's prior* snapshot. Apple has no change history to reconstruct from, which is also why not every kind is revertible — a non-revertible or already-reverted action returns 422 not_revertible.
Required scope: write, plus the canApprove grant.
bearerAuthAuthorizationBearer <token>An API key from Workspace → Settings → API keys, sent as Authorization: Bearer tsk_….
Authorization has two independent axes.
The scope is ranked — a key satisfies any requirement at or below its own tier:
read— see state. Never changes anything.write— propose changes (theactions/*endpoints), trigger audits and reports.admin— connection, account import, sync, targets and brief.
There is no approve scope. It was a rung once; it is not one now, and a key requested with it is rejected.
The approval grant (can_approve) is a separate boolean, not a rung. Deciding a queued proposal — approve, reject, revert — needs write and the grant. Keeping them on separate axes is what makes the review gate a control rather than a convention: a key that may propose is not automatically a key that may approve its own proposal.
A key is either org-scoped (reaches every account, optionally limited to a subset) or bound to a single account.
projectId*stringThe account's project UUID — from GET /accounts, NOT the Apple asaOrgId. Pass the literal current with an account-scoped key to use its bound account.
actionId*stringThe action row id, from the ledger or the approval queue.
uuidThe compensating action.
application/json- response
actionId*stringThe asa_agent_actions row this created.
uuidkind*stringThe action kind, e.g. budget_change.
mode*stringauto_applied = the safe-apply policy cleared it and an apply job is enqueued. queued = it's waiting in the approval queue. NOT terminal: the apply worker re-runs the policy and can demote an auto-approved action back to pending. Poll the ledger for the outcome.
"auto_applied""queued"decision*stringWhat the approval policy decided (ADR 0010). not-applicable = no prompt needed; user-approval = parked for a person. Was riskTier.
"not-applicable""user-approval""approved""denied"policyReasons*array<string>Why the policy reached that decision — the kill switch, the CPA band, the daily auto-apply cap, or the per-kind rule.
summary?stringOne-line human description of the change, stored on the row.
payload?The full kind-typed payload as stored, including the prior* snapshot that makes the change revertible. Apple has no change history, so this snapshot IS the revert plan.
currency?|The account's currency.
note?string|nullreplayed?booleanOnly on an Idempotency-Key replay: this is the original proposal, not a new one.
curl -X POST 'https://tapandscale.com/api/v1/accounts/current/actions/497f6eca-6276-4993-bfeb-53cbbbba6f08/revert'{ "actionId": "4a2794ff-94cb-4bac-8d36-d5fb36c563a0", "kind": "string", "mode": "auto_applied", "decision": "not-applicable", "policyReasons": [ "string" ], "summary": "Set \"Brand US\" daily budget → $150.00 (+20%)", "payload": {}, "currency": "string", "note": "string", "replayed": true}