// Environments

Create an environment

Create a new deployment environment in a workspace.

POST/api/environment

Description

Creates an environment. Environments group machines and cloud targets that receive deployments together.

A new environment is live as soon as it exists. Pass enabled as false to create one that cannot yet receive deployments - useful when the machines are not assigned yet - and turn it on later with Update an environment.

Parameters

NameInTypeRequiredDescription
workspaceId body string yes ID of the workspace.
name body string yes Environment name (must be unique within the workspace).
sortOrder body integer no Display order in the UI.
color body string no Hex color used for the environment chip.
enabled body boolean no Whether the environment can receive deployments. Defaults to true, so an environment created without this field is live immediately. Pass false to stage one before opening it up. See Update an environment for what the flag does.

Errors

StatusMeaning
400 Invalid workspaceId or validation failure (e.g. duplicate name).
401 Missing or invalid Basic auth credentials, or the service account lacks the required role.