Create Environment
Register an environment: a named target sessions can be opened against.
Supports the standard Idempotency-Key header, which is the mechanism to
reach for in CI: a retry with the same key and body replays the original
environment (200 instead of 201), and the same key with a different body is a
409 idempotency_conflict.
get_or_create is the older, coarser flag and remains supported. Note what
it does NOT do: on a name match it returns the EXISTING row untouched and
IGNORES every other field on this request, so a request whose config has
drifted from the stored one succeeds while changing nothing. Use
Idempotency-Key for retry safety and PATCH to reconcile config.
Authorizations
Workspace API key as a bearer token: Authorization: Bearer ish_sk_live_.... Keys are workspace-scoped machine principals minted in Settings > Developers (shown once at mint). Scopes: sessions:run (create a session, submit turns, close), sessions:read (read the session and its decision trace), environments:read and environments:write (manage the workspace's registered environments), tasks:read and tasks:write (manage the workspace's registered tasks), people:read and people:write (the people the workspace can run a session for), and usage:read (the workspace's own consumption, spend limits and rate-limit budgets). A key is minted with sessions:run, sessions:read, and tasks:read by default; every other scope must be requested, people:read and usage:read included. An ish user access token also works on the same header for personal scripts.
Headers
Path Parameters
Body
What kind of surface this is. Closed on write, open on read: Open union: new values may be added over time; clients must tolerate unknown values rather than failing on them.
web, device, world 1 - 120The per-kind configuration of an environment.
Every field is optional at the type level and required by KIND at validation time: a web environment needs url, and so on. Unknown keys are REJECTED on write, so a typo surfaces as a 422 instead of a target that was silently never set.
Example action vocabulary for this environment (same shape as a turn's valid_actions). NON-AUTHORITATIVE: documentation and SDK scaffolding only, never read at turn time. Every turn declares its own valid_actions, which is the only authoritative source.
Idempotent register for CI: when a LIVE environment with this name (case-insensitive) and the SAME kind already exists, return it with 200 instead of 409. The existing row is returned AS IS: config, notes and example_actions on this request are ignored, never silently applied, and the address-dedupe check is not evaluated on this path (nothing is written). A name held by a different kind still conflicts (409).
How long sessions on this environment keep their observation frames: none (discard after each turn), 30d, 90d, or indefinite. Omit for the default (30d). A session may override this at open; the resolved value is fixed for that session's life.
none, 30d, 90d, indefinite Operating manual for the RESOLVER only, never shown to the person. Becomes the default resolver_guidance for sessions opened against this environment; a session may pass its own, which wins.
8000120Response
The existing environment, RETURNED AS IS: nothing on this request was applied to it. Two paths reach here: an Idempotency-Key replay (same key, same body), or get_or_create with a live environment already holding this name and kind.
A registered environment as the caller sees it.
Normalized target identity derived from config (scheme, host and path only). A duplicate-registration guard, NOT the environment's identity, since sessions always reference the id.
Set when the environment is archived (DELETE). An archived environment stays readable by id so existing sessions keep resolving, is hidden from the default list, and frees its name for reuse.
The configuration of an environment as stored, tolerant of unknown keys.
Same fields as the write shape, but a key this client does not know is IGNORED rather than rejected: reads must keep working across server versions, and because a list response parses the whole page, one unfamiliar key would otherwise fail an entire workspace listing rather than its own row. Closed on write, open on read.
Who computes the next observation for this environment. Derived from kind and config, never client-set. Open union: new values may be added over time; clients must tolerate unknown values rather than failing on them.
What kind of surface this is. Open union: new values may be added over time; clients must tolerate unknown values rather than failing on them.
How long sessions on this environment keep their observation frames: none, 30d, 90d, or indefinite. Open union: new values may be added over time; clients must tolerate unknown values rather than failing on them.
Increments on every write to this environment's identity or configuration. Usage is aggregated by (id, revision), so a run reports against the configuration it actually ran on. Archiving does not change it.