Skip to main content
Use this endpoint to add new environment variables or change the values of existing ones. Any variables already set on your application that you do not include in the request body are left untouched — this is a partial merge, not a full replacement. After a successful call, the response returns the complete updated set of variables.

Endpoint

POST https://api.virtuscloud.app/v2/apps/{appId}/envs

Authorization

Include your API key in the request header:
Authorization: <api_key>

Path Parameters

appId
string
required
The unique identifier of your application. You can find this in your Virtus Cloud dashboard URL.

Body Parameters

envs
object
required
An object whose keys are the environment variable names and whose values are the corresponding values you want to set or update. For example: { "DATABASE_URL": "postgres://...", "PORT": "3000" }.

Response

status
string
Indicates the outcome of the request. Returns "success" when the operation completes without errors.
response
object
A flat object containing the complete current set of environment variables for the application after the merge — including both the variables you just set and any that were already present.

Examples

curl --request POST \
  --url "https://api.virtuscloud.app/v2/apps/{appId}/envs" \
  --header "Authorization: <api_key>" \
  --header "Content-Type: application/json" \
  --data '{
    "envs": {
      "TEST": "myTest",
      "PORT": "3000"
    }
  }'

Response Example

{
  "status": "success",
  "response": {
    "TEST": "myTest"
  }
}
Variables not included in your request body are preserved. Use the Overwrite endpoint if you want to replace all variables at once.