Logo
15_Days_of_Postman_-_for_testers_IvanKo API Documentation

Update an environment

PUT {{baseUrl}}/environments/{{environmentId}}

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

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

  • 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.

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 
Content-Type
string




RESPONSES

status OK

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



Curl
curl -X PUT 'https://api.getpostman.com/environments/environmentId' -H 'Content-Type: application/json' -d '{"environment":{"name":"environmentName","values":[{"key":"environmentVariableName","value":"environmentVariableValue","enabled":"boolean","type":"environmentType"}]}}'

ENDPOINTS