Skip to main content
POST
Create Environment

Authorizations

Authorization
string
header
required

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

Idempotency-Key
string | null

Path Parameters

workspace_id
string<uuid>
required

Body

application/json
kind
enum<string>
required

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.

Available options:
web,
device,
world
name
string
required
Required string length: 1 - 120
config
EnvironmentConfig · object

The 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_actions
Example Actions · object[]

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.

get_or_create
boolean
default:false

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).

observation_retention
enum<string> | null

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.

Available options:
none,
30d,
90d,
indefinite
operating_notes
string | null

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.

Maximum string length: 8000
slug
string | null
Maximum string length: 120

Response

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.

address
string | null
required

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.

archived_at
string<date-time> | null
required

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.

config
StoredEnvironmentConfig · object
required

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.

created_at
string<date-time>
required
example_actions
Example Actions · object[]
required
hosting
string
required

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.

id
string<uuid>
required
kind
string
required

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.

name
string
required
observation_retention
string
required

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.

operating_notes
string | null
required
revision
integer
required

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.

slug
string | null
required
updated_at
string<date-time>
required
workspace_id
string<uuid>
required