Skip to main content
POST
Add or edit environment variables
string
required
The API key for your account. You can find this in your account settings.
Requires an API key with the envs:write scope. Writing does not grant reading: without envs:read, the response never includes variables the request did not send. Use this endpoint to add new environment variables or update specific ones without touching the rest. Existing variables that aren’t included in the request body are left untouched, which makes it the safest option for incremental changes like rotating a single API key. Static applications don’t support environment variables and return an error. The full set is capped at 256 variables per application, with a 1024-character limit per key and 4096 characters per value (the quotes added around it don’t count). On workspace-shared applications, the caller needs the admin role or ownership. Your application loads its variables with a shell, so a value with spaces or shell characters (such as & or ;) is stored single-quoted, as the dashboard does, and returned that way; a value you already quoted is kept as sent. A reference to another variable ($HOST, ${HOST}, alone or inside double quotes) keeps working, while command substitution ($(...) or backticks) is always stored as plain text. Names are letters, digits, underscores, dots and hyphens, not starting with a digit. To replace the entire variable set instead of merging, use Overwrite Variables. To remove specific keys, see Remove Variables, and to read the current values, see List Variables.

Parameters

string
required
The application ID.
object
required
The key and value of environment variables.

Response

string
Indicates whether the call was successful: success if it was, error if not.
object
All environment variables of the application after the change. An API key without the envs:read scope gets back only the variables it sent in this request.

Common errors