// Machines

Assign an environment to a machine

Add one environment to a machine, leaving its other assignments alone.

POST/api/machine/environment

Description

Assigns one environment to the machine. The machine's other environments are left untouched, so this is the endpoint for bringing a machine into a tier without having to know the rest of its assignments.

The call is idempotent: assigning an environment the machine already has succeeds and changes nothing, so a pipeline that reruns does not have to check first.

The environment must belong to the same workspace as the machine. A disabled environment can still be assigned - enabled controls whether the environment takes part in deployments, not whether it can be configured.

Parameters

NameInTypeRequiredDescription
machineId body string yes ID of the machine, from List machines.
environmentId body string yes ID of the environment, from List environments.

Errors

StatusMeaning
400 Invalid machineId. A machine that belongs to another organization is reported the same way as one that does not exist.
400 Missing environmentId, or an environment that does not belong to the machine's workspace.
401 Missing or invalid Basic auth credentials, or the service account lacks permission to manage machines in this workspace.