Skip to main content

App Environments API

The App Environments API allows you to manage app environments in Quave ONE. You can create, retrieve, and delete app environments.

Make sure to read the Get Started document to understand how the API works.

Note: Most endpoints in this API accept only the user token. Endpoints that support environment-token authentication say so explicitly.

Create App Environment

To create a new app environment, send a POST request to the /api/public/v1/app-env endpoint. Below are the required fields:

FieldTypeDescription
accountIdStringThe ID of the account.
appIdStringThe ID of the app.
nameStringThe name of the app environment.
regionStringThe region for the app environment (must be one of the allowed values).

Optional fields:

FieldTypeDescription
branchStringThe Git branch to use. Required for apps that use GitHub.
zCloudsNumberThe number of zClouds to use (1, 2, 4, or 8). Defaults to 1.
envVarsArrayThe environment variables to set in the app environment. See Environment Variables Object for more details.
dockerPresetVersionStringThe Docker preset version to use when creating a managed database environment. Call GET /api/public/v1/database-presets first to discover versions for MONGODB, POSTGRESQL, MYSQL, REDIS, COUCHDB, RABBITMQ, and CLICKHOUSE.
containersIntegerThe number of containers for managed database environments. CouchDB currently supports exactly 1.
diskIntegerDisk size for managed database environments, in MB.
withPersistenceBooleanWhether the managed database environment should use persistent storage.
databaseSettingsObjectDatabase engine settings. See Database Settings Object for more details.
jobConfigObjectJob environment overrides such as command, timeout, TTL, retry, and concurrency. Only for Job apps. These values become the initial saved settings for the environment; see Job Runs API.

Example:

curl -X POST \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"accountId": "5f7b1b7b7b7b7b7b7b7b7b7b",
"appId": "5f7b1b7b7b7b7b7b7b7b7b7c",
"name": "Production",
"region": "us-5",
"branch": "main",
"zClouds": 2
}' \
https://api.quave.cloud/api/public/v1/app-env

Example Response:

{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7d"
}

The response contains the appEnvId of the newly created app environment.

Databases & Services Presets

Before creating a Databases & Services app or environment through the public API, call GET /api/public/v1/database-presets. The endpoint name is kept for API compatibility even though the presets include databases, caches, and brokers. It returns the automatic DevOps service presets currently supported by the API: MONGODB, POSTGRESQL, MYSQL, REDIS, COUCHDB, RABBITMQ, and CLICKHOUSE. It also returns their version keys, default version, protocol, persistence model, and per-preset disk/replica limits.

Use each preset's returned limits.maxReplicas when setting containers. CouchDB currently supports exactly 1 container.

RabbitMQ environments expose AMQP URLs, MQTT URLs, and a management UI URL in the environment hosts list after deployment. The MQTT external endpoint uses its own generated hostname so it can preserve the allocated external port while still being displayed as mqtt://.

ClickHouse environments expose both HTTP URLs and native clickhouse:// URLs in the environment hosts list after deployment.

Get App Environment

To retrieve an app environment, send a GET request to the /api/public/v1/app-env endpoint. You need to provide the appEnvId as a query parameter.

Query Parameters

ParameterTypeRequiredDescription
appEnvIdStringYesThe ID of the app environment to retrieve.
decryptBooleanNoWhether to decrypt secret environment variables. Defaults to false. Requires admin permission.

Basic Example (without decryption)

curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
https://api.quave.cloud/api/public/v1/app-env?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7d

Example Response:

{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7d",
"name": "Production",
"slug": "production",
"region": "us-5",
"status": "RUNNING",
"currentVersion": 42,
"gitBranch": "main",
"cliEnvName": null,
"allowUserCliToken": false,
"envVars": [
{
"_id": "abc123",
"name": "PUBLIC_VAR",
"value": "some-value",
"type": "DEPLOY",
"isSecret": false
},
{
"_id": "def456",
"name": "SECRET_KEY",
"value": "***SECRET***",
"type": "DEPLOY",
"isSecret": true
}
]
}

Example with Decryption (Admin Only)

To decrypt secret environment variables, add decrypt=true as a query parameter. This requires admin permission on the account.

