provider Environments POST /api/v2/projects/{projectKey}/environments
@utdk/launchdarkly /api/v2/projects/{projectKey}/environments
Create environment
> ### Approval settings > > You cannot configure approval settings when you create a new environment. Use [Update environment](https://launchdarkly.com/docs/api/environments/patch-environment) to update approval settings. > > The `approvalSettings` and `resourceApprovalSettings` keys are only returned when the [approvals](https://launchdarkly.com/docs/home/releases/approvals/) feature is enabled. Create a new environment in a specified project with a given name, key, swatch color, and default TTL.
projectKey path required
The project key
string

Try it

Authentication
Configure credentials for LaunchDarkly REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

postenvironment
POST/api/v2/projects/{projectKey}/environments
> ### Approval settings > > You cannot configure approval settings when you create a new environment. Use [Update environment](https://launchdarkly.com/docs/api/environments/patch-environment) to update approval settings. > > The `approvalSettings` and `resourceApprovalSettings` keys are only returned when the [approvals](https://launchdarkly.com/docs/home/releases/approvals/) feature is enabled. Create a new environment in a specified project with a given name, key, swatch color, and default TTL.

Parameters

required

The project key

Input

required

A human-friendly name for the new environment

required

A project-unique key for the new environment

required

A color to indicate this environment in the UI

The default time (in minutes) that the PHP SDK can cache feature flag rules locally

Ensures that one end user of the client-side SDK cannot inspect the variations for another end user

Enables tracking detailed information for new flags by default

Requires confirmation for all flag and segment changes via the UI in this environment

Requires comments for all flag and segment changes via the UI in this environment

Tags to apply to the new environment

Whether the environment is critical

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import launchdarkly from '@utdk/launchdarkly';

await launchdarkly.postenvironment()