Apply a batch of graph ops
Apply an ordered batch of GraphOps atomically: unapplicable ops are collected in applyErrors (the editor’s behavior), then the resulting world is validated ONCE through the kernel gate. A 422 means the batch was rejected as a whole — nothing persists. This single endpoint backs nearly all editor mutations.
Authorizations
An app API key, e.g. Authorization: Bearer sk_live_…. Secret (sk_) for writes/sessions; publishable (pk_) for read/embed.
Headers
Path Parameters
Body
1One operation in the CURATED public op vocabulary applied by POST /v1/worlds/{id}/ops. This is a stable, versioned surface mapped onto the internal engine — the kernel's internal op grammar is not exposed. Every op funnels through the same fail-closed validation gate as the dedicated CRUD endpoints.
- add_state
- update_state
- delete_state
- add_event
- update_event
- delete_event
- set_entrance
- add_variant
- remove_variant
Response
Batch applied
The result of a graph write. world is the new, kernel-validated world; diagnostics carries advisory (warning/info) findings; rev is the new concurrency token (also returned as the ETag header).
A playable world. The full contract is published as JSON Schema at https://alakazam.gg/schema/smworld-1.0.json (see schema/COMPATIBILITY.md). Additional optional properties are allowed (forward-compatible).
The new revision token. Pass it as If-Match on the next write.
"1.0"
Per-op messages for ops that could not be applied (non-fatal).