Create an environment version

This operation creates a new version of your environment. You can modify a version until it's activated. Once you activate a version, you need to create a new one to edit its settings. An environment is a variant of an application or service in a given lifecycle stage, such as development, testing, or production. You create versions to experiment with rule settings and iterate without affecting other environments. Environment versions isolate different settings for your service until you explicitly promote them to production. Each environment version maintains its own change history of rule sets.

Path Params
string
required

Name of the workspace that unifies all resources for your application or service. You can rename the workspace with a separate operation after you initially create the resource.

string
required

Name of the environment, unique within a workspace. You can't modify it after you initially create it with a POST request.

Query Params
boolean
Defaults to true

Whether to re-use an existing resource version. The default true value checks for content parity and only creates a new version if the request content doesn't match an existing one. When false, creates a new version regardless of the request content.

string

For customers who manage more than one account, this runs the operation from another account. The Identity and Access Management API provides a list of available account switch keys.

Body Params
defaultRuleSet
object
string

An optional description for the environment version to help you identify its specific purpose.

string

Name of the environment visible in the Control Center application. You can change this value without affecting the environmentName.

origins
array of objects

Lists available origins.

origins
ruleSetOrder
array of objects
required
length ≥ 1

Determines the sequence in which edge servers execute rule sets during delivery. The rule sets execute in the order they appear in this list, with more specific rule sets overriding more general ones.

ruleSetOrder*
boolean
required

Indicates whether the rule set applies to this environment version. If a rule set is disabled, it doesn't execute, but it remains in the list to maintain the execution order of other rule sets.

string
enum
required

Specifies the type of rule or rule set, which determines where you define it and how you can use it across environments.

Show details on supported values

  • INLINE_RULES. Inline rules for rapid execution and simple setups that don't need to be shared. Defined and only available within a single environment.
  • CUSTOM_RULES. A versioned, modular rule set defining logic for a single environment. You can use it to delegate configuration ownership across different feature teams, and rapidly test complex logic on demand without risking accidental changes to parallel environments. To reuse custom rule logic across several workspaces or environments within a contract, you can upgrade them to SHARED_RULES.
  • SHARED_RULES. A versioned, modular rule set available to all workspaces and environments in a contract. Shared rule sets help you create common, iterable policies or organizational standards across environments.
  • SYSTEM_RULES. A versioned, modular, and pre-defined rule set based on industry best practices and product optimizations. Preconfigured rule sets apply default values that you can customize to fit your specific needs.
  • ACCOUNT_RULES. A versioned, modular rule set defined at the account level that applies to all configurations within that account. You can use it to enforce global delivery standards for traffic control, security headers, and logging.
Allowed:
string
required

Name of your custom rule set, unique within an environment and workspace.

integer
≥ 1

A unique system identifier for a version.

variableOverrides
array of objects

An optional list of variable set overrides to apply to this environment version. Overrides let you change the value of a variable for a specific environment version, without changing the variable's value in the workspace variable set.

variableOverrides
integer
≥ 1

Specifies the variable set version for use within rule sets. Variables reduce duplication and make your deployments more flexible, abstracting the detail away. You define global variables at the workspace level, setting overrides in specific environments as needed.

Response

Language
URL
LoadingLoading…
Response
Choose an example:
application/json