curl -X GET \
-H 'Authorization: YOUR_TOKEN' \
'https://api.quave.cloud/api/public/v1/app-env?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7d&decrypt=true'

Example Response:

{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7d",
"name": "Production",
"slug": "production",
"region": "us-5",
"status": "RUNNING",
"currentVersion": 42,
"gitBranch": "main",
"cliEnvName": null,
"allowUserCliToken": false,
"envVars": [
{
"_id": "abc123",
"name": "PUBLIC_VAR",
"value": "some-value",
"type": "DEPLOY",
"isSecret": false
},
{
"_id": "def456",
"name": "SECRET_KEY",
"value": "actual-secret-value-123",
"type": "DEPLOY",
"isSecret": true
}
]
}

If the user does not have admin permission, the API will return:

{
"error": "Admin permission required to decrypt secrets"
}

Response Fields

The response contains various fields describing the app environment configuration. Below are the fields returned:

FieldTypeDescription
appEnvIdStringThe app environment ID.
nameStringThe name of the app environment.
slugStringThe slug of the app environment.
regionStringThe region for the app environment.
statusStringCurrent environment status: STOPPED, PENDING, UPDATING, or RUNNING.
currentVersionNumberVersion number of the current deployment (null if never deployed).
gitBranchStringThe Git branch used for the app environment. For apps that don't use GitHub, the value will be cli.
cliEnvNameStringThe CLI environment name.
allowUserCliTokenBooleanWhether the app environment allows user CLI tokens for deployments.
envVarsArrayArray of environment variables. See Environment Variables Object.
jobConfigObjectJob environment overrides when this environment belongs to a Job app.
appJobConfigObjectApp-level Job defaults inherited by this environment.

Note: Secret environment variables will have their values masked as ***SECRET*** unless decrypt=true is provided with admin credentials.

Update App Environment

To update an existing app environment, send a PUT request to the /api/public/v1/app-env endpoint. All fields are optional - only provide the fields you want to update.

Request Body Fields

FieldTypeRequiredDescription
appEnvIdStringYesThe ID of the app environment to update.
nameStringNoThe new name for the app environment.
regionStringNoThe new region for the app environment (must be one of the allowed values).
branchStringNoThe new Git branch to use. Cannot be empty for apps that use GitHub.
zCloudsNumberNoThe new number of zClouds to use (1, 2, 4, or 8).
envVarsArrayNoThe new environment variables. See Environment Variables Object.
containersIntegerNoThe new number of containers for managed database environments.
diskIntegerNoThe new disk size for managed database environments, in MB.
databaseSettingsObjectNoDatabase engine settings. See Database Settings Object.
functionConfigObjectNoFunction settings (only for function apps). See Function Config Object.
jobConfigObjectNoJob settings (only for Job apps). See Job Config Object.

Note: When updating envVars, the entire array replaces the existing environment variables. Make sure to include all environment variables you want to keep.

Function Config Object

Only applicable to function apps. Functions are available starting from the Quave ONE Connect plan. All fields are optional integers.

FieldTypeDescription
containerConcurrencyIntegerMax concurrent requests per container.
timeoutSecondsIntegerRequest timeout in seconds.
idleTimeoutSecondsIntegerIdle timeout before scale-to-zero (minimum 300).
responseStartTimeoutSecondsIntegerTimeout for the first byte of response.
minScaleIntegerMinimum number of container instances.
maxScaleIntegerMaximum number of container instances.

Job Config Object

Only applicable to Job apps. All fields are optional on the app environment, but a command must be available from the applied Job config snapshot or a per-run override before a Job can run.

FieldTypeDescription
commandStringCommand to execute for each run.
argsArray of stringsOptional argument list.
shellBooleanRuns through /bin/sh -lc when true. Default: true.
workingDirStringWorking directory inside the container.
timeoutSecondsIntegerActive deadline for a run. Default: 1800.
ttlSecondsAfterFinishedIntegerKubernetes TTL after completion. Default: 21600.
backoffLimitIntegerKubernetes Job retry backoff limit. Default: 0.
maxConcurrencyIntegerMaximum active runs for this Job environment.
allowConcurrentRunsBooleanAllows unlimited concurrent runs when true and maxConcurrency is omitted.

