Skip to main content

Update Environment

PUT https://infrahub-api.nexgencloud.com/v1/core/environments/{id}

Updates the name of an existing environment. Provide the environment ID in the path and the new environment name in the request body to modify the specified environment.


Path parameters


id integer   Required

Specify the id of the environment to be modified.


Body parameters


name string   Required

The new name for the environment.
A string with a maximum length of 50 characters.


Attributes of the Environment object


status boolean

Indicates the success or failure of the operation. In this case, it is set to true, indicating that the name of the environment has been updated successfully.


message string

A message confirming the successful updating of the environment.


environment object

An object containing details about the modified environment.

For descriptions of the fields within the environment object returned in response to your request, please refer to the documentation here.


Example request
curl -X PUT "https://infrahub-api.nexgencloud.com/v1/core/environments/{id}" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
-d '{
"name": "string"
}'
Response
{
"status": true,
"message": "string",
"environment": {
"id": 0,
"name": "string",
"region": "string",
"created_at": "1970-01-01T00:00:00.000Z"
}
}

Returns


Returns the environments object corresponding to the modified environment, this includes the name, ID, associated region, and creation date and time.


Back to top