Feature flags

The feature flags API allows you to list, create, modify, and delete feature flags, their statuses, and their expiring targets programmatically.

Anatomy of a feature flag

The feature flag API allows you to control percentage rollouts, target specific contexts, 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.

Sample feature flag representation

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": "Ariel",
    "lastName": "Flores",
    "role": "owner",
    "email": "ariel@acme.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"
      }
    }
  }
}

Top-level attributes

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.

Per-environment configurations

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 contexts.

Each section of the Targeting tab corresponds to a different attribute of the per-environment configuration data, as shown here:

Individual context targets

The targets array in the per-environment configuration data represents the individual context targeting rules on the Targeting tab. To learn more, read Targeting contexts.

Each object in the targets array represents a list of context keys assigned to a particular variation. For example:

{
    ...
    "environments" : {
        "production" : {
            ...
            "targets": [
                {
                    "values": ["sandy@example.com"],
                    "variation": 0
                }
            ]
        }
    }
}

This targets array here means that any context instance with the key sandy@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, sandy@example.com is receiving the true variation.

Targeting rules

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 contexts whose email address ends with gmail.com could be expressed here. To learn more, read Creating targeting rules.

The fallthrough rule

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

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.

Percentage rollouts

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 contexts that don't otherwise match any targets will receive that variation. The sum of weights across all variations should be 100%.

Get flag status across environments

Get the status for a particular feature flag across environments.

Request
path Parameters
projectKey
required
string <string>

The project key

featureFlagKey
required
string <string>

The feature flag key

query Parameters
env
string <string>

Optional environment filter

Responses
200

Flag status across environments response

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

get/api/v2/flag-status/{projectKey}/{featureFlagKey}
Request samples
Response samples
application/json
{
  • "environments": {
    },
  • "key": "flag-key-123abc",
  • "_links": {
    }
}

List feature flag statuses

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 yet
  • active: the feature flag was requested within the last seven days
  • inactive: the feature flag was created more than seven days ago, and hasn't been requested within the past seven days
  • launched: one variation of the feature flag has been rolled out for at least seven days
Request
path Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

Responses
200

Flag Statuses collection response

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

get/api/v2/flag-statuses/{projectKey}/{environmentKey}
Request samples
Response samples
application/json
{
  • "_links": {
    },
  • "items": [
    ]
}

Get feature flag status

Get the status for a particular feature flag.

Request
path Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

featureFlagKey
required
string <string>

The feature flag key

Responses
200

Flag status response

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

get/api/v2/flag-statuses/{projectKey}/{environmentKey}/{featureFlagKey}
Request samples
Response samples
application/json
{
  • "_links": {
    },
  • "name": "inactive",
  • "lastRequested": "2020-02-05T18:17:01.514Z",
  • "default": null
}

List feature flags

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.

Filtering flags

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.

Sorting flags

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 type

All 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.

Request
path Parameters
projectKey
required
string <string>

The project key

query Parameters
env
string <string>

Filter configurations by environment

tag
string <string>

Filter feature flags by tag

limit
integer <int64>

The number of feature flags to return. Defaults to -1, which returns all flags

offset
integer <int64>

Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query limit.

archived
boolean <boolean>

A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned

summary
boolean <boolean>

By default, flags do not include their lists of prerequisites, targets, or rules for each environment. Set summary=0 to include these fields for each flag returned.

filter
string <string>

A comma-separated list of filters. Each filter is of the form field:value. Read the endpoint description for a full list of available filter fields.

sort
string <string>

A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. Read the endpoint description for a full list of available sort fields.

compare
boolean <boolean>

A boolean to filter results by only flags that have differences between environments

Responses
200

Global flags collection response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

get/api/v2/flags/{projectKey}
Request samples
Response samples
application/json
{
  • "items": [
    ],
  • "_links": {
    },
  • "totalCount": 1,
  • "totalCountWithDifferences": 0
}

Create a feature flag

Create a feature flag with the given name, key, and variations.

Request
path Parameters
projectKey
required
string <string>

The project key

query Parameters
clone
string <string>

