For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
Copying flag settings is an Enterprise feature
Copying flag settings is available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.
Copy flag settings from a source environment to a target environment.
By default, this operation copies the entire flag configuration. You can use the includedActions or excludedActions to specify that only part of the flag configuration is copied.
If you provide the optional currentVersion of a flag, this operation tests to ensure that the current flag version in the environment matches the version you’ve specified. The operation rejects attempts to copy flag settings if the environment’s current version of the flag does not match the version you’ve specified. You can use this to enforce optimistic locking on copy attempts.
curl --request POST \
--url https://app.launchdarkly.com/api/v2/flags/{projectKey}/{featureFlagKey}/copy \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"comment": "optional comment",
"source": {
"currentVersion": 1,
"key": "source-env-key-123abc"
},
"target": {
"currentVersion": 1,
"key": "target-env-key-123abc"
}
}
'{
"name": "My Flag",
"kind": "boolean",
"key": "flag-key-123abc",
"_version": 1,
"creationDate": "1494437420312",
"variations": [
{
"_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05",
"value": true
},
{
"_id": "a00bf58d-d252-476c-b915-15a74becacb4",
"value": false
}
],
"temporary": true,
"tags": [
"example-tag"
],
"_links": {
"parent": {
"href": "/api/v2/flags/my-project",
"type": "application/json"
},
"self": {
"href": "/api/v2/flags/my-project/my-flag",
"type": "application/json"
}
},
"experiments": "{\"baselineIdx\": 0,\"items\": []}",
"customProperties": "{\"jira.issues\":{\"name\":\"Jira issues\",\"value\":[\"is-123\",\"is-456\"]}}",
"archived": false,
"description": "This flag controls the example widgets",
"includeInSnippet": true,
"clientSideAvailability": "{\"usingMobileKey\":true,\"usingEnvironmentId\":false}",
"maintainerId": "569f183514f4432160000007",
"_maintainer": {
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"role": "admin",
"email": "ariel@acme.com",
"firstName": "Ariel",
"lastName": "Flores"
},
"maintainerTeamKey": "team-1",
"_maintainerTeam": {
"key": "team-key-123abc",
"name": "Example team",
"_links": {
"parent": {
"href": "/api/v2/teams",
"type": "application/json"
},
"roles": {
"href": "/api/v2/teams/example-team/roles",
"type": "application/json"
},
"self": {
"href": "/api/v2/teams/example-team",
"type": "application/json"
}
}
},
"goalIds": [],
"archivedDate": "1494437420312",
"deprecated": false,
"deprecatedDate": "1494437420312",
"defaults": "{\"onVariation\":0,\"offVariation\":1}",
"_purpose": "<string>",
"migrationSettings": {
"contextKind": "device",
"stageCount": 6
},
"environments": {
"my-environment": {
"_environmentName": "My Environment",
"_site": {
"href": "/default/my-environment/features/client-side-flag",
"type": "text/html"
},
"_summary": {
"prerequisites": 0,
"variations": {
"0": {
"contextTargets": 1,
"isFallthrough": true,
"nullRules": 0,
"rules": 0,
"targets": 1
},
"1": {
"isOff": true,
"nullRules": 0,
"rules": 0,
"targets": 0
}
}
},
"archived": false,
"contextTargets": [
{
"contextKind": "device",
"values": [
"device-key-123abc"
],
"variation": 0
}
],
"fallthrough": {
"variation": 0
},
"lastModified": 1627071171347,
"offVariation": 1,
"on": false,
"prerequisites": [],
"rules": [],
"salt": "61eddeadbeef4da1facecafe3a60a397",
"sel": "810edeadbeef4844facecafe438f2999492",
"targets": [
{
"contextKind": "user",
"values": [
"user-key-123abc"
],
"variation": 0
}
],
"trackEvents": false,
"trackEventsFallthrough": false,
"version": 1
}
}
}Documentation Index
Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The project key
The feature flag key. The key identifies the flag in your code.
The source environment
Show child attributes
"{\"key\": \"source-env-key-123abc\", \"currentVersion\": 1}"
The target environment
Show child attributes
"{\"key\": \"target-env-key-123abc\", \"currentVersion\": 1}"
Optional comment
Optional list of the flag changes to copy from the source environment to the target environment. You may include either includedActions or excludedActions, but not both. If you include neither, then all flag changes will be copied.
updateOn, updateRules, updateFallthrough, updateOffVariation, updatePrerequisites, updateTargets, updateFlagConfigMigrationSettings ["updateOn"]Optional list of the flag changes NOT to copy from the source environment to the target environment. You may include either includedActions or excludedActions, but not both. If you include neither, then all flag changes will be copied.
updateOn, updateRules, updateFallthrough, updateOffVariation, updatePrerequisites, updateTargets, updateFlagConfigMigrationSettings ["updateOn"]Global flag response
A human-friendly name for the feature flag
"My Flag"
Kind of feature flag
boolean, multivariate "boolean"
A unique key used to reference the flag in your code
"flag-key-123abc"
Version of the feature flag
1
Timestamp of flag creation date
"1494437420312"
An array of possible variations for the flag
Show child attributes
[
{
"_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05",
"value": true
},
{
"_id": "a00bf58d-d252-476c-b915-15a74becacb4",
"value": false
}
]Whether the flag is a temporary flag
true
Tags for the feature flag
["example-tag"]The location and content type of related resources
Show child attributes
{
"parent": {
"href": "/api/v2/flags/my-project",
"type": "application/json"
},
"self": {
"href": "/api/v2/flags/my-project/my-flag",
"type": "application/json"
}
}Experimentation data for the feature flag
Show child attributes
"{\"baselineIdx\": 0,\"items\": []}"
Metadata attached to the feature flag, in the form of the property key associated with a name and array of values for the metadata to associate with this flag. Typically used to store data related to an integration.
Show child attributes
"{\"jira.issues\":{\"name\":\"Jira issues\",\"value\":[\"is-123\",\"is-456\"]}}"
Boolean indicating if the feature flag is archived
false
Description of the feature flag
"This flag controls the example widgets"
Deprecated, use clientSideAvailability. Whether this flag should be made available to the client-side JavaScript SDK
true
Which type of client-side SDKs the feature flag is available to
Show child attributes
"{\"usingMobileKey\":true,\"usingEnvironmentId\":false}"
Associated maintainerId for the feature flag
"569f183514f4432160000007"
Associated maintainer member info for the feature flag
Show child attributes
The key of the associated team that maintains this feature flag
"team-1"
Associated maintainer team info for the feature flag
Show child attributes
Deprecated, use experiments instead
[]If archived is true, date of archive
"1494437420312"
Boolean indicating if the feature flag is deprecated
false
If deprecated is true, date of deprecation
"1494437420312"
The indices, from the array of variations, for the variations to serve by default when targeting is on and when targeting is off. These variations will be used for this flag in new environments. If omitted, the first and last variation will be used.
Show child attributes
"{\"onVariation\":0,\"offVariation\":1}"
Migration-related settings for the flag
Show child attributes
Details on the environments for this flag. Only returned if the request is filtered by environment, using the filterEnv query parameter.
Show child attributes
{
"my-environment": {
"_environmentName": "My Environment",
"_site": {
"href": "/default/my-environment/features/client-side-flag",
"type": "text/html"
},
"_summary": {
"prerequisites": 0,
"variations": {
"0": {
"contextTargets": 1,
"isFallthrough": true,
"nullRules": 0,
"rules": 0,
"targets": 1
},
"1": {
"isOff": true,
"nullRules": 0,
"rules": 0,
"targets": 0
}
}
},
"archived": false,
"contextTargets": [
{
"contextKind": "device",
"values": ["device-key-123abc"],
"variation": 0
}
],
"fallthrough": { "variation": 0 },
"lastModified": 1627071171347,
"offVariation": 1,
"on": false,
"prerequisites": [],
"rules": [],
"salt": "61eddeadbeef4da1facecafe3a60a397",
"sel": "810edeadbeef4844facecafe438f2999492",
"targets": [
{
"contextKind": "user",
"values": ["user-key-123abc"],
"variation": 0
}
],
"trackEvents": false,
"trackEventsFallthrough": false,
"version": 1
}
}curl --request POST \
--url https://app.launchdarkly.com/api/v2/flags/{projectKey}/{featureFlagKey}/copy \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"comment": "optional comment",
"source": {
"currentVersion": 1,
"key": "source-env-key-123abc"
},
"target": {
"currentVersion": 1,
"key": "target-env-key-123abc"
}
}
'{
"name": "My Flag",
"kind": "boolean",
"key": "flag-key-123abc",
"_version": 1,
"creationDate": "1494437420312",
"variations": [
{
"_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05",
"value": true
},
{
"_id": "a00bf58d-d252-476c-b915-15a74becacb4",
"value": false
}
],
"temporary": true,
"tags": [
"example-tag"
],
"_links": {
"parent": {
"href": "/api/v2/flags/my-project",
"type": "application/json"
},
"self": {
"href": "/api/v2/flags/my-project/my-flag",
"type": "application/json"
}
},
"experiments": "{\"baselineIdx\": 0,\"items\": []}",
"customProperties": "{\"jira.issues\":{\"name\":\"Jira issues\",\"value\":[\"is-123\",\"is-456\"]}}",
"archived": false,
"description": "This flag controls the example widgets",
"includeInSnippet": true,
"clientSideAvailability": "{\"usingMobileKey\":true,\"usingEnvironmentId\":false}",
"maintainerId": "569f183514f4432160000007",
"_maintainer": {
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"role": "admin",
"email": "ariel@acme.com",
"firstName": "Ariel",
"lastName": "Flores"
},
"maintainerTeamKey": "team-1",
"_maintainerTeam": {
"key": "team-key-123abc",
"name": "Example team",
"_links": {
"parent": {
"href": "/api/v2/teams",
"type": "application/json"
},
"roles": {
"href": "/api/v2/teams/example-team/roles",
"type": "application/json"
},
"self": {
"href": "/api/v2/teams/example-team",
"type": "application/json"
}
}
},
"goalIds": [],
"archivedDate": "1494437420312",
"deprecated": false,
"deprecatedDate": "1494437420312",
"defaults": "{\"onVariation\":0,\"offVariation\":1}",
"_purpose": "<string>",
"migrationSettings": {
"contextKind": "device",
"stageCount": 6
},
"environments": {
"my-environment": {
"_environmentName": "My Environment",
"_site": {
"href": "/default/my-environment/features/client-side-flag",
"type": "text/html"
},
"_summary": {
"prerequisites": 0,
"variations": {
"0": {
"contextTargets": 1,
"isFallthrough": true,
"nullRules": 0,
"rules": 0,
"targets": 1
},
"1": {
"isOff": true,
"nullRules": 0,
"rules": 0,
"targets": 0
}
}
},
"archived": false,
"contextTargets": [
{
"contextKind": "device",
"values": [
"device-key-123abc"
],
"variation": 0
}
],
"fallthrough": {
"variation": 0
},
"lastModified": 1627071171347,
"offVariation": 1,
"on": false,
"prerequisites": [],
"rules": [],
"salt": "61eddeadbeef4da1facecafe3a60a397",
"sel": "810edeadbeef4844facecafe438f2999492",
"targets": [
{
"contextKind": "user",
"values": [
"user-key-123abc"
],
"variation": 0
}
],
"trackEvents": false,
"trackEventsFallthrough": false,
"version": 1
}
}
}