Create an environment

POST {{baseUrl}}/environments?workspace=<string>

Creates an environment. Include the following properties in the request body:

  • name — A string value that contains the environment's name.

You can also include the following properties:

  • values — An array of objects that contains the following:

    • key — A string value that contains the variable's name.
    • value — A string value that contains the variable's value.
    • enabled — A boolean value that, if true, enable the variable.
    • type — A string value that contains the variable's type. One of: secret, default, or any.

Note:

If you do not include the workspace query parameter, the system creates the environment in your My Workspace workspace.

Request Params

KeyDatatypeRequiredDescription
workspacestringA workspace ID in which to create the environment.

If you do not include this query parameter, the system creates the environment in your "My Workspace" workspace. |

Request Body

{"environment"=>{"name"=>"{{environmentName}}", "values"=>[{"key"=>"{{environmentVariableName}}", "value"=>"{{environmentVariableValue}}", "enabled"=>"{{boolean}}", "type"=>"{{environmentType}}"}]}}

RESPONSES

status: OK

{&quot;environment&quot;:{&quot;id&quot;:&quot;5daabc50-8451-43f6-922d-96b403b4f28e&quot;,&quot;name&quot;:&quot;Test Environment&quot;,&quot;uid&quot;:&quot;12345678-5daabc50-8451-43f6-922d-96b403b4f28e&quot;}}