Skip to main content
Manage a workspace’s environments from code: create Bolt and agent environments, change their name, branch and dbt™ version, choose the default of each type, set what an agent environment defers to, and delete environments.
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 admin capability group. To read Environment.discovery, the key also needs Discovery API viewer. To read Environment.deferSchedule, it also needs Bolt admin or another group with bolt:schedules:list.
Keys, errors, and pagination work the same in every area. See Conventions.

Operations

Environment types and slugs

An environment’s type is SCHEDULER for a Bolt environment, where scheduled runs execute, or AGENT for an agent environment, where DinoAI agent runs execute. Each type has one default environment: runs of that type use it when they name no environment. Every environment has a slug, unique in its workspace, and the slug never changes. The operations on this page name an environment by its slug. A slug is lowercase letters and digits in groups joined by single hyphens, at most 80 characters, and is not production. Older workspaces have a built-in Bolt environment with the slug production. A new workspace, such as one from createWorkspace, gets a default Bolt environment and a default agent environment with generated slugs. Read environments to find the slugs.

Create an environment

createEnvironment creates an environment in the workspace that the key targets. A new agent environment defers to the default Bolt environment.
  • name is the display name.
  • slug is optional. Send your own slug to make the call safe to retry: sending the same input again returns the same environment, and the same slug with other settings is a CONFLICT. Without a slug, Paradime generates one, and every call creates another environment.
  • branch is the git branch its runs use. Leave it out for the workspace’s default branch.
  • dbtVersion is one of the workspace’s supportedDbtVersions. Leave it out to follow the workspace’s dbtâ„¢ version.
Then add its warehouse connection with createWarehouseConnection, and its variables with setEnvironmentVariables.

List environments

environments lists the workspace’s environments, ordered by slug. Pass type to list only one type.
deferEnvironment is null when the agent environment defers to a schedule or to nothing. deferSchedule is null when it defers to an environment or to nothing. To read a Bolt environment’s Discovery API data, select discovery. It returns the same data as the root environment(slug:) query, and it is null for an agent environment.

Change an environment

updateEnvironment changes only the settings that you send:
  • name: a new display name. It can’t be null.
  • branch: the git branch its runs use. null sets the workspace’s default branch.
  • dbtVersion: the dbtâ„¢ version its runs use. null follows the workspace’s dbtâ„¢ version. Changing a Bolt environment’s version redeploys the workspace’s Bolt schedules.
To make an environment the default of its type, call setDefaultEnvironment:

Set what an agent environment defers to

An agent environment’s runs defer to the most recent run of a Bolt environment, or to the runs of one Bolt schedule. In deferTo, set exactly one of environmentSlug and scheduleSlug. Send deferTo: null to clear the target. Only an agent environment has a defer target.

Delete an environment

deleteEnvironment deletes an environment with its warehouse connections and variables. Its slug is free to use again. Deleting it again is not an error.
You can’t delete the built-in production environment, the default environment of a type, or a Bolt environment that an agent environment defers to. Make another environment the default, or point the agent environments elsewhere, first.

Errors

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