PUT
/
v1
/
apps
/
{id}
/
environments
Create or Edit Application Environments
curl --request PUT \
  --url https://api.vertracloud.app/v1/apps/{id}/environments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "environments": [
    {}
  ]
}'
{
  "status": "success",
  "response": [
    {
      "id": "env123",
      "key": "API_KEY",
      "value": "secret123",
      "note": "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 create or update environment variables for. If the application belongs to an organization, include the organization ID in the format appId-orgId.
environments
array
required
An array of environment variable objects.

Response

status
string
Indicates whether the call was successful. success if successful, error if not.
response
array
An array of environment variable objects after creation or update.
{
  "status": "success",
  "response": [
    {
      "id": "env123",
      "key": "API_KEY",
      "value": "secret123",
      "note": "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_BODY: The request body is not a valid array or is empty.
  • INVALID_ENVIRONMENT: One or more environment variables are invalid or use forbidden keys.
  • ENV_VARIABLE_TOO_LONG: An environment variable key or value exceeds length limits.
  • ENV_LIMIT_EXCEEDED: The total number of environment variables exceeds the limit of 25.
{
  "status": "error",
  "code": "UNAUTHORIZED"
}