Skip to main content

App Environments API

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

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

Note: All endpoints in this API accept only the user token.

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.

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.zcloud.ws/api/public/v1/app-env

Example Response:

{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7d"
}

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

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.

Example:

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

Example Response:

{
"appEnvId": "5f7b1b7b7b7b7b7b7b7b7b7d",
"name": "Production",
"slug": "production",
"region": "us-5",
"gitBranch": "main",
"cliEnvName": null,
"allowUserCliToken": false
}

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.
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.

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.zcloud.ws/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.