Example: Update Name and zClouds

curl -X PUT \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7d",
"name": "Production v2",
"zClouds": 4
}' \
https://api.quave.cloud/api/public/v1/app-env

Example: Update Environment Variables

curl -X PUT \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7d",
"envVars": [
{
"name": "API_KEY",
"value": "new-api-key-value",
"type": "DEPLOY",
"isSecret": true
},
{
"name": "DEBUG",
"value": "true",
"type": "BOTH",
"isSecret": false
}
]
}' \
https://api.quave.cloud/api/public/v1/app-env

Example Response

{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7d"
}

Notes

  • Secret environment variables will be automatically encrypted before storage
  • If you're updating the region, the system will mark the environment as "changing region" and trigger necessary infrastructure updates
  • Changes to resources (zClouds), branch, environment variables, or Job config generate "pending changes" that are applied through the Apply Changes flow

Update Job Config

Updates the command and execution defaults for a Job app environment. Only available for apps using the JOB docker preset.

Use this endpoint when you want to edit an existing Job environment after creation. These values override the app-level jobConfig; leave command, args, or workingDir empty to clear the environment override and inherit the app-level default.

Saving this endpoint creates pending deploy changes by default. Default JobRuns continue to use the previously applied Job config snapshot until the pending changes are applied with POST /api/public/v1/app-env/apply-changes, the MCP tool apply-app-env-changes, the dashboard Apply changes action, or applyImmediately: true.

Environment tokens scoped to the target environment can save pending Job config changes. They cannot use applyImmediately: true; applying changes immediately requires a user token.

Endpoint: PATCH /api/public/v1/app-env/job-config

Request Body

You must provide either appEnvId or envName.

FieldTypeRequiredDescription
appEnvIdStringNoApp environment ID. Required if envName is not provided.
envNameStringNoCLI environment name. Required if appEnvId is not provided.
jobConfigObjectNoNested Job config object. Top-level fields override matching nested fields.
commandStringNoCommand to execute for each JobRun. Empty clears the environment override.
argsArray of stringsNoOptional argument list. Empty clears the environment override.
shellBooleanNoRuns through /bin/sh -lc when true.
workingDirStringNoWorking directory inside the container. Empty clears the override.
timeoutSecondsIntegerNoActive deadline for one JobRun in seconds.
ttlSecondsAfterFinishedIntegerNoKubernetes TTL after a JobRun finishes, minimum 300 seconds.
backoffLimitIntegerNoKubernetes retry backoff limit.
maxConcurrencyIntegerNoMaximum active JobRuns for this environment.
allowConcurrentRunsBooleanNoAllows unlimited active runs when true and maxConcurrency is omitted.
applyImmediatelyBooleanNoIf true, apply pending changes immediately with a user token. Default: false.

Example

curl -X PATCH \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"appEnvId": "APP_ENV_ID",
"command": "bundle exec rails db:migrate",
"timeoutSeconds": 900,
"backoffLimit": 0
}' \
https://api.quave.cloud/api/public/v1/app-env/job-config

Example Response

{
"success": true,
"appEnv": {
"appEnvId": "APP_ENV_ID",
"pendingChanges": {
"hasDeployChanges": true,
"deployPendingChanges": [
{
"group": "Job Settings",
"field": "jobConfig"
}
]
}
},
"jobConfig": {
"command": "bundle exec rails db:migrate",
"timeoutSeconds": 900,
"backoffLimit": 0
},
"appliedImmediately": false
}

Notes

  • applyImmediately: false is the default. It saves the config and exposes the change in pendingChanges.
  • applyImmediately: true applies the saved Job config snapshot immediately and returns appliedImmediately: true.
  • A run created before applying the pending change still uses the previously applied command unless that run includes a per-run jobConfig override.
  • Historical JobRuns keep their original command snapshot.

Update Function Config

Updates the scaling and timeout configuration for a function app environment. Only available for apps using the FUNCTION docker preset. Functions are available starting from the Quave ONE Connect plan.

Endpoint: PATCH /api/public/v1/app-env/function-config

Request Body

