Environment variables
Environment variables are key/value settings that your runtime app can read at runtime — things like a feature flag, a log level, or a public base URL. In Comwit Cloud you manage them per app, and they are applied to the builds that run for that app.
List environment variables
Section titled “List environment variables”Read the current environment for an app.
GET /v1/projects/{projectId}/apps/{appId}/environmentYou’ll need your project id (projectId) and the app id (appId) — see
Deploy an app and Apps overview for where
those come from.
Set or update a variable
Section titled “Set or update a variable”Setting a variable uses the variable’s key as the last path segment, with the value in the request body.
PUT /v1/projects/{projectId}/apps/{appId}/environment/{key}{ "value": "info", "secret": false }The body has two fields:
value— the string value to store for this key.secret— must befalse. Sendingtrueis rejected (see below).
PUT both creates a new key and updates an existing one — there is no separate “create” versus “update” call.
Remove a variable
Section titled “Remove a variable”DELETE /v1/projects/{projectId}/apps/{appId}/environment/{key}This removes a single key from the app’s environment.
Why secret: true is rejected
Section titled “Why secret: true is rejected”The secret field exists in the request shape, but the live policy does not
use a secret store for app environment values. If you send secret: true, the
API responds with:
{ "title": "Bad Request", "status": 400, "detail": "secret app env values are not enabled; store plain env values only"}In other words, every app environment value is stored and served as plain
configuration. To set a value successfully, send "secret": false.
Keep real secrets out
Section titled “Keep real secrets out”Because there is no secret backend for app env, treat everything you put here as plain, readable configuration:
- Safe to store: log levels, feature flags, public URLs, non-sensitive build settings.
- Do not store: passwords, API keys, signing secrets, or anything you would not want exposed in plain form.
Related
Section titled “Related”- Deploy an app — push a build that picks up these variables.
- Apps overview — how apps, builds, and projects fit together.
- Authentication — the
cwt_token you use to call these routes.