Create an environment

POST https://api.getpostman.com/environments

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

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

You can also include the following properties:

  • values — An array of objects that contains the following:
    • key — The variable's name.
    • value — The variable's value.
    • enabled — If true, enable the variable.
    • type — The variable's type. One of: secret, default, or any.

Request Params

KeyDatatypeRequiredDescription
workspacestringOptional. A 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}}"}]}}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

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