The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting clone=flagKey copies the full targeting configuration for all environments, including on/off state, from the original flag to the new flag.

Request Body schema: application/json
name
required
string

A human-friendly name for the feature flag

key
required
string

A unique key used to reference the flag in your code

description
string

Description of the feature flag. Defaults to an empty string.

includeInSnippet
boolean

Deprecated, use clientSideAvailability. Whether this flag should be made available to the client-side JavaScript SDK. Defaults to false.

object (ClientSideAvailabilityPost)
Array of objects (Variation)

An array of possible variations for the flag. The variation values must be unique. If omitted, two boolean variations of true and false will be used.

temporary
boolean

Whether the flag is a temporary flag. Defaults to true.

tags
Array of strings

Tags for the feature flag. Defaults to an empty array.

object (CustomProperties)
object (Defaults)
Responses
201

Global flag response

400

Invalid request

401

Invalid access token

409

Status conflict

429

Rate limited

post/api/v2/flags/{projectKey}
Request samples
application/json
{
  • "clientSideAvailability": {
    },
  • "key": "flag-key-123abc",
  • "name": "My Flag"
}
Response samples
application/json
{
  • "name": "My Flag",
  • "kind": "boolean",
  • "description": "This flag controls the example widgets",
  • "key": "flag-key-123abc",
  • "_version": 1,
  • "creationDate": 0,
  • "includeInSnippet": true,
  • "clientSideAvailability": {
    },
  • "variations": [
    ],
  • "temporary": true,
  • "tags": [
    ],
  • "_links": {
    },
  • "maintainerId": "569f183514f4432160000007",
  • "_maintainer": {
    },
  • "maintainerTeamKey": "team-1",
  • "_maintainerTeam": {
    },
  • "goalIds": [ ],
  • "experiments": {
    },
  • "customProperties": {
    },
  • "archived": false,
  • "archivedDate": 0,
  • "defaults": {
    },
  • "environments": {
    }
}

Get feature flag

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.

Request
path Parameters
projectKey
required
string <string>

The project key

featureFlagKey
required
string <string>

The feature flag key

query Parameters
env
string <string>

Filter configurations by environment

Responses
200

Global flag response

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

get/api/v2/flags/{projectKey}/{featureFlagKey}
Request samples
Response samples
application/json
{
  • "name": "My Flag",
  • "kind": "boolean",
  • "description": "This flag controls the example widgets",
  • "key": "flag-key-123abc",
  • "_version": 1,
  • "creationDate": 0,
  • "includeInSnippet": true,
  • "clientSideAvailability": {
    },
  • "variations": [
    ],
  • "temporary": true,
  • "tags": [
    ],
  • "_links": {
    },
  • "maintainerId": "569f183514f4432160000007",
  • "_maintainer": {
    },
  • "maintainerTeamKey": "team-1",
  • "_maintainerTeam": {
    },
  • "goalIds": [ ],
  • "experiments": {
    },
  • "customProperties": {
    },
  • "archived": false,
  • "archivedDate": 0,
  • "defaults": {
    },
  • "environments": {
    }
}

Update feature flag

Perform a partial update to a feature flag. The request body must be a valid semantic patch or JSON patch.

Using semantic patches on a feature flag

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 takes the following properties:

  • comment (string): (Optional) A description of the update.
  • environmentKey (string): (Required for some instructions only) 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. The body of a single semantic patch can contain many different instructions.

Instructions

Semantic patch requests support the following kind instructions for updating feature flags.

Click to expand instructions for turning flags on and off

These instructions require the environmentKey parameter.

turnFlagOff

Sets the flag's targeting state to Off.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [ { "kind": "turnFlagOff" } ]
}

turnFlagOn

Sets the flag's targeting state to On.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [ { "kind": "turnFlagOn" } ]
}

Click to expand instructions for working with targeting and variations

These instructions require the environmentKey parameter.

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.

addClauses

Adds the given clauses to the rule indicated by ruleId.

