The feature flags API allows you to list, create, modify, and delete feature flags, their statuses, and their expiring targets programmatically.
The feature flag API allows you to control percentage rollouts, target specific users, or even toggle off a feature programmatically. By looking at the representation of a feature flag, we can see how to do any of these tasks.
Every feature flag has a set of top-level attributes, as well as an environments
map containing the flag rollout and targeting rules specific to each environment. Top-level attributes include things like the flag's name, description, tags, and creation date. To learn more, read Using feature flags.
For reference, here's a complete feature flag representation. Below we break this down and explain each attribute in detail.
{
"name": "Alternate product page",
"kind": "boolean",
"description": "This is a description",
"key": "alternate.page",
"creationDate": 1418684722483,
"includeInSnippet": true,
"variations": [
{
"value": true,
"name": "true"
},
{
"value": false,
"name": "false"
}
],
"defaults": {
"onVariation": 0,
"offVariation": 1
},
"temporary": false,
"tags": ["ops", "experiments"],
"_links": {
"parent": {
"href": "/api/v2/flags/default",
"type": "application/json"
},
"self": {
"href": "/api/v2/flags/default/alternate.page",
"type": "application/json"
}
},
"maintainerId": "548f6741c1efad40031b18ae",
"_maintainer": {
"_links": {
"parent": {
"href": "/internal/account/members",
"type": "application/json"
},
"self": {
"href": "/internal/account/members/548f6741c1efad40031b18ae",
"type": "application/json"
}
},
"_id": "548f6741c1efad40031b18ae",
"firstName": "Reese",
"lastName": "App",
"role": "owner",
"email": "refapp@launchdarkly.com",
"_pendingInvite": false,
"isBeta": false,
"customRoles": []
},
"goalIds": [],
"environments": {
"production": {
"on": true,
"archived": false,
"salt": "YWx0ZXJuYXRlLnBhZ2U=",
"sel": "45501b9314dc4641841af774cb038b96",
"lastModified": 1469326565348,
"version": 61,
"targets": [
{
"values": ["1461797806427-7-115540266"],
"variation": 0
},
{
"values": ["Gerhard.Little@yahoo.com"],
"variation": 1
}
],
"rules": [
{
"variation": 0,
"clauses": [
{
"attribute": "groups",
"op": "in",
"values": ["Top Customers"],
"negate": false
},
{
"attribute": "email",
"op": "endsWith",
"values": ["gmail.com"],
"negate": false
}
]
}
],
"fallthrough": {
"rollout": {
"variations": [
{
"variation": 0,
"weight": 60000
},
{
"variation": 1,
"weight": 40000
}
]
}
},
"offVariation": 1,
"prerequisites": [],
"_site": {
"href": "/default/production/features/alternate.page",
"type": "text/html"
}
},
"test": {
"on": true,
"archived": false,
"salt": "YWx0ZXJuYXRlLnBhZ2U=",
"sel": "76c63094d35949bb9dc9bd5c570bacf5",
"lastModified": 1455145480896,
"version": 37,
"targets": [
{
"values": [],
"variation": 0
},
{
"values": [],
"variation": 1
}
],
"rules": [],
"fallthrough": {
"rollout": {
"variations": [
{
"variation": 0,
"weight": 49000
},
{
"variation": 1,
"weight": 51000
}
]
}
},
"prerequisites": [],
"_site": {
"href": "/default/tester/features/alternate.page",
"type": "text/html"
}
}
}
}
Most of the top-level attributes have a straightforward interpretation. For example, to change the name of a feature, update the feature flag with the name
attribute set to the new name:
[
{ "op": "replace", "path": "/name", "value": "New name" }
]
The variations
array represents the different variation values that a feature flag has. For a boolean flag, there are two variations: true
and false
. Multivariate flags have more variation values, and those values could be any JSON type: numbers, strings, objects, or arrays. In targeting rules, the variations are referred to by their index into this array. Below are some specific examples.
Each entry in the environments
map contains a JSON object that represents the environment-specific flag configuration data available in the flag's Targeting tab. For example, to toggle off a feature flag in your production environment, use the following JSON patch operation:
[
{ "op": "replace", "path": "/environments/production/on", "value": false }
]
To learn more, read Targeting users.
Each section of the Targeting tab corresponds to a different attribute of the per-environment configuration data, as shown here:
The targets
array in the per-environment configuration data represents the individual user targeting rules on the Targeting tab. To learn more, read Targeting users.
Each object in the targets
array represents a list of user keys assigned to a particular variation. For example:
{
...
"environments" : {
"production" : {
...
"targets": [
{
"values": ["foo@example.com"],
"variation: 0
}
]
}
}
}
This targets
array here means that user foo@example.com
receives the first variation listed in the variations
array. Recall that the variations are stored at the top level of the flag JSON in an array, and the per-environment configuration rules point to indexes into this array. If this is a boolean flag, foo@example.com
is receiving the true
variation.
The rules
array corresponds to the custom targeting rules section of the Targeting tab. This is where you can express complex rules on attributes with conditions and operators. For example, a rule like "roll out the true
variation to 80% of users whose email address ends with gmail.com
could be expressed here. To learn more, read Creating targeting rules.
The fallthrough
object is a special rule that contains no conditions. It is the rollout strategy that is applied when none of the individual or custom targeting rules match. In the LaunchDarkly UI, it is called the "Default rule."
The off variation represents the variation to serve if the feature flag is turned off, meaning the on
attribute is false
. For boolean flags, this is usually false
. For multivariate flags, set the off variation to whatever variation represents the control or baseline behavior for your application. If you don't set the off variation, LaunchDarkly will serve the fallback value defined in your code.
The weight
attribute defines the percentage rollout for each variation. Weights range from 0 (a 0% rollout) to 100000 (a 100% rollout). The weights are scaled by a factor of 1000 so that fractions of a percent can be represented without using floating-point. For example, a weight of 50000
means that 50% of users that don't otherwise match any targets
will see that variation. The sum of weights across all variations should be 100%.
Get the status for a particular feature flag across environments.
Flag status across environments response
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "environments": {
- "production": {
- "lastRequested": "2020-02-05T18:17:01.514Z",
- "name": "inactive"
}
}, - "key": "my-flag",
- "_links": {
- "parent": {
- "href": "/api/v2/flag-status",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/flag-status/my-project/my-flag",
- "type": "application/json"
}
}
}
Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following:
new
: the feature flag was created within the last seven days, and has not been requested yetactive
: the feature flag was requested by your servers or clients within the last seven daysinactive
: the feature flag was created more than seven days ago, and hasn't been requested by your servers or clients within the past seven dayslaunched
: one variation of the feature flag has been rolled out to all your users for at least 7 daysFlag Statuses collection response
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "_links": {
- "self": {
- "href": "/api/v2/flag-statuses/my-project/my-environment",
- "type": "application/json"
}
}, - "items": [
- {
- "_links": {
- "parent": {
- "href": "/api/v2/flags/my-project/my-flag",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/flag-statuses/my-project/my-flag",
- "type": "application/json"
}
}, - "name": "inactive",
- "lastRequested": "2020-02-05T18:17:01.514Z",
- "default": null
}
]
}
Get the status for a particular feature flag.
Flag status response
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "_links": {
- "parent": {
- "href": "/api/v2/flags/my-project/my-flag",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/flag-statuses/my-project/my-flag",
- "type": "application/json"
}
}, - "name": "inactive",
- "lastRequested": "2020-02-05T18:17:01.514Z",
- "default": null
}
Get a list of all features in the given project. By default, each feature includes configurations for each environment. You can filter environments with the env
query parameter. For example, setting env=production
restricts the returned configurations to just your production environment. You can also filter feature flags by tag with the tag query parameter.
You can filter on certain fields using the filter
query parameter. For example, setting filter=query:dark-mode,tags:beta+test
matches flags with the string dark-mode
in their key or name, ignoring case, which also have the tags beta
and test
.
The filter
query parameter supports the following arguments:
query
is a string that matches against the flags' keys and names. It is not case sensitive.archived
is a boolean with values of true
or false
that filters the list to archived flags. Setting the value to true
returns only archived flags. When this is absent, only unarchived flags are returned.type
is a string allowing filtering to temporary
or permanent
flags.status
is a string allowing filtering to new
, inactive
, active
, or launched
flags in the specified environment. This filter also requires a filterEnv
field to be set to a valid environment. For example: filter=status:active,filterEnv:production
.tags
is a +
separated list of tags. It filters the list to members who have all of the tags in the list. For example: filter=tags:beta+test
.hasExperiment
is a boolean with values of true
or false
that returns any flags that are used in an experiment.hasDataExport
is a boolean with values of true
or false
that returns any flags that are exporting data in the specified environment. This includes flags that are exporting data from Experimentation. This filter also requires that you set a filterEnv
field to a valid environment key. For example: filter=hasDataExport:true,filterEnv:production
evaluated
is an object that contains a key of after
and a value in Unix time in milliseconds. This returns all flags that have been evaluated since the time you specify in the environment provided. This filter also requires you to set a filterEnv
field to a valid environment. For example: filter=evaluated:{"after": 1590768455282},filterEnv:production
.filterEnv
is a string with the key of a valid environment. You can use the filterEnv
field for filters that are environment-specific. If there are multiple environment-specific filters, you should only declare this parameter once. For example: filter=evaluated:{"after": 1590768455282},filterEnv:production,status:active
.By default, this returns all flags. You can page through the list with the limit
parameter and by following the first
, prev
, next
, and last
links in the returned _links
field. These links will not be present if the pages they refer to don't exist. For example, the first
and prev
links will be missing from the response on the first page.
You can sort flags based on the following fields:
creationDate
sorts by the creation date of the flag.key
sorts by the key of the flag.maintainerId
sorts by the flag maintainer.name
sorts by flag name.tags
sorts by tags.targetingModifiedDate
sorts by the date that the flag's targeting rules were last modified in a given environment. It must be used with env
parameter and it can not be combined with any other sort. If multiple env
values are provided, it will perform sort using the first one. For example, sort=-targetingModifiedDate&env=production&env=staging
returns results sorted by targetingModifiedDate
for the production
environment.type
sorts by flag typeAll fields are sorted in ascending order by default. To sort in descending order, prefix the field with a dash ( - ). For example, sort=-name
sorts the response by flag name in descending order.
Global flags collection response
Invalid request
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "items": [
- {
- "name": "My Flag",
- "kind": "boolean",
- "description": "This flag controls the example widgets",
- "key": "my-flag",
- "_version": 1,
- "creationDate": 0,
- "includeInSnippet": true,
- "clientSideAvailability": {
- "usingMobileKey": true,
- "usingEnvironmentId": true
}, - "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"
}
}, - "maintainerId": "569f183514f4432160000007",
- "_maintainer": {
- "_links": {
- "self": {
- "href": "/api/v2/members/569f183514f4432160000007",
- "type": "application/json"
}
}, - "_id": "569f183514f4432160000007",
- "firstName": "An",
- "lastName": "Example",
- "role": "admin",
- "email": "a.example@example.com"
}, - "maintainerTeamKey": "team-1",
- "_maintainerTeam": {
- "key": "example-team",
- "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": [ ],
- "experiments": {
- "baselineIdx": 0,
- "items": [
- {
- "metricKey": "my-metric",
- "_metric": {
- "experimentCount": 0,
- "_id": "5902deadbeef667524a01290",
- "key": "my-metric",
- "name": "my-metric",
- "kind": "custom",
- "_attachedFlagCount": 0,
- "_links": {
- "parent": {
- "href": "/api/v2/metrics/my-project",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/metrics/my-project/my-metric",
- "type": "application/json"
}
}, - "_site": {
- "href": null,
- "type": null
}, - "_access": {
- "denied": [ ],
- "allowed": [ ]
}, - "tags": [ ],
- "_creationDate": 0,
- "lastModified": {
- "date": null
}, - "maintainerId": "569fdeadbeef1644facecafe",
- "_maintainer": {
- "_links": { },
- "_id": null,
- "firstName": null,
- "lastName": null,
- "role": null,
- "email": null
}, - "description": "string",
- "isNumeric": true,
- "successCriteria": "HigherThanBaseline",
- "unit": "string",
- "eventKey": "string"
}, - "environments": [
- "production",
- "test",
- "my-environment"
], - "_environmentSettings": {
- "property1": {
- "startDate": null,
- "stopDate": null,
- "enabledPeriods": [ ]
}, - "property2": {
- "startDate": null,
- "stopDate": null,
- "enabledPeriods": [ ]
}
}
}
]
}, - "customProperties": {
- "property1": {
- "name": "Jira issues",
- "value": [
- "is-123",
- "is-456"
]
}, - "property2": {
- "name": "Jira issues",
- "value": [
- "is-123",
- "is-456"
]
}
}, - "archived": false,
- "archivedDate": 0,
- "defaults": {
- "onVariation": 0,
- "offVariation": 1
}, - "environments": {
- "my-environment": {
- "_environmentName": "My Environment",
- "_site": {
- "href": "/default/my-environment/features/client-side-flag",
- "type": "text/html"
}, - "_summary": {
- "prerequisites": 0,
- "variations": {
- "0": {
- "isFallthrough": true,
- "nullRules": 0,
- "rules": 0,
- "targets": 0
}, - "1": {
- "isOff": true,
- "nullRules": 0,
- "rules": 0,
- "targets": 0
}
}
}, - "archived": false,
- "fallthrough": {
- "variation": 0
}, - "lastModified": 1627071171347,
- "offVariation": 1,
- "on": false,
- "prerequisites": [ ],
- "rules": [ ],
- "salt": "61eddeadbeef4da1facecafe3a60a397",
- "sel": "810edeadbeef4844facecafe438f2999492",
- "targets": [ ],
- "trackEvents": false,
- "trackEventsFallthrough": false,
- "version": 1
}
}
}
], - "_links": {
- "self": {
- "href": "/api/v2/flags/default",
- "type": "application/json"
}
}, - "totalCount": 1,
- "totalCountWithDifferences": 0
}
Create a feature flag with the given name, key, and variations.
Global flag response
Invalid request
Invalid access token
Status conflict
Rate limited
{- "clientSideAvailability": {
- "usingEnvironmentId": true,
- "usingMobileKey": true
}, - "key": "my-flag",
- "name": "My Flag"
}
{- "name": "My Flag",
- "kind": "boolean",
- "description": "This flag controls the example widgets",
- "key": "my-flag",
- "_version": 1,
- "creationDate": 0,
- "includeInSnippet": true,
- "clientSideAvailability": {
- "usingMobileKey": true,
- "usingEnvironmentId": true
}, - "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"
}
}, - "maintainerId": "569f183514f4432160000007",
- "_maintainer": {
- "_links": {
- "self": {
- "href": "/api/v2/members/569f183514f4432160000007",
- "type": "application/json"
}
}, - "_id": "569f183514f4432160000007",
- "firstName": "An",
- "lastName": "Example",
- "role": "admin",
- "email": "a.example@example.com"
}, - "maintainerTeamKey": "team-1",
- "_maintainerTeam": {
- "key": "example-team",
- "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": [ ],
- "experiments": {
- "baselineIdx": 0,
- "items": [
- {
- "metricKey": "my-metric",
- "_metric": {
- "experimentCount": 0,
- "_id": "5902deadbeef667524a01290",
- "key": "my-metric",
- "name": "my-metric",
- "kind": "custom",
- "_attachedFlagCount": 0,
- "_links": {
- "parent": {
- "href": "/api/v2/metrics/my-project",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/metrics/my-project/my-metric",
- "type": "application/json"
}
}, - "_site": {
- "href": "string",
- "type": "string"
}, - "_access": {
- "denied": [
- {
- "action": null,
- "reason": null
}
], - "allowed": [
- {
- "action": null,
- "reason": null
}
]
}, - "tags": [ ],
- "_creationDate": 0,
- "lastModified": {
- "date": "2021-08-05T19:46:31.148082Z"
}, - "maintainerId": "569fdeadbeef1644facecafe",
- "_maintainer": {
- "_links": {
- "self": {
- "href": "/api/v2/members/569f183514f4432160000007",
- "type": "application/json"
}
}, - "_id": "569f183514f4432160000007",
- "firstName": "An",
- "lastName": "Example",
- "role": "admin",
- "email": "a.example@example.com"
}, - "description": "string",
- "isNumeric": true,
- "successCriteria": "HigherThanBaseline",
- "unit": "string",
- "eventKey": "string"
}, - "environments": [
- "production",
- "test",
- "my-environment"
], - "_environmentSettings": {
- "property1": {
- "startDate": 0,
- "stopDate": 0,
- "enabledPeriods": [
- {
- "startDate": null,
- "stopDate": null
}
]
}, - "property2": {
- "startDate": 0,
- "stopDate": 0,
- "enabledPeriods": [
- {
- "startDate": null,
- "stopDate": null
}
]
}
}
}
]
}, - "customProperties": {
- "property1": {
- "name": "Jira issues",
- "value": [
- "is-123",
- "is-456"
]
}, - "property2": {
- "name": "Jira issues",
- "value": [
- "is-123",
- "is-456"
]
}
}, - "archived": false,
- "archivedDate": 0,
- "defaults": {
- "onVariation": 0,
- "offVariation": 1
}, - "environments": {
- "my-environment": {
- "_environmentName": "My Environment",
- "_site": {
- "href": "/default/my-environment/features/client-side-flag",
- "type": "text/html"
}, - "_summary": {
- "prerequisites": 0,
- "variations": {
- "0": {
- "isFallthrough": true,
- "nullRules": 0,
- "rules": 0,
- "targets": 0
}, - "1": {
- "isOff": true,
- "nullRules": 0,
- "rules": 0,
- "targets": 0
}
}
}, - "archived": false,
- "fallthrough": {
- "variation": 0
}, - "lastModified": 1627071171347,
- "offVariation": 1,
- "on": false,
- "prerequisites": [ ],
- "rules": [ ],
- "salt": "61eddeadbeef4da1facecafe3a60a397",
- "sel": "810edeadbeef4844facecafe438f2999492",
- "targets": [ ],
- "trackEvents": false,
- "trackEventsFallthrough": false,
- "version": 1
}
}
}
Get a single feature flag by key. By default, this returns the configurations for all environments. You can filter environments with the env
query parameter. For example, setting env=production
restricts the returned configurations to just the production
environment.
Global flag response
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "name": "My Flag",
- "kind": "boolean",
- "description": "This flag controls the example widgets",
- "key": "my-flag",
- "_version": 1,
- "creationDate": 0,
- "includeInSnippet": true,
- "clientSideAvailability": {
- "usingMobileKey": true,
- "usingEnvironmentId": true
}, - "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"
}
}, - "maintainerId": "569f183514f4432160000007",
- "_maintainer": {
- "_links": {
- "self": {
- "href": "/api/v2/members/569f183514f4432160000007",
- "type": "application/json"
}
}, - "_id": "569f183514f4432160000007",
- "firstName": "An",
- "lastName": "Example",
- "role": "admin",
- "email": "a.example@example.com"
}, - "maintainerTeamKey": "team-1",
- "_maintainerTeam": {
- "key": "example-team",
- "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": [ ],
- "experiments": {
- "baselineIdx": 0,
- "items": [
- {
- "metricKey": "my-metric",
- "_metric": {
- "experimentCount": 0,
- "_id": "5902deadbeef667524a01290",
- "key": "my-metric",
- "name": "my-metric",
- "kind": "custom",
- "_attachedFlagCount": 0,
- "_links": {
- "parent": {
- "href": "/api/v2/metrics/my-project",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/metrics/my-project/my-metric",
- "type": "application/json"
}
}, - "_site": {
- "href": "string",
- "type": "string"
}, - "_access": {
- "denied": [
- {
- "action": null,
- "reason": null
}
], - "allowed": [
- {
- "action": null,
- "reason": null
}
]
}, - "tags": [ ],
- "_creationDate": 0,
- "lastModified": {
- "date": "2021-08-05T19:46:31.148082Z"
}, - "maintainerId": "569fdeadbeef1644facecafe",
- "_maintainer": {
- "_links": {
- "self": {
- "href": "/api/v2/members/569f183514f4432160000007",
- "type": "application/json"
}
}, - "_id": "569f183514f4432160000007",
- "firstName": "An",
- "lastName": "Example",
- "role": "admin",
- "email": "a.example@example.com"
}, - "description": "string",
- "isNumeric": true,
- "successCriteria": "HigherThanBaseline",
- "unit": "string",
- "eventKey": "string"
}, - "environments": [
- "production",
- "test",
- "my-environment"
], - "_environmentSettings": {
- "property1": {
- "startDate": 0,
- "stopDate": 0,
- "enabledPeriods": [
- {
- "startDate": null,
- "stopDate": null
}
]
}, - "property2": {
- "startDate": 0,
- "stopDate": 0,
- "enabledPeriods": [
- {
- "startDate": null,
- "stopDate": null
}
]
}
}
}
]
}, - "customProperties": {
- "property1": {
- "name": "Jira issues",
- "value": [
- "is-123",
- "is-456"
]
}, - "property2": {
- "name": "Jira issues",
- "value": [
- "is-123",
- "is-456"
]
}
}, - "archived": false,
- "archivedDate": 0,
- "defaults": {
- "onVariation": 0,
- "offVariation": 1
}, - "environments": {
- "my-environment": {
- "_environmentName": "My Environment",
- "_site": {
- "href": "/default/my-environment/features/client-side-flag",
- "type": "text/html"
}, - "_summary": {
- "prerequisites": 0,
- "variations": {
- "0": {
- "isFallthrough": true,
- "nullRules": 0,
- "rules": 0,
- "targets": 0
}, - "1": {
- "isOff": true,
- "nullRules": 0,
- "rules": 0,
- "targets": 0
}
}
}, - "archived": false,
- "fallthrough": {
- "variation": 0
}, - "lastModified": 1627071171347,
- "offVariation": 1,
- "on": false,
- "prerequisites": [ ],
- "rules": [ ],
- "salt": "61eddeadbeef4da1facecafe3a60a397",
- "sel": "810edeadbeef4844facecafe438f2999492",
- "targets": [ ],
- "trackEvents": false,
- "trackEventsFallthrough": false,
- "version": 1
}
}
}
Perform a partial update to a feature flag. The request body must be a valid semantic patch or JSON patch.
To make a semantic patch request, you must append domain-model=launchdarkly.semanticpatch
to your Content-Type
header. To learn more, read Updates using semantic patch.
The body of a semantic patch request for updating feature flags requires an environmentKey
in addition to instructions
and an optional comment
. The body of the request takes the following properties:
comment
(string): (Optional) A description of the update.environmentKey
(string): (Required) The key of the LaunchDarkly environment.instructions
(array): (Required) A list of actions the update should perform. Each action in the list must be an object with a kind
property that indicates the instruction. If the action requires parameters, you must include those parameters as additional fields in the object.Semantic patch requests support the following kind
instructions for updating feature flags.
Sets the flag's targeting state to Off.
For example, to turn a flag off, use this request body:
{
"environmentKey": "example-environment-key",
"instructions": [ { "kind": "turnFlagOff" } ]
}
Sets the flag's targeting state to On.
For example, to turn a flag on, use this request body:
{
"environmentKey": "example-environment-key",
"instructions": [ { "kind": "turnFlagOn" } ]
}
Several of the instructions for working with targeting and variations require flag rule IDs, variation IDs, or clause IDs as parameters. Each of these are returned as part of the Get feature flag response. The flag rule ID is the _id
field of each element in the rules
array within each environment listed in the environments
object. The variation ID is the _id
field in each element of the variations
array. The clause ID is the _id
field of each element of the clauses
array within the rules
array within each environment listed in the environments
object.
Adds the given clauses to the rule indicated by ruleId
.
ruleId
: ID of a rule in the flag.clauses
: Array of clause objects, with attribute
(string), op
(string), negate
(boolean), and values
(array of strings, numbers, or dates) properties.Adds the flag indicated by key
with variation variationId
as a prerequisite to the flag in the path parameter.
key
: Flag key of the prerequisite flag.variationId
: ID of a variation of the prerequisite flag.Adds a new targeting rule to the flag. The rule may contain clauses
and serve the variation that variationId
indicates, or serve a percentage rollout that rolloutWeights
and rolloutBucketBy
indicate.
If you set beforeRuleId
, this adds the new rule before the indicated rule. Otherwise, adds the new rule to the end of the list.
clauses
: Array of clause objects, with attribute
(string), op
(string), negate
(boolean), and values
(array of strings, numbers, or dates) properties.beforeRuleId
: (Optional) ID of a flag rule.variationId
: ID of a variation of the flag.rolloutWeights
: Map of variationId
to weight, in thousandths of a percent (0-100000).rolloutBucketBy
: (Optional) User attribute.Adds user keys to the individual user targets for the variation that variationId
specifies. Returns an error if this causes the flag to target the same user key in multiple variations.
values
: List of user keys.variationId
: ID of a variation on the flag.Adds values
to the values of the clause that ruleId
and clauseId
indicate.
ruleId
: ID of a rule in the flag.clauseId
: ID of a clause in that rule.values
: Array of strings.Removes all individual user targets from the variation that variationId
specifies.
variationId
: ID of a variation on the flag.Removes the clauses specified by clauseIds
from the rule indicated by ruleId
.
ruleId
: ID of a rule in the flag.clauseIds
: Array of IDs of clauses in the rule.Removes the prerequisite flag indicated by key
. Does nothing if this prerequisite does not exist.
key
: Flag key of an existing prerequisite flag.Removes the targeting rule specified by ruleId
. Does nothing if the rule does not exist.
ruleId
: ID of a rule in the flag.Removes user keys from the individual user targets for the variation that variationId
specifies. Does nothing if the flag does not target the user keys.
values
: List of user keys.variationId
: ID of a flag variation.Removes values
from the values of the clause indicated by ruleId
and clauseId
.
ruleId
: ID of a rule in the flag.clauseId
: ID of a clause in that rule.values
: Array of strings.Rearranges the rules to match the order given in ruleIds
. Returns an error if ruleIds
does not match the current set of rules on the flag.
ruleIds
: Array of IDs of all rules in the flag.Removes all existing prerequisites and replaces them with the list you provide.
prerequisites
: A list of prerequisites. Each item in the list must include a flag key
and variationId
.For example, to replace prerequisites, use this request body:
{
"environmentKey": "example-environment-key",
"instructions": [
{
"kind": "replacePrerequisites",
"prerequisites": [
{
"key": "prereq-flag-key",
"variationId": "variation-1"
},
{
"key": "another-prereq-flag-key",
"variationId": "variation-2"
}
]
}
]
}
Removes all targeting rules for the flag and replaces them with the list you provide.
rules
: A list of rules.For example, to replace rules, use this request body:
{
"environmentKey": "example-environment-key",
"instructions": [
{
"kind": "replaceRules",
"rules": [
{
"variationId": "variation-1",
"description": "myRule",
"clauses": [
{
"attribute": "segmentMatch",
"op": "segmentMatch",
"values": ["test"]
}
],
"trackEvents": true
}
]
}
]
}
Removes all existing user targeting and replaces it with the list of targets you provide.
targets
: A list of user targeting. Each item in the list must include a variationId
and a list of values
.For example, to replace user targets, use this request body:
{
"environmentKey": "example-environment-key",
"instructions": [
{
"kind": "replaceUserTargets",
"targets": [
{
"variationId": "variation-1",
"values": ["blah", "foo", "bar"]
},
{
"variationId": "variation-2",
"values": ["abc", "def"]
}
]
}
]
}
Replaces the clause indicated by ruleId
and clauseId
with clause
.
ruleId
: ID of a rule in the flag.clauseId
: ID of a clause in that rule.clause
: New clause
object, with attribute
(string), op
(string), negate
(boolean), and values
(array of strings, numbers, or dates) properties.Updates the default or "fallthrough" rule for the flag, which the flag serves when a user matches none of the targeting rules. The rule can serve either the variation that variationId
indicates, or a percent rollout that rolloutWeights
and rolloutBucketBy
indicate.
variationId
: ID of a variation of the flag.
orrolloutWeights
: Map of variationId
to weight, in thousandths of a percent (0-100000).rolloutBucketBy
: Optional user attribute.Updates the default off variation to variationId
. The flag serves the default off variation when the flag's targeting is Off.
variationId
: ID of a variation of the flag.Changes the prerequisite flag that key
indicates to use the variation that variationId
indicates. Returns an error if this prerequisite does not exist.
key
: Flag key of an existing prerequisite flag.variationId
: ID of a variation of the prerequisite flag.Updates the description of the feature flag rule.
description
: The new human-readable description for this rule.ruleId
: The ID of the rule. You can retrieve this by making a GET request for the flag.Updates whether or not LaunchDarkly tracks events for the feature flag associated with this rule.
ruleId
: The ID of the rule. You can retrieve this by making a GET request for the flag.trackEvents
: Whether or not events are tracked.Updates what ruleId
serves when its clauses evaluate to true. The rule can serve either the variation that variationId
indicates, or a percent rollout that rolloutWeights
and rolloutBucketBy
indicate.
ruleId
: ID of a rule in the flag.
variationId
: ID of a variation of the flag.
or
rolloutWeights
: Map of variationId
to weight, in thousandths of a percent (0-100000).
rolloutBucketBy
: Optional user attribute.
Updates whether or not LaunchDarkly tracks events for the feature flag, for all rules.
trackEvents
: Whether or not events are tracked.Updates whether or not LaunchDarkly tracks events for the feature flag, for the default rule.
trackEvents
: Whether or not events are tracked.Adds tags to the feature flag.
values
: A list of tags to add.Marks the feature flag as permanent. LaunchDarkly does not prompt you to remove permanent flags, even if one variation is rolled out to all your users.
Marks the feature flag as temporary.
Removes the flag's maintainer. To set a new maintainer, use the flag's Settings tab in the LaunchDarkly user interface.
Removes tags from the feature flag.
values
: A list of tags to remove.Turns off client-side SDK availability for the flag. This is equivalent to unchecking the SDKs using Mobile Key and/or SDKs using client-side ID boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them.
value
: Use "usingMobileKey" to turn on availability for mobile SDKs. Use "usingEnvironmentId" to turn on availability for client-side SDKs.Turns on client-side SDK availability for the flag. This is equivalent to unchecking the SDKs using Mobile Key and/or SDKs using client-side ID boxes for the flag. If you're using a client-side or mobile SDK, you must expose your feature flags in order for the client-side or mobile SDKs to evaluate them.
value
: Use "usingMobileKey" to turn on availability for mobile SDKs. Use "usingEnvironmentId" to turn on availability for client-side SDKs.Updates the feature flag description.
value
: The new description.Updates the maintainer of the flag to an existing member and removes the existing maintainer.
value
: The ID of the member.Updates the maintainer of the flag to an existing team and removes the existing maintainer.
value
: The key of the team.Updates the feature flag name.
value
: The new name.Archives the feature flag. This retires it from LaunchDarkly without deleting it. You cannot archive a flag that is a prerequisite of other flags.
Deletes the feature flag and its rules. You cannot restore a deleted flag. If this flag is requested again, the flag value defined in code will be returned for all users.
Restores the feature flag if it was previously archived.
The body of a single semantic patch can contain many different instructions.
{
"environmentKey": "production",
"instructions": [
{
"kind": "turnFlagOn"
},
{
"kind": "turnFlagOff"
},
{
"kind": "addUserTargets",
"variationId": "8bfb304e-d516-47e5-8727-e7f798e8992d",
"values": ["userId", "userId2"]
},
{
"kind": "removeUserTargets",
"variationId": "8bfb304e-d516-47e5-8727-e7f798e8992d",
"values": ["userId3", "userId4"]
},
{
"kind": "updateFallthroughVariationOrRollout",
"rolloutWeights": {
"variationId": 50000,
"variationId2": 50000
},
"rolloutBucketBy": null
},
{
"kind": "addRule",
"clauses": [
{
"attribute": "segmentMatch",
"negate": false,
"values": ["test-segment"]
}
],
"variationId": null,
"rolloutWeights": {
"variationId": 50000,
"variationId2": 50000
},
"rolloutBucketBy": "key"
},
{
"kind": "removeRule",
"ruleId": "99f12464-a429-40fc-86cc-b27612188955"
},
{
"kind": "reorderRules",
"ruleIds": ["2f72974e-de68-4243-8dd3-739582147a1f", "8bfb304e-d516-47e5-8727-e7f798e8992d"]
},
{
"kind": "addClauses",
"ruleId": "1134",
"clauses": [
{
"attribute": "email",
"op": "in",
"negate": false,
"values": ["test@test.com"]
}
]
},
{
"kind": "removeClauses",
"ruleId": "1242529",
"clauseIds": ["8bfb304e-d516-47e5-8727-e7f798e8992d"]
},
{
"kind": "updateClause",
"ruleId": "2f72974e-de68-4243-8dd3-739582147a1f",
"clauseId": "309845",
"clause": {
"attribute": "segmentMatch",
"negate": false,
"values": ["test-segment"]
}
},
{
"kind": "updateRuleVariationOrRollout",
"ruleId": "2342",
"rolloutWeights": null,
"rolloutBucketBy": null
},
{
"kind": "updateOffVariation",
"variationId": "3242453"
},
{
"kind": "addPrerequisite",
"variationId": "234235",
"key": "flagKey2"
},
{
"kind": "updatePrerequisite",
"variationId": "234235",
"key": "flagKey2"
},
{
"kind": "removePrerequisite",
"key": "flagKey"
}
]
}
If you do not include the header described above, you can use JSON patch.
When using the update feature flag endpoint to add individual users to a specific variation, there are two different patch documents, depending on whether users are already being individually targeted for the variation.
If a flag variation already has users individually targeted, the path for the JSON Patch operation is:
{
"op": "add",
"path": "/environments/devint/targets/0/values/-",
"value": "TestClient10"
}
If a flag variation does not already have users individually targeted, the path for the JSON Patch operation is:
[
{
"op": "add",
"path": "/environments/devint/targets/-",
"value": { "variation": 0, "values": ["TestClient10"] }
}
]
If a request attempts to alter a flag configuration in an environment where approvals are required for the flag, the request will fail with a 405. Changes to the flag configuration in that environment will require creating an approval request or a workflow.
If a flag configuration change made through this endpoint would cause a pending scheduled change or approval request to fail, this endpoint will return a 400. You can ignore this check by adding an ignoreConflicts
query parameter set to true
.
Global flag response
Invalid request
Invalid access token
Invalid resource identifier
Approval is required to make this request
Status conflict
Rate limited
{- "patch": [
- {
- "op": "replace",
- "path": "/description",
- "value": "New description for this flag"
}
]
}
{- "name": "My Flag",
- "kind": "boolean",
- "description": "This flag controls the example widgets",
- "key": "my-flag",
- "_version": 1,
- "creationDate": 0,
- "includeInSnippet": true,
- "clientSideAvailability": {
- "usingMobileKey": true,
- "usingEnvironmentId": true
}, - "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"
}
}, - "maintainerId": "569f183514f4432160000007",
- "_maintainer": {
- "_links": {
- "self": {
- "href": "/api/v2/members/569f183514f4432160000007",
- "type": "application/json"
}
}, - "_id": "569f183514f4432160000007",
- "firstName": "An",
- "lastName": "Example",
- "role": "admin",
- "email": "a.example@example.com"
}, - "maintainerTeamKey": "team-1",
- "_maintainerTeam": {
- "key": "example-team",
- "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": [ ],
- "experiments": {
- "baselineIdx": 0,
- "items": [
- {
- "metricKey": "my-metric",
- "_metric": {
- "experimentCount": 0,
- "_id": "5902deadbeef667524a01290",
- "key": "my-metric",
- "name": "my-metric",
- "kind": "custom",
- "_attachedFlagCount": 0,
- "_links": {
- "parent": {
- "href": "/api/v2/metrics/my-project",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/metrics/my-project/my-metric",
- "type": "application/json"
}
}, - "_site": {
- "href": "string",
- "type": "string"
}, - "_access": {
- "denied": [
- {
- "action": null,
- "reason": null
}
], - "allowed": [
- {
- "action": null,
- "reason": null
}
]
}, - "tags": [ ],
- "_creationDate": 0,
- "lastModified": {
- "date": "2021-08-05T19:46:31.148082Z"
}, - "maintainerId": "569fdeadbeef1644facecafe",
- "_maintainer": {
- "_links": {
- "self": {
- "href": "/api/v2/members/569f183514f4432160000007",
- "type": "application/json"
}
}, - "_id": "569f183514f4432160000007",
- "firstName": "An",
- "lastName": "Example",
- "role": "admin",
- "email": "a.example@example.com"
}, - "description": "string",
- "isNumeric": true,
- "successCriteria": "HigherThanBaseline",
- "unit": "string",
- "eventKey": "string"
}, - "environments": [
- "production",
- "test",
- "my-environment"
], - "_environmentSettings": {
- "property1": {
- "startDate": 0,
- "stopDate": 0,
- "enabledPeriods": [
- {
- "startDate": null,
- "stopDate": null
}
]
}, - "property2": {
- "startDate": 0,
- "stopDate": 0,
- "enabledPeriods": [
- {
- "startDate": null,
- "stopDate": null
}
]
}
}
}
]
}, - "customProperties": {
- "property1": {
- "name": "Jira issues",
- "value": [
- "is-123",
- "is-456"
]
}, - "property2": {
- "name": "Jira issues",
- "value": [
- "is-123",
- "is-456"
]
}
}, - "archived": false,
- "archivedDate": 0,
- "defaults": {
- "onVariation": 0,
- "offVariation": 1
}, - "environments": {
- "my-environment": {
- "_environmentName": "My Environment",
- "_site": {
- "href": "/default/my-environment/features/client-side-flag",
- "type": "text/html"
}, - "_summary": {
- "prerequisites": 0,
- "variations": {
- "0": {
- "isFallthrough": true,
- "nullRules": 0,
- "rules": 0,
- "targets": 0
}, - "1": {
- "isOff": true,
- "nullRules": 0,
- "rules": 0,
- "targets": 0
}
}
}, - "archived": false,
- "fallthrough": {
- "variation": 0
}, - "lastModified": 1627071171347,
- "offVariation": 1,
- "on": false,
- "prerequisites": [ ],
- "rules": [ ],
- "salt": "61eddeadbeef4da1facecafe3a60a397",
- "sel": "810edeadbeef4844facecafe438f2999492",
- "targets": [ ],
- "trackEvents": false,
- "trackEventsFallthrough": false,
- "version": 1
}
}
}
Delete a feature flag in all environments. Use with caution: only delete feature flags your application no longer uses.
Action succeeded
Invalid access token
Invalid resource identifier
Status conflict
Rate limited
{- "code": "unauthorized",
- "message": "Invalid access token"
}
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.
Global flag response
Invalid request
Invalid access token
Method not allowed
Status conflict
Rate limited
{- "comment": "optional comment",
- "source": {
- "currentVersion": 1,
- "key": "example-source-env"
}, - "target": {
- "currentVersion": 1,
- "key": "example-target-env"
}
}
{- "name": "My Flag",
- "kind": "boolean",
- "description": "This flag controls the example widgets",
- "key": "my-flag",
- "_version": 1,
- "creationDate": 0,
- "includeInSnippet": true,
- "clientSideAvailability": {
- "usingMobileKey": true,
- "usingEnvironmentId": true
}, - "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"
}
}, - "maintainerId": "569f183514f4432160000007",
- "_maintainer": {
- "_links": {
- "self": {
- "href": "/api/v2/members/569f183514f4432160000007",
- "type": "application/json"
}
}, - "_id": "569f183514f4432160000007",
- "firstName": "An",
- "lastName": "Example",
- "role": "admin",
- "email": "a.example@example.com"
}, - "maintainerTeamKey": "team-1",
- "_maintainerTeam": {
- "key": "example-team",
- "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": [ ],
- "experiments": {
- "baselineIdx": 0,
- "items": [
- {
- "metricKey": "my-metric",
- "_metric": {
- "experimentCount": 0,
- "_id": "5902deadbeef667524a01290",
- "key": "my-metric",
- "name": "my-metric",
- "kind": "custom",
- "_attachedFlagCount": 0,
- "_links": {
- "parent": {
- "href": "/api/v2/metrics/my-project",
- "type": "application/json"
}, - "self": {
- "href": "/api/v2/metrics/my-project/my-metric",
- "type": "application/json"
}
}, - "_site": {
- "href": "string",
- "type": "string"
}, - "_access": {
- "denied": [
- {
- "action": null,
- "reason": null
}
], - "allowed": [
- {
- "action": null,
- "reason": null
}
]
}, - "tags": [ ],
- "_creationDate": 0,
- "lastModified": {
- "date": "2021-08-05T19:46:31.148082Z"
}, - "maintainerId": "569fdeadbeef1644facecafe",
- "_maintainer": {
- "_links": {
- "self": {
- "href": "/api/v2/members/569f183514f4432160000007",
- "type": "application/json"
}
}, - "_id": "569f183514f4432160000007",
- "firstName": "An",
- "lastName": "Example",
- "role": "admin",
- "email": "a.example@example.com"
}, - "description": "string",
- "isNumeric": true,
- "successCriteria": "HigherThanBaseline",
- "unit": "string",
- "eventKey": "string"
}, - "environments": [
- "production",
- "test",
- "my-environment"
], - "_environmentSettings": {
- "property1": {
- "startDate": 0,
- "stopDate": 0,
- "enabledPeriods": [
- {
- "startDate": null,
- "stopDate": null
}
]
}, - "property2": {
- "startDate": 0,
- "stopDate": 0,
- "enabledPeriods": [
- {
- "startDate": null,
- "stopDate": null
}
]
}
}
}
]
}, - "customProperties": {
- "property1": {
- "name": "Jira issues",
- "value": [
- "is-123",
- "is-456"
]
}, - "property2": {
- "name": "Jira issues",
- "value": [
- "is-123",
- "is-456"
]
}
}, - "archived": false,
- "archivedDate": 0,
- "defaults": {
- "onVariation": 0,
- "offVariation": 1
}, - "environments": {
- "my-environment": {
- "_environmentName": "My Environment",
- "_site": {
- "href": "/default/my-environment/features/client-side-flag",
- "type": "text/html"
}, - "_summary": {
- "prerequisites": 0,
- "variations": {
- "0": {
- "isFallthrough": true,
- "nullRules": 0,
- "rules": 0,
- "targets": 0
}, - "1": {
- "isOff": true,
- "nullRules": 0,
- "rules": 0,
- "targets": 0
}
}
}, - "archived": false,
- "fallthrough": {
- "variation": 0
}, - "lastModified": 1627071171347,
- "offVariation": 1,
- "on": false,
- "prerequisites": [ ],
- "rules": [ ],
- "salt": "61eddeadbeef4da1facecafe3a60a397",
- "sel": "810edeadbeef4844facecafe438f2999492",
- "targets": [ ],
- "trackEvents": false,
- "trackEventsFallthrough": false,
- "version": 1
}
}
}
Get a list of user targets on a feature flag that are scheduled for removal.
Expiring user target response
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "items": [
- {
- "_id": "12ab3c45de678910fgh12345",
- "_version": 1,
- "expirationDate": 0,
- "userKey": "example-user-key",
- "targetType": "included",
- "variationId": "ce67d625-a8b9-4fb5-a344-ab909d9d4f4d",
- "_resourceId": {
- "kind": "string",
- "projectKey": "string",
- "environmentKey": "string",
- "flagKey": "string",
- "key": "string"
}
}
], - "_links": {
- "property1": {
- "href": "string",
- "type": "string"
}, - "property2": {
- "href": "string",
- "type": "string"
}
}
}
Schedule a user for removal from individual targeting on a feature flag. The flag must already individually target the user.
You can add, update, or remove a scheduled removal date. You can only schedule a user for removal on a single variation per flag.
This request only supports semantic patches. To make a semantic patch request, you must append domain-model=launchdarkly.semanticpatch
to your Content-Type
header. To learn more, read Updates using semantic patch.
Adds a date and time that LaunchDarkly will remove the user from the flag's individual targeting.
value
: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flagvariationId
: The version of the flag variation to update. You can retrieve this by making a GET request for the flag.userKey
: The user key for the user to remove from individual targetingUpdates the date and time that LaunchDarkly will remove the user from the flag's individual targeting.
value
: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flagvariationId
: The version of the flag variation to update. You can retrieve this by making a GET request for the flag.userKey
: The user key for the user to remove from individual targetingRemoves the scheduled removal of the user from the flag's individual targeting. The user will remain part of the flag's individual targeting until you explicitly remove them, or until you schedule another removal.
variationId
: The version of the flag variation to update. You can retrieve this by making a GET request for the flag.userKey
: The user key for the user to remove from individual targetingExpiring user target response
Invalid request
Invalid access token
Forbidden
Invalid resource identifier
Rate limited
{- "comment": "optional comment",
- "instructions": [
- {
- "kind": "addExpireUserTargetDate",
- "userKey": "sandy",
- "value": 1686412800000,
- "variationId": "ce12d345-a1b2-4fb5-a123-ab123d4d5f5d"
}
]
}
{- "items": [
- {
- "_id": "12ab3c45de678910fgh12345",
- "_version": 1,
- "expirationDate": 0,
- "userKey": "example-user-key",
- "targetType": "included",
- "variationId": "ce67d625-a8b9-4fb5-a344-ab909d9d4f4d",
- "_resourceId": {
- "kind": "string",
- "projectKey": "string",
- "environmentKey": "string",
- "flagKey": "string",
- "key": "string"
}
}
], - "_links": {
- "property1": {
- "href": "string",
- "type": "string"
}, - "property2": {
- "href": "string",
- "type": "string"
}
}, - "totalInstructions": 1,
- "successfulInstructions": 1,
- "failedInstructions": 0,
- "errors": [
- {
- "instructionIndex": 1,
- "message": "example error message"
}
]
}