> ### 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.
Request
This endpoint expects an object.
namestringRequired
A human-friendly name for the new environment
keystringRequired
A project-unique key for the new environment
colorstringRequired
A color to indicate this environment in the UI
defaultTtlintegerOptional
The default time (in minutes) that the PHP SDK can cache feature flag rules locally
secureModebooleanOptional
Ensures that one end user of the client-side SDK cannot inspect the variations for another end user
defaultTrackEventsbooleanOptional
The initial value of trackEvents for flags created in this environment. Does not affect existing flags. Required for Data Export, but doesn't enable Data Export on its own.
confirmChangesbooleanOptional
Requires confirmation for all flag and segment changes via the UI in this environment
requireCommentsbooleanOptional
Requires comments for all flag and segment changes via the UI in this environment
tagslist of stringsOptional
Tags to apply to the new environment
sourceobjectOptional
Indicates that the new environment created will be cloned from the provided source environment
criticalbooleanOptional
Whether the environment is critical
Response
Environment response
_linksmap from strings to objects
The location and content type of related resources
_idstring
The ID for the environment. Use this as the client-side ID for authorization in some client-side SDKs, and to associate LaunchDarkly environments with CDN integrations in edge SDKs.
keystring
A project-unique key for the new environment
namestring
A human-friendly name for the new environment
apiKeystring
The SDK key for the environment. Use this for authorization in server-side SDKs.
mobileKeystring
The mobile key for the environment. Use this for authorization in mobile SDKs.
colorstring
The color used to indicate this environment in the UI
defaultTtlinteger
The default time (in minutes) that the PHP SDK can cache feature flag rules locally
secureModeboolean
Ensures that one end user of the client-side SDK cannot inspect the variations for another end user
defaultTrackEventsboolean
The initial value of trackEvents for flags created in this environment. Does not affect existing flags. Required for Data Export, but doesn't enable Data Export on its own.
requireCommentsboolean
Whether members who modify flags and segments through the LaunchDarkly user interface are required to add a comment
confirmChangesboolean
Whether members who modify flags and segments through the LaunchDarkly user interface are required to confirm those changes
tagslist of strings
A list of tags for this environment
criticalboolean
Whether the environment is critical
approvalSettingsobjectOptional
Details about the approval settings for flags in this environment
resourceApprovalSettingsmap from strings to objectsOptional
Details about the approval settings for other resources in this environment, organized by resource kind (for example, “aiconfig” and “segment”)