Parameters
  • ruleId: ID of a rule in the flag.
  • clauses: Array of clause objects, with contextKind (string), attribute (string), op (string), negate (boolean), and values (array of strings, numbers, or dates) properties.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "addClauses",
        "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29",
        "clauses": [{
            "contextKind": "user",
            "attribute": "country",
            "op": "in",
            "negate": false,
            "values": ["USA", "Canada"]
        }]
    }]
}

addPrerequisite

Adds the flag indicated by key with variation variationId as a prerequisite to the flag in the path parameter.

Parameters
  • key: Flag key of the prerequisite flag.
  • variationId: ID of a variation of the prerequisite flag.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "addPrerequisite",
        "key": "example-prereq-flag-key",
        "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00"
    }]
}

addRule

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, rolloutBucketBy, and rolloutContextKind 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.

Parameters
  • clauses: Array of clause objects, with contextKind (string), 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: (Optional) Map of variationId to weight, in thousandths of a percent (0-100000).
  • rolloutBucketBy: (Optional) Context attribute available in the specified rolloutContextKind.
  • rolloutContextKind: (Optional) Context kind, defaults to user

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [{
    "kind": "addRule",
    "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00",
    "clauses": [{
      "contextKind": "organization",
      "attribute": "located_in",
      "op": "in",
      "negate": false,
      "values": ["Sweden", "Norway"]
    }]
  }]
}

addTargets

Adds context keys to the individual context targets for the context kind that contextKind specifies and the variation that variationId specifies. Returns an error if this causes the flag to target the same context key in multiple variations.

Parameters
  • values: List of context keys.
  • contextKind: (Optional) Context kind to target, defaults to user
  • variationId: ID of a variation on the flag.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "addTargets",
        "values": ["context-key-123abc", "context-key-456def"],
        "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00"
    }]
}

addUserTargets

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. If you are working with contexts, use addTargets instead of this instruction.

Parameters
  • values: List of user keys.
  • variationId: ID of a variation on the flag.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "addUserTargets",
        "values": ["user-key-123abc", "user-key-456def"],
        "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00"
    }]
}

addValuesToClause

Adds values to the values of the clause that ruleId and clauseId indicate. Does not update the context kind, attribute, or operator.

Parameters
  • ruleId: ID of a rule in the flag.
  • clauseId: ID of a clause in that rule.
  • values: Array of strings.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "addValuesToClause",
        "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29",
        "clauseId": "10a58772-3121-400f-846b-b8a04e8944ed",
        "values": ["beta_testers"]
    }]
}

clearTargets

Removes all individual targets from the variation that variationId specifies. This includes both user and non-user targets.

Parameters
  • variationId: ID of a variation on the flag.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [ { "kind": "clearTargets", "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00" } ]
}

clearUserTargets

Removes all individual user targets from the variation that variationId specifies. If you are working with contexts, use clearTargets instead of this instruction.

Parameters
  • variationId: ID of a variation on the flag.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [ { "kind": "clearUserTargets", "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00" } ]
}

removeClauses

Removes the clauses specified by clauseIds from the rule indicated by ruleId.

Parameters
  • ruleId: ID of a rule in the flag.
  • clauseIds: Array of IDs of clauses in the rule.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "removeClauses",
        "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29",
        "clauseIds": ["10a58772-3121-400f-846b-b8a04e8944ed", "36a461dc-235e-4b08-97b9-73ce9365873e"]
    }]
}

removePrerequisite

Removes the prerequisite flag indicated by key. Does nothing if this prerequisite does not exist.

Parameters
  • key: Flag key of an existing prerequisite flag.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [ { "kind": "removePrerequisite", "key": "prereq-flag-key-123abc" } ]
}

removeRule

Removes the targeting rule specified by ruleId. Does nothing if the rule does not exist.

Parameters
  • ruleId: ID of a rule in the flag.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [ { "kind": "removeRule", "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29" } ]
}

removeTargets

Removes context keys from the individual context targets for the context kind that contextKind specifies and the variation that variationId specifies. Does nothing if the flag does not target the context keys.

Parameters
  • values: List of context keys.
  • contextKind: (Optional) Context kind to target, defaults to user
  • variationId: ID of a flag variation.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "removeTargets",
        "values": ["context-key-123abc", "context-key-456def"],
        "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00"
    }]
}

