Use this endpoint when you want to define the exact, complete set of environment variables for your application. Unlike the add/edit endpoint, this operation replaces all existing variables with whatever you supply in the request body. Any variable that existed before but is not present in the new payload will be permanently removed.
Endpoint
PUT https://api.virtuscloud.app/v2/apps/{appId}/envs
Authorization
Include your API key in the request header:
Path Parameters
The unique identifier of your application. You can find this in your Virtus Cloud dashboard URL.
Body Parameters
An object whose keys are the environment variable names and whose values are the desired values. Omit this field or pass an empty object ({}) to clear all variables. For example: { "NEW_KEY": "newValue" }.
Response
Indicates the outcome of the request. Returns "success" when the operation completes without errors.
A flat object containing only the environment variables you supplied — the full state of the application’s variables after the overwrite.
Examples
curl --request PUT \
--url "https://api.virtuscloud.app/v2/apps/{appId}/envs" \
--header "Authorization: <api_key>" \
--header "Content-Type: application/json" \
--data '{
"envs": {
"TEST": "overwriteTest",
"NODE_ENV": "production"
}
}'
Response Example
{
"status": "success",
"response": {
"TEST": "overwriteTest"
}
}
This operation is destructive. All environment variables not included in the request body will be permanently deleted. If you only want to update or add specific variables while keeping the rest, use the Add / Edit endpoint instead.