Run a multi-edit Scenario (staged or applied)
const url = 'https://api.aerandil.com/v1/scenarios/run';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"commit":false,"steps":[{"action":"example","params":{},"target":{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","object_type":"example"}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.aerandil.com/v1/scenarios/run \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "commit": false, "steps": [ { "action": "example", "params": {}, "target": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "object_type": "example" } } ] }'Replays steps in order inside one transaction through the same guards, validation, and handlers as /apply, so later steps see earlier steps’ writes. commit=false (default) stages the scenario: the response carries per-step effect sets plus the merged diff a real apply would produce, then everything rolls back — zero durable trace. commit=true applies the whole scenario atomically; any step’s failure aborts every step. A step may target an object created by an earlier step via {"created_by_step": k, "object_type": ...} — positional, resolved at replay time. Requires the apply scope of every step’s action; internal-runner actions are rejected. Bounded at 100 steps. commit=true accepts Idempotency-Key.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
false stages (diff + rollback); true applies atomically.
object
Registered action api-name (e.g. hospitality.action.check_in).
The step action’s parameters — same flat canonical JSON as that action’s /apply schema.
object
Responses
Section titled “Responses”The scenario outcome: per-step effect sets, the merged diff, commit-time warnings, and whether it committed.
object
object
Merged object diff across all steps (Created+Modified→Created, Created+Deleted→net nothing, Modified+Deleted→Deleted).
object
Present and true when a committed run was replayed from the idempotency cache.
Per-step apply responses, in step order.
object
Example
{ "diff": [ { "kind": "created" } ]}Headers
Section titled “Headers”Always no-store — live, per-run data.
A step’s apply scope is missing, or a step names an internal-runner action.
A step failed validation — nothing was applied.