removeUserTargets

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. If you are working with contexts, use removeTargets instead of this instruction.

Parameters
  • values: List of user keys.
  • variationId: ID of a flag variation.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "removeUserTargets",
        "values": ["user-key-123abc", "user-key-456def"],
        "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00"
    }]
}

removeValuesFromClause

Removes values from the values of the clause indicated by ruleId and clauseId. Does not update the context kind, attribute, or operator.

Parameters
  • ruleId: ID of a rule in the flag.
  • clauseId: ID of a clause in that rule.
  • values: Array of strings.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "removeValuesFromClause",
        "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29",
        "clauseId": "10a58772-3121-400f-846b-b8a04e8944ed",
        "values": ["beta_testers"]
    }]
}

reorderRules

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.

Parameters
  • ruleIds: Array of IDs of all rules in the flag.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "reorderRules",
        "ruleIds": ["a902ef4a-2faf-4eaf-88e1-ecc356708a29", "63c238d1-835d-435e-8f21-c8d5e40b2a3d"]
    }]
}

replacePrerequisites

Removes all existing prerequisites and replaces them with the list you provide.

Parameters
  • prerequisites: A list of prerequisites. Each item in the list must include a flag key and variationId.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [
    {
      "kind": "replacePrerequisites",
      "prerequisites": [
        {
          "key": "prereq-flag-key-123abc",
          "variationId": "10a58772-3121-400f-846b-b8a04e8944ed"
        },
        {
          "key": "another-prereq-flag-key-456def",
          "variationId": "e5830889-1ec5-4b0c-9cc9-c48790090c43"
        }
      ]
    }
  ]
}

replaceRules

Removes all targeting rules for the flag and replaces them with the list you provide.

Parameters
  • rules: A list of rules.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [
    {
      "kind": "replaceRules",
      "rules": [
        {
          "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00",
          "description": "My new rule",
          "clauses": [
            {
              "contextKind": "user",
              "attribute": "segmentMatch",
              "op": "segmentMatch",
              "values": ["test"]
            }
          ],
          "trackEvents": true
        }
      ]
    }
  ]
}

replaceTargets

Removes all existing targeting and replaces it with the list of targets you provide.

Parameters
  • targets: A list of context targeting. Each item in the list includes an optional contextKind that defaults to user, a required variationId, and a required list of values.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [
    {
      "kind": "replaceTargets",
      "targets": [
        {
          "contextKind": "user",
          "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00",
          "values": ["user-key-123abc"]
        },
        {
          "contextKind": "device",
          "variationId": "e5830889-1ec5-4b0c-9cc9-c48790090c43",
          "values": ["device-key-456def"]
        }
      ]
    }    
  ]
}

replaceUserTargets

Removes all existing user targeting and replaces it with the list of targets you provide. In the list of targets, you must include a target for each of the flag's variations. If you are working with contexts, use replaceTargets instead of this instruction.

Parameters
  • targets: A list of user targeting. Each item in the list must include a variationId and a list of values.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [
    {
      "kind": "replaceUserTargets",
      "targets": [
        {
          "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00",
          "values": ["user-key-123abc", "user-key-456def"]
        },
        {
          "variationId": "e5830889-1ec5-4b0c-9cc9-c48790090c43",
          "values": ["user-key-789ghi"]
        }
      ]
    }
  ]
}

updateClause

Replaces the clause indicated by ruleId and clauseId with clause.

Parameters
  • ruleId: ID of a rule in the flag.
  • clauseId: ID of a clause in that rule.
  • clause: New clause object, with contextKind (string), attribute (string), op (string), negate (boolean), and values (array of strings, numbers, or dates) properties.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [{
    "kind": "updateClause",
    "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29",
    "clauseId": "10c7462a-2062-45ba-a8bb-dfb3de0f8af5",
    "clause": {
      "contextKind": "user",
      "attribute": "country",
      "op": "in",
      "negate": false,
      "values": ["Mexico", "Canada"]
    }
  }]
}

