Environments API
List and manage workspace environments used as promote and deploy targets.
Environments (typically dev, staging, prod) are created with a workspace and used by promotion and deploy flows.
See also: Environment Promotion · Workspaces
List / create (workspace)
| Method | Path | Permission | Notes |
|---|---|---|---|
GET | /v1/workspaces/{workspace_id}/environments | read | |
POST | same | write | Body: { "name": "qa" } |
PATCH | …/environments/{environment_id} | write | name?, status? (active|suspended) |
DELETE | …/environments/{environment_id} | delete |
Environment names start with a lowercase letter, then use lowercase letters, digits and hyphens, and end with a letter or digit (up to 63 characters, for example qa-1). Names are trimmed and lowercased; anything else is 422. Creating a name that already exists in the workspace is 409.
Get by id
GET /v1/environments/{environment_id}Permission: read on the environment
Promote channels
Promotion is not a single environments endpoint — use the resource APIs:
| Channel | Compare / promote |
|---|---|
| Secrets | /v1/workspaces/{id}/secrets/compare|promote |
| Flags | Flags API |
| Apps | Apps API |
| Coderunners | Coderunners API |