For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
Enable or disable a feature flag for a context based on its context kind and key.
In the request body, the setting should be the variation value to set for the context. It must match the flag’s variation type. For example, for a boolean flag you can use "setting": true or "setting": false in the request body. For a string flag, you can use "setting": "existing_variation_value_to_use".
Omitting the setting attribute from the request body, or including a setting of null, erases the current setting for a context.
If you previously patched the flag, and the patch included the context’s data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the combination of the context’s key and kind before, it calculates the flag values based on the context kind and key.
curl --request PUT \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/{contextKind}/{contextKey}/flags/{featureFlagKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"setting": "existing_variation_value_to_use",
"comment": "make sure this context experiences a specific variation"
}
'{
"code": "invalid_request",
"message": "Invalid request body"
}Documentation Index
Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The project key
The environment key
The context kind
The context key
The feature flag key
Action succeeded
curl --request PUT \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/environments/{environmentKey}/contexts/{contextKind}/{contextKey}/flags/{featureFlagKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"setting": "existing_variation_value_to_use",
"comment": "make sure this context experiences a specific variation"
}
'{
"code": "invalid_request",
"message": "Invalid request body"
}