updateFallthroughVariationOrRollout

Updates the default or "fallthrough" rule for the flag, which the flag serves when a context 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.

Parameters
  • variationId: ID of a variation of the flag. or
  • rolloutWeights: Map of variationId to weight, in thousandths of a percent (0-100000).
  • rolloutBucketBy: (Optional) Context attribute available in the specified rolloutContextKind.
  • rolloutContextKind: (Optional) Context kind, defaults to user

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "updateFallthroughVariationOrRollout",
        "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00"
    }]
}

updateOffVariation

Updates the default off variation to variationId. The flag serves the default off variation when the flag's targeting is Off.

Parameters
  • variationId: ID of a variation of the flag.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [ { "kind": "updateOffVariation", "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00" } ]
}

updatePrerequisite

Changes the prerequisite flag that key indicates to use the variation that variationId indicates. Returns an error if this prerequisite does not exist.

Parameters
  • key: Flag key of an existing prerequisite flag.
  • variationId: ID of a variation of the prerequisite flag.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "updatePrerequisite",
        "key": "example-prereq-flag-key",
        "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00"
    }]
}

updateRuleDescription

Updates the description of the feature flag rule.

Parameters
  • 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.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "updateRuleDescription",
        "description": "New rule description",
        "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29"
    }]
}

updateRuleTrackEvents

Updates whether or not LaunchDarkly tracks events for the feature flag associated with this rule.

Parameters
  • 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.

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "updateRuleTrackEvents",
        "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29",
        "trackEvents": true
    }]
}

updateRuleVariationOrRollout

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.

Parameters
  • 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) Context attribute available in the specified rolloutContextKind.

  • rolloutContextKind: (Optional) Context kind, defaults to user

Use this request body:

{
    "environmentKey": "environment-key-123abc",
    "instructions": [{
        "kind": "updateRuleVariationOrRollout",
        "ruleId": "a902ef4a-2faf-4eaf-88e1-ecc356708a29",
        "variationId": "2f43f67c-3e4e-4945-a18a-26559378ca00"
    }]
}

updateTrackEvents

Updates whether or not LaunchDarkly tracks events for the feature flag, for all rules.

Parameters
  • trackEvents: Whether or not events are tracked.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [ { "kind": "updateTrackEvents", "trackEvents": true } ]
}

updateTrackEventsFallthrough

Updates whether or not LaunchDarkly tracks events for the feature flag, for the default rule.

Parameters
  • trackEvents: Whether or not events are tracked.

Use this request body:

{
  "environmentKey": "environment-key-123abc",
  "instructions": [ { "kind": "updateTrackEventsFallthrough", "trackEvents": true } ]
}

Click to expand instructions for updating flag settings

These instructions do not require the environmentKey parameter. They make changes that apply to the flag across all environments.

addCustomProperties

Adds a new custom property to the feature flag. Custom properties are used to associate feature flags with LaunchDarkly integrations. For example, if you create an integration with an issue tracking service, you may want to associate a flag with a list of issues related to a feature's development.

Parameters
  • key: The custom property key.
  • name: The custom property name.
  • values: A list of the associated values for the custom property.

Use this request body:

{
    "instructions": [{
        "kind": "addCustomProperties",
        "key": "example-custom-property",
        "name": "Example custom property",
        "values": ["value1", "value2"]
    }]
}

addTags

Adds tags to the feature flag.

Parameters
  • values: A list of tags to add.

Use this request body:

{
  "instructions": [ { "kind": "addTags", "values": ["tag1", "tag2"] } ]
}

makeFlagPermanent

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 customers.

Use this request body:

{
  "instructions": [ { "kind": "makeFlagPermanent" } ]
}

makeFlagTemporary

Marks the feature flag as temporary.

Use this request body:

{
  "instructions": [ { "kind": "makeFlagTemporary" } ]
}

removeCustomProperties

Removes the associated values from a custom property. If all the associated values are removed, this instruction also removes the custom property.

