Skip to main content
POST
Start environment

Authorizations

X-Asteroid-Agents-Api-Key
string
header
required

Body

application/json

Request to start an environment. The agent is a binding carried in the body, not a path segment — an environment belongs to an organisation, and the agent tells provisioning which workflow, profile and organisation to boot against.

agentId
string<uuid>
required

The agent to bind the environment to. Gates access, and supplies the organisation the environment is stamped with.

agentProfileId
string<uuid>

Optional agent profile to attach. The profile id is stamped onto the env row for the session's lifetime, so later reads resolve against the stamped profile rather than the agent's current one. Its decrypted credentials come back on the response's connection only for service-to-service callers — they are never returned to an API key or a browser.

source
object

Where the environment spec comes from. Omit for the server default (a browser env at the computer-use resolution).

Response

The request has succeeded.

A single environment: what it is, its provider state, and how to drive it. state is the same shape the execution endpoint returns, so the LiveView/OsLiveView components render either without branching.

connection
object
required

How to connect to it.

createdAt
string<date-time>
required

When the environment row was created.

environmentType
enum<string>
required

Browser or OS.

Available options:
browser,
os
expiresAt
string<date-time>
required

When the reaper will tear the environment down if no graceful Stop arrives first.

hasRecording
boolean
required

Whether a playable recording has been persisted (GCS object or provider URL). The playable URL itself is minted on the by-id read.

id
string<uuid>
required

Environment identifier.

organizationId
string<uuid>
required

The organisation the environment belongs to.

owner
object
required

Who the environment belongs to, and the identity that owner carries.

state
object
required

Environment state (browser or OS): live-view URL, viewport, provider config and a freshly-minted recording URL when one exists.

status
enum<string>
required

Current status, terminal states included. Lists exclude terminal environments unless includeTerminal is set.

Available options:
requested,
provisioning,
ready,
stopping,
stopped,
failed,
dead
agentProfileId
string<uuid>

Profile snapshot the environment was booted against, if any.

osType
enum<string>

Operating system for OS environments. Absent for browser environments; linux when an OS environment predates explicit osType storage.

Available options:
linux,
windows
readyAt
string<date-time>

When the environment first became ready, if it reached that state.

stoppedAt
string<date-time>

When the environment reached a terminal state. Set after Stop runs.