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:
Field | Type | Description |
---|---|---|
accountId | String | The ID of the account. |
appId | String | The ID of the app. |
name | String | The name of the app environment. |
region | String | The region for the app environment (must be one of the allowed values). |
Optional fields:
Field | Type | Description |
---|---|---|
branch | String | The Git branch to use. Required for apps that use GitHub. |
zClouds | Number | The number of zClouds to use (1, 2, 4, or 8). Defaults to 1. |
envVars | Array | The 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:
Field | Type | Description |
---|---|---|
appEnvId | String | The app environment ID. |
name | String | The name of the app environment. |
slug | String | The slug of the app environment. |
region | String | The region for the app environment. |
gitBranch | String | The Git branch used for the app environment. For apps that don't use GitHub, the value will be cli . |
cliEnvName | String | The CLI environment name. |
allowUserCliToken | Boolean | Whether 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:
Field | Type | Description |
---|---|---|
name | String | The environment variable name. |
value | String | The environment variable value. |
type | String | The type of the environment variable. Possible values are DEPLOY , BUILD , or BOTH . |
isSecret | Boolean | Whether the environment variable is secret and should be encrypted. |