FieldTypeRequiredDescription
appEnvIdStringEitherThe ID of the app environment.
envNameStringEitherThe CLI environment name (alternative to appEnvId).
containerConcurrencyIntegerNoMaximum concurrent requests per container.
timeoutSecondsIntegerNoRequest timeout in seconds.
idleTimeoutSecondsIntegerNoIdle timeout before scale-to-zero in seconds (minimum 300).
responseStartTimeoutSecondsIntegerNoTimeout for the first byte of response in seconds.
minScaleIntegerNoMinimum number of container instances. 0 allows scale-to-zero.
maxScaleIntegerNoMaximum number of container instances. Subject to account limits.
applyImmediatelyBooleanNoIf true, deploy changes immediately. Default: false.

Example

curl -X PATCH \
-H 'Authorization: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7d",
"containerConcurrency": 80,
"timeoutSeconds": 300,
"idleTimeoutSeconds": 600,
"minScale": 0,
"maxScale": 10,
"applyImmediately": true
}' \
https://api.quave.cloud/api/public/v1/app-env/function-config

Example Response

{
"success": true,
"appEnv": {
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7d",
"name": "Production",
"status": "UPDATING",
"isFunction": true,
"functionConfig": {
"containerConcurrency": 80,
"timeoutSeconds": 300,
"idleTimeoutSeconds": 600,
"minScale": 0,
"maxScale": 10
}
},
"appliedImmediately": true
}

Notes

  • This endpoint returns an error if the app does not use the FUNCTION docker preset.
  • Values for maxScale, minScale, and idleTimeoutSeconds are enforced against account-level limits.
  • If applyImmediately is false (default), changes are stored as pending changes and applied on the next deployment or when using the apply-changes endpoint.
  • You can also update function config through the general Update App Environment endpoint by passing a functionConfig object.

For more details about functions, see the Functions documentation.

Delete App Environment

To delete an app environment, send a DELETE request to the /api/public/v1/app-env endpoint. You need to provide the appEnvId as a query parameter.

Example:

curl -X DELETE \
-H 'Authorization: YOUR_TOKEN' \
https://api.quave.cloud/api/public/v1/app-env?appEnvId=5f7b1b7b7b7b7b7b7b7b7b7d

Example Response:

{
"message": "App Env deleted successfully"
}

Note: Deleting an app environment may have significant consequences. Make sure you want to perform this action before proceeding.

Environment Variables Object

The envVars field is an array of environment variables. Each environment variable is an object with the following fields:

FieldTypeDescription
nameStringThe environment variable name.
valueStringThe environment variable value.
typeStringThe type of the environment variable. Possible values are DEPLOY, BUILD, or BOTH.
isSecretBooleanWhether the environment variable is secret and should be encrypted. Default: true.

Database Settings Object

The databaseSettings field configures managed database environments. Only pass the settings block for the database engine used by the environment.

PostgreSQL Settings

For PostgreSQL environments, pass databaseSettings.postgresql.parameters.

ParameterTypeDescription
work_memStringPer-operation memory value, such as 16MB or 24MB.
hash_mem_multiplierNumberHash operation multiplier.
max_parallel_workers_per_gatherIntegerMaximum parallel workers per gather, from 0 through 64.
effective_cache_sizeStringPlanner cache size estimate, such as 1536MB or 6GB.

Example:

{
"databaseSettings": {
"postgresql": {
"parameters": {
"work_mem": "16MB",
"hash_mem_multiplier": 1,
"max_parallel_workers_per_gather": 2,
"effective_cache_size": "1536MB"
}
}
}
}

Tuning parameters above are mutable and applied on the next deploy.

Engine version and image are immutable

The dockerPresetVersion you pick at creation also selects the container image and, for PostgreSQL, the underlying engine variant. PostgreSQL-compatible variants such as TimescaleDB and ParadeDB run on a custom image (and TimescaleDB also pins a non-default user id) that is wired into the cluster when it is first created.

The image, the PostgreSQL major version, and the user/group ids are fixed for the life of the cluster. Changing dockerPresetVersion on an existing database environment is not supported, so the value is read-only after creation in the dashboard. To move to a different engine variant or major version, create a new database with the desired dockerPresetVersion and migrate your data into it.