Skip to main content
POST
Edit the graph from natural language

Authorizations

Authorization
string
header
required

An app API key, e.g. Authorization: Bearer sk_live_…. Secret (sk_) for writes/sessions; publishable (pk_) is read-only (browser-safe).

Headers

If-Match
string

The rev you last read. Mismatch returns 409.

Idempotency-Key
string

A retried edit with the same key returns the original result without a second LLM spend.

Path Parameters

id
string<uuid>
required

Body

application/json

A natural-language edit instruction for the server-side kernel agent. Either instruction or message is required.

instruction
string

What to change, in prose. For example, "add a locked vault behind the cellar and wire a key to open it".

message
string

Alias for instruction (accepted for convenience).

verifiedObjects
object[]

Optional grounding hints (named objects the agent may reference).

expectedRev
string

Optional optimistic-concurrency token; alternative to the If-Match header.

Response

Edit applied (or a clarifying question in reply with no change). The new rev is the ETag.

The RESULT-ONLY response from a kernel-agent edit. It carries the validated world, advisory diagnostics, and the agent's natural-language reply, and none of the agent's internals: the system prompt, op grammar, lexicon, model id, and raw op trace are never exposed. When the agent needs clarification it returns its question in reply and leaves the world unchanged. (A TEST-mode response additionally carries a mock: true marker.)

world
object
required

A playable world's compiled graph, id, name, entrance, and the scene (states + events). This is the shape returned inside the world field of a World resource (see World) and by the graph-editing routes. Additional optional properties are allowed (forward-compatible); the schemaVersion on responses pins the contract version.

diagnostics
object[]
required

The full validateWorld set (advisory warning/info findings) for the persisted world.

reply
string
required

The agent's natural-language summary of what it did, or a clarifying question when no change was made.

mock
boolean

Present and true only for TEST-mode keys. See Testing.