Create Environment
POST
/environments
Environments
{
"type": "object",
"properties": {
"environment": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 254,
"minLength": 1
},
"values": {
"type": "array",
"maxItems": 100,
"additionalItems": false,
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"maxLength": 254
"minLength": 1
},
"value": { "type": "string" },
"enabled": { "type": "boolean" }
},
"required": ["key", "value"]
}
}
},
"required": ["name"]
}
},
"required": ["environment"]
}
id
.workspace
as a query param.Requires API Key as X-Api-Key
request header orapikey
URL query parameter.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.getpostman.com/environments' \
--header 'Content-Type: application/json' \
--data-raw '{
"environment": {
"name": "Sample Environment Name (required)",
"values": [
{
"key": "variable_name_1",
"value": "The value of the variable"
},
{
"key": "variable_name_2",
"value": ""
}
]
}
}'
Response Response Example
200 - Successful Response
{
"environment": {
"id": "f158266e-306b-4702-a2b9-e4ede7878b7a",
"name": "Sample Environment Name (required)",
"uid": "5665-f158266e-306b-4702-a2b9-e4ede7878b7a"
}
}
Request
Body Params application/json
Responses
Modified at 2023-08-15 05:41:03