Parameters
  • key: The custom property key.
  • values: A list of the associated values to remove from the custom property.
{
    "instructions": [{
        "kind": "replaceCustomProperties",
        "key": "example-custom-property",
        "values": ["value1", "value2"]
    }]
}

removeMaintainer

Removes the flag's maintainer. To set a new maintainer, use the flag's Settings tab in the LaunchDarkly user interface.

Use this request body:

{
  "instructions": [ { "kind": "removeMaintainer" } ]
}

removeTags

Removes tags from the feature flag.

Parameters
  • values: A list of tags to remove.

Use this request body:

{
  "instructions": [ { "kind": "removeTags", "values": ["tag1", "tag2"] } ]
}

replaceCustomProperties

Replaces the existing associated values for a custom property with the new values.

Parameters
  • key: The custom property key.
  • name: The custom property name.
  • values: A list of the new associated values for the custom property.

Use this request body:

{
 "instructions": [{
   "kind": "replaceCustomProperties",
   "key": "example-custom-property",
   "name": "Example custom property",
   "values": ["value1", "value2"]
 }]
}

turnOffClientSideAvailability

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.

Parameters
  • value: Use "usingMobileKey" to turn off availability for mobile SDKs. Use "usingEnvironmentId" to turn on availability for client-side SDKs.

Use this request body:

{
  "instructions": [ { "kind": "turnOffClientSideAvailability", "value": "usingMobileKey" } ]
}

turnOnClientSideAvailability

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.

Parameters
  • value: Use "usingMobileKey" to turn on availability for mobile SDKs. Use "usingEnvironmentId" to turn on availability for client-side SDKs.

Use this request body:

{
  "instructions": [ { "kind": "turnOnClientSideAvailability", "value": "usingMobileKey" } ]
}

updateDescription

Updates the feature flag description.

Parameters
  • value: The new description.

Use this request body:

{
  "instructions": [ { "kind": "updateDescription", "value": "Updated flag description" } ]
}

updateMaintainerMember

Updates the maintainer of the flag to an existing member and removes the existing maintainer.

Parameters
  • value: The ID of the member.

Use this request body:

{
  "instructions": [ { "kind": "updateMaintainerMember", "value": "61e9b714fd47591727db558a" } ]
}

updateMaintainerTeam

Updates the maintainer of the flag to an existing team and removes the existing maintainer.

Parameters
  • value: The key of the team.

Use this request body:

{
  "instructions": [ { "kind": "updateMaintainerTeam", "value": "example-team-key" } ]
}

updateName

Updates the feature flag name.

Parameters
  • value: The new name.

Use this request body:

{
  "instructions": [ { "kind": "updateName", "value": "Updated flag name" } ]
}

Click to expand instructions for updating the flag lifecycle

These instructions do not require the environmentKey parameter. They make changes that apply to the flag across all environments.

archiveFlag

Archives the feature flag. This retires it from LaunchDarkly without deleting it. You cannot archive a flag that is a prerequisite of other flags.

{
  "instructions": [ { "kind": "archiveFlag" } ]
}

deleteFlag

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 contexts.

Use this request body:

{
  "instructions": [ { "kind": "deleteFlag" } ]
}

restoreFlag

Restores the feature flag if it was previously archived.

Use this request body:

{
  "instructions": [ { "kind": "restoreFlag" } ]
}

Using JSON Patches on a feature flag

If you do not include the header described above, you can use JSON patch.

When using the update feature flag endpoint to add individual targets to a specific variation, there are two different patch documents, depending on whether there are already individual targets for the variation.

If a flag variation already has individual targets, 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 individual targets, the path for the JSON Patch operation is:

[
  {
    "op": "add",
    "path": "/environments/devint/targets/-",
    "value": { "variation": 0, "values": ["TestClient10"] }
  }
]

Required approvals

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.

Conflicts

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.

Request
path Parameters
projectKey
required
string <string>

The project key

featureFlagKey
required
string <string>

The feature flag key. The key identifies the flag in your code.

Request Body schema: application/json
required
Array of objects (JSONPatch)
comment
string

Optional comment

Responses
200

Global flag response

400

Invalid request

401

Invalid access token

