Skip to main content

Create an Environment

note

This endpoint can only be accessed using an Admin Key.

Create a new environment.

Endpoint
POST /v2/environments

Request

Body


environmentId string

Customer defined string identifier for this environment. Can only contain alphanumeric chars and/or '-'.


name string

Customer defined name for this environment.


POST /v2/objects
curl "https://api.warrant.dev/v2/environments" \
-X POST \
-H "Authorization: ApiKey YOUR_KEY" \
--data-raw \
'{
"environmentId":"staging",
"name":"Staging"
}'

Response

Body


environmentId string

Customer defined string identifier for this environment. Can only contain alphanumeric chars and/or '-'.


name string

Customer defined name for this environment.


keys array

Array of created environment keys for this environment.


200 OK
{
"environmentId": "staging",
"name": "Staging",
"keys": [
{
"type": "client",
"environment": "staging",
"value": "client_staging_jkl456"
},
{
"type": "api",
"environment": "staging",
"value": "api_staging_ghj780"
}
]
}