PATCH
/
v1
/
apps
/
{id}
/
environments
Update Application Environment
curl --request PATCH \
  --url https://api.vertracloud.app/v1/apps/{id}/environments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "environment": {}
}'
{
  "status": "success",
  "response": [
    {
      "id": "env123",
      "key": "API_KEY",
      "value": "newsecret456",
      "note": "Updated API key for external service",
      "created_at": "2025-08-14T19:58:00Z"
    },
    {
      "id": "env456",
      "key": "DATABASE_URL",
      "value": "mysql://user:pass@localhost/db",
      "note": null,
      "created_at": "2025-08-14T19:58:00Z"
    }
  ]
}
id
string
required
The ID of the application to update the environment variable for. If the application belongs to an organization, include the organization ID in the format appId-orgId.
environment
object
required
The environment variable to update.

Response

status
string
Indicates whether the call was successful. success if successful, error if not.
response
array
An array of all environment variable objects after the update.
{
  "status": "success",
  "response": [
    {
      "id": "env123",
      "key": "API_KEY",
      "value": "newsecret456",
      "note": "Updated API key for external service",
      "created_at": "2025-08-14T19:58:00Z"
    },
    {
      "id": "env456",
      "key": "DATABASE_URL",
      "value": "mysql://user:pass@localhost/db",
      "note": null,
      "created_at": "2025-08-14T19:58:00Z"
    }
  ]
}

Error Responses

status
string
Indicates whether the call was successful. error if not successful.
code
string
The error code indicating the reason for failure. Possible values:
  • UNAUTHORIZED: The user is not authenticated or lacks sufficient permissions.
  • FORBIDDEN: The user does not have permission to access the application.
  • APP_NOT_FOUND: The specified application does not exist.
  • INVALID_ENVIRONMENT: The provided environment variable is invalid or uses a forbidden key.
  • ENV_VARIABLE_TOO_LONG: The environment variable key or value exceeds length limits.
  • ENVIRONMENT_NOT_FOUND: The specified environment variable ID was not found.
{
  "status": "error",
  "code": "UNAUTHORIZED"
}