404

Invalid resource identifier

405

Approval is required to make this request

409

Status conflict

429

Rate limited

patch/api/v2/flags/{projectKey}/{featureFlagKey}
Request samples
application/json
{
  • "patch": [
    ]
}
Response samples
application/json
{
  • "name": "My Flag",
  • "kind": "boolean",
  • "description": "This flag controls the example widgets",
  • "key": "flag-key-123abc",
  • "_version": 1,
  • "creationDate": 0,
  • "includeInSnippet": true,
  • "clientSideAvailability": {
    },
  • "variations": [
    ],
  • "temporary": true,
  • "tags": [
    ],
  • "_links": {
    },
  • "maintainerId": "569f183514f4432160000007",
  • "_maintainer": {
    },
  • "maintainerTeamKey": "team-1",
  • "_maintainerTeam": {
    },
  • "goalIds": [ ],
  • "experiments": {
    },
  • "customProperties": {
    },
  • "archived": false,
  • "archivedDate": 0,
  • "defaults": {
    },
  • "environments": {
    }
}

Delete feature flag

Delete a feature flag in all environments. Use with caution: only delete feature flags your application no longer uses.

Request
path Parameters
projectKey
required
string <string>

The project key

featureFlagKey
required
string <string>

The feature flag key. The key identifies the flag in your code.

Responses
204

Action succeeded

401

Invalid access token

404

Invalid resource identifier

409

Status conflict

429

Rate limited

delete/api/v2/flags/{projectKey}/{featureFlagKey}
Request samples
Response samples
application/json
{
  • "code": "unauthorized",
  • "message": "Invalid access token"
}

Copy feature flag

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.

Request
path Parameters
projectKey
required
string <string>

The project key

featureFlagKey
required
string <string>

The feature flag key. The key identifies the flag in your code.

Request Body schema: application/json
required
object (FlagCopyConfigEnvironment)
required
object (FlagCopyConfigEnvironment)
comment
string

Optional comment

includedActions
Array of strings

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.

Items Enum: "updateOn" "updateRules" "updateFallthrough" "updateOffVariation" "updatePrerequisites" "updateTargets"
excludedActions
Array of strings

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.

Items Enum: "updateOn" "updateRules" "updateFallthrough" "updateOffVariation" "updatePrerequisites" "updateTargets"
Responses
201

Global flag response

400

Invalid request

401

Invalid access token

405

Method not allowed

409

Status conflict

429

Rate limited

post/api/v2/flags/{projectKey}/{featureFlagKey}/copy
Request samples
application/json
{
  • "comment": "optional comment",
  • "source": {
    },
  • "target": {
    }
}
Response samples
application/json
{
  • "name": "My Flag",
  • "kind": "boolean",
  • "description": "This flag controls the example widgets",
  • "key": "flag-key-123abc",
  • "_version": 1,
  • "creationDate": 0,
  • "includeInSnippet": true,
  • "clientSideAvailability": {
    },
  • "variations": [
    ],
  • "temporary": true,
  • "tags": [
    ],
  • "_links": {
    },
  • "maintainerId": "569f183514f4432160000007",
  • "_maintainer": {
    },
  • "maintainerTeamKey": "team-1",
  • "_maintainerTeam": {
    },
  • "goalIds": [ ],
  • "experiments": {
    },
  • "customProperties": {
    },
  • "archived": false,
  • "archivedDate": 0,
  • "defaults": {
    },
  • "environments": {
    }
}

Get expiring context targets for feature flag

Get a list of context targets on a feature flag that are scheduled for removal.

Request
path Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

featureFlagKey
required
string <string>

The feature flag key

Responses
200

Expiring target response

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

get/api/v2/flags/{projectKey}/{featureFlagKey}/expiring-targets/{environmentKey}
Request samples
Response samples
application/json
{
  • "items": [
    ],
  • "_links": {
    }
}

Update expiring context targets on feature flag

Schedule a context for removal from individual targeting on a feature flag. The flag must already individually target the context.

You can add, update, or remove a scheduled removal date. You can only schedule a context 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.

Instructions

