API
Environments
The environments API manages durable workspaces used for repository checkout, command execution, and files that must persist across steps.
Provision a managed environment
List, create, inspect, update, or destroy environments with:
GET /v1/projects/{project}/environments
POST /v1/projects/{project}/environments
GET /v1/projects/{project}/environments/{environment_id}
PATCH /v1/projects/{project}/environments/{environment_id}
DELETE /v1/projects/{project}/environments/{environment_id}The create request selects a provider and persistence policy. Ownership can bind the workspace to an agent, loop, run, or principal so later work resolves the same environment intentionally.
Use acquire and release operations when a runtime needs exclusive access. Leases prevent two active workers from mutating the same workspace at once.
Attach a worker-provided environment
A connected worker can advertise a local or customer-hosted workspace through:
POST /v1/projects/{project}/environments/attachAttached environments are not provisioned by Mobius. Their lifecycle follows the worker that owns them, while their environment record still lets loops and agents route work consistently.
Start a worker and inspect logs
For a hosted environment, start or reuse its worker and inspect bounded logs:
POST /v1/projects/{project}/environments/{environment_id}/workers/start
GET /v1/projects/{project}/environments/{environment_id}/worker/logsTreat log content as untrusted. Do not put secrets in commands whose output may appear in logs.
Repository checkout output
Each declared repository creates an environment.git.clone preparation step.
One repository uses prepare_repository; several repositories use numbered
step IDs.
The output records both the request and the checkout that actually happened:
| Field | Meaning |
|---|---|
dir, path | Relative tool directory and absolute environment path. |
repo_full_name, remote_url | Repository identity and token-free remote. |
requested_branch, requested_commit, fetch_ref | Requested checkout target. |
branch, commit, head_sha | Resolved branch and immutable commit. |
stdout, stderr, exit_code | Bounded git command result. |
credential_expires_at | Expiry for the brokered repository credential. |
Use commit for provenance and dir for later environment actions.
Next
- Choose lifetime and ownership in managed environments.
- Publish durable output through the artifacts API.
- Inspect schemas in the interactive API reference.