// Environments

List environments

List the deployment environments in a workspace, and whether each one is accepting deployments.

GET/api/environment

Description

Returns the workspace's environments with their sort order, display colour and whether each one is currently accepting deployments.

This is the endpoint that answers why a deploy was refused for an environment: enabled being false means it was switched off with Update an environment, as opposed to being blocked by lifecycle phase progression, which the deploy error alone does not distinguish.

Deleted environments are not returned.

Parameters

NameInTypeRequiredDescription
workspaceId query string yes ID of the workspace.

Response

FieldTypeDescription
workspaceId string The workspace the environments belong to, echoing the one you asked for.
environments object[] The workspace's environments. Empty array when it has none - not an error.
environments[].environmentId string The environment's id. This is the value every other endpoint takes as environmentId.
environments[].name string Display name, unique within the workspace.
environments[].sortOrder integer Display order in the UI. Not a deployment order.
environments[].color string Hex colour of the environment chip, or null when none is set.
environments[].enabled boolean false when the environment has been switched off and will refuse deployments. See Update an environment.

Errors

StatusMeaning
400 Invalid workspaceId.
401 Missing or invalid Basic auth credentials, or the service account lacks the required role.