addExpiringTarget

Adds a date and time that LaunchDarkly will remove the context from the flag's individual targeting.

Parameters
  • value: The time, in Unix milliseconds, when LaunchDarkly should remove the context from individual targeting for this flag
  • variationId: The version of the flag variation to update. You can retrieve this by making a GET request for the flag
  • contextKey: The context key for the context to remove from individual targeting
  • contextKind: The kind of context represented by the contextKey

updateExpiringTarget

Updates the date and time that LaunchDarkly will remove the context from the flag's individual targeting

Parameters
  • value: The time, in Unix milliseconds, when LaunchDarkly should remove the context from individual targeting for this flag
  • variationId: The version of the flag variation to update. You can retrieve this by making a GET request for the flag.
  • contextKey: The context key for the context to remove from individual targeting
  • contextKind: The kind of context represented by the contextKey

removeExpiringTarget

Removes the scheduled removal of the context from the flag's individual targeting. The context will remain part of the flag's individual targeting until you explicitly remove them, or until you schedule another removal.

Parameters
  • variationId: The version of the flag variation to update. You can retrieve this by making a GET request for the flag.
  • contextKey: The context key for the context to remove from individual targeting
  • contextKind: The kind of context represented by the contextKey
Request
path Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

featureFlagKey
required
string <string>

The feature flag key

Request Body schema: application/json
comment
string

Optional comment describing the change

required
Array of objects (Instruction)

The instructions to perform when updating

Responses
200

Expiring target response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

patch/api/v2/flags/{projectKey}/{featureFlagKey}/expiring-targets/{environmentKey}
Request samples
application/json
{
  • "comment": "optional comment",
  • "instructions": [
    ]
}
Response samples
application/json
{
  • "items": [
    ],
  • "_links": {
    },
  • "totalInstructions": 0,
  • "successfulInstructions": 0,
  • "failedInstructions": 0,
  • "errors": [
    ]
}

Get expiring user targets for feature flag

Contexts are now available

After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use Get expiring context targets for feature flag instead of this endpoint. To learn more, read Contexts.

Get a list of user targets on a feature flag that are scheduled for removal.

Request
path Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

featureFlagKey
required
string <string>

The feature flag key

Responses
200

Expiring user target response

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

get/api/v2/flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey}
Request samples
Response samples
application/json
{
  • "items": [
    ],
  • "_links": {
    }
}

Update expiring user targets on feature flag

Contexts are now available

After you have upgraded your LaunchDarkly SDK to use contexts instead of users, you should use Update expiring context targets on feature flag instead of this endpoint. To learn more, read Contexts.

Schedule a target for removal from individual targeting on a feature flag. The flag must already serve a variation to specific targets based on their key.

You can add, update, or remove a scheduled removal date. You can only schedule a target 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.

Instructions

addExpireUserTargetDate

Adds a date and time that LaunchDarkly will remove the user from the flag's individual targeting.

Parameters
  • value: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag
  • 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 targeting

updateExpireUserTargetDate

Updates the date and time that LaunchDarkly will remove the user from the flag's individual targeting.

Parameters
  • value: The time, in Unix milliseconds, when LaunchDarkly should remove the user from individual targeting for this flag
  • 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 targeting

removeExpireUserTargetDate

Removes 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.

Parameters
  • 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 targeting
Request
path Parameters
projectKey
required
string <string>

The project key

environmentKey
required
string <string>

The environment key

featureFlagKey
required
string <string>

The feature flag key

Request Body schema: application/json
comment
string

Optional comment describing the change

required
Array of objects (Instruction)

The instructions to perform when updating

Responses
200

Expiring user target response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

patch/api/v2/flags/{projectKey}/{featureFlagKey}/expiring-user-targets/{environmentKey}
Request samples
application/json
{
  • "comment": "optional comment",
  • "instructions": [
    ]
}
Response samples
application/json
{
  • "items": [
    ],
  • "_links": {
    },
  • "totalInstructions": 1,
  • "successfulInstructions": 1,
  • "failedInstructions": 0,
  • "errors": [
    ]
}