List Environment Variables
List an app's environment variables. Each variable is injected into the build with its exact name (so VITE_API_URL or NEXT_PUBLIC_* reaches your bundler as-is) and, for a managed, full-stack, WordPress or function app, into the running app. A secret's value is never returned — is_secret is true and value is empty.
The list also carries the variables a database connection gives the app (source: "database"): {PREFIX}DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASSWORD and DATABASE_URL, the last two masked like any secret. ngris builds them from the connection when it starts the app; they are not stored as variables and can't be set or deleted here — disconnect the database instead.
Variable fields
[A-Za-z_][A-Za-z0-9_]*).production, preview or all. preview means branch previews only; a deploy waiting to be promoted (activate=false) gets the production variables. When a name is set for all and for one environment, that environment's own value wins there.user: a variable you set. database: given by a database connection (read-only here).database row only (omitted on your own variables): the connection, database and user it comes from.database row only: true while the database or its user isn't ready; the variable reaches the app once both are. Omitted when false.Set an Environment Variable
Create or update one variable. Mark sensitive values (API keys, tokens) as a secret — they're encrypted at rest and never returned again. For a running managed, full-stack, WordPress or function app the change applies right away: ngris restarts the app (applied: true). Otherwise it applies on the next deploy.
An empty value keeps an existing secret's value: a variable that is already a secret, saved again with is_secret: true and "value": "", keeps the value it has. So a secret can't be set to an empty value; delete the variable instead.
Request (application/json)
[A-Za-z_][A-Za-z0-9_]*.is_secret: true): its value is kept.true encrypts the value at rest and hides it from future reads.production, preview or all (default). A value for one environment wins over the all value of the same name in that environment.Errors
DB_, DDL_ or WORDPRESS_DB_, and DATABASE_URL, are managed by ngris and refused.env_reserved_by_database: a database connection of this app gives it this name (e.g. ORDERS_DB_HOST) in an overlapping environment; name echoes it. Disconnect the database, or connect it with another prefix, to use the name. Also quota_paused when the app is paused over your plan's limits.Delete an Environment Variable
Remove one variable by name; ?environment=production|preview|all (default all) picks which one. Returns 204 No Content, or 404 “No variable with that name in the <environment> environment” when there is nothing to delete (nothing changes, nothing restarts). A running managed, full-stack, WordPress or function app restarts to apply it; otherwise it takes effect on the next deploy. Variables from a database connection can't be deleted here: disconnect the database.