Skip to main content
Manage environment variables from code: set them in bulk on the workspace or on one environment, rename and delete them, list their names, and read one value when a key is allowed to.
Prerequisites:
  • These operations are part of the Enterprise plan. On other plans, they fail with PLAN_UPGRADE_REQUIRED.
  • An account API key with the X-Paradime-Workspace header, or a workspace API key.
  • The Environment variables admin capability group. To read a value with revealEnvironmentVariable, the key needs Environment variable values viewer, which Environment variables admin does not include.
Keys, errors, pagination, and write-only secrets work the same in every area. See Conventions.

Operations

Scopes

Every operation names one scope: A user’s own Code IDE variables are not part of the API. Each user manages them in the app. A variable name starts with a letter or _, then has letters, digits, and _. Names are case-sensitive. A value can’t be empty and can’t contain a NUL character.

Set variables

setEnvironmentVariables writes every variable you send in one write. mode decides what happens to the scope’s other variables:
  • MERGE, the default, keeps every other variable of the scope.
  • REPLACE makes the variables you send the scope’s only variables, and deletes the others. It needs at least one variable.
changedNames lists the names that the call added, gave a new value, or deleted. It is empty when nothing changed: sending the same input again changes nothing and adds no audit entry. When the workspace’s variables or a Bolt environment’s variables change, Paradime redeploys the workspace’s Bolt schedules. When the workspace’s variables change, Paradime also rewrites the workspace’s editor settings.
An empty value does not delete a variable: it fails with VALIDATION_FAILED. To delete variables, use deleteEnvironmentVariables.
A value can be a reference to a secret in AWS Secrets Manager, Azure Key Vault, or GCP Secret Manager, as in the example. Paradime reads the secret when the variable is used. See AWS Secret Manager.

List variables

environmentVariables lists the names of one scope’s variables, ordered by name, and never their values. A scope’s variables are stored together, so they all show the same updatedAt.
To read only the names of every environment’s variables in one query, select variableNames on environments.

Rename or delete variables

renameEnvironmentVariable renames a variable and keeps its value. No other variable of the scope can have the new name. A retry is safe: when name is missing and newName exists, the call succeeds and changes nothing. A success therefore does not prove that name existed.
deleteEnvironmentVariables deletes the names you send. It ignores names that do not exist, and deletedNames lists the ones it deleted. Rename and delete redeploy the Bolt schedules the same way as setEnvironmentVariables.

Read a value

revealEnvironmentVariable returns one variable’s value. It needs Environment variable values viewer, and every read adds an entry to the audit log. Give this group only to keys that must read values: a key that sets variables does not need it.

Errors

These are the cases specific to environment variables. For the error format and the codes every area shares, see Errors.