update-setting-value
Modify feature flag or setting values with JSON Patch, updating only specified attributes such as value, rollout rules, or percentage rules without affecting others.
Instructions
This endpoint updates the value of a Feature Flag or Setting with a collection of JSON Patch operations in a specified Environment.
Only the value, rolloutRules and percentageRules attributes are modifiable by this endpoint.
The advantage of using JSON Patch is that you can describe individual update operations on a resource without touching attributes that you don't want to change. It supports collection reordering, so it also can be used for reordering the targeting rules of a Feature Flag or Setting.
For example: We have the following resource.
{
"rolloutPercentageItems": [
{
"percentage": 30,
"value": true
},
{
"percentage": 70,
"value": false
}
],
"rolloutRules": [],
"value": false
}If we send an update request body as below:
[
{
"op": "replace",
"path": "/value",
"value": true
}
]Only the default value is going to be set to true and all the Percentage Rules are remaining unchanged.
So we get a response like this:
{
"rolloutPercentageItems": [
{
"percentage": 30,
"value": true
},
{
"percentage": 70,
"value": false
}
],
"rolloutRules": [],
"value": true
}The rolloutRules property describes two types of rules:
Targeting rules: When you want to add or update a targeting rule, the
comparator,comparisonAttribute, andcomparisonValuemembers are required.Segment rules: When you want to add add or update a segment rule, the
segmentIdwhich identifies the desired segment and thesegmentComparatormembers are required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environmentId | Yes | The identifier of the Environment. | |
| settingId | Yes | The identifier of the Setting. | |
| reason | No | The reason note for the Audit Log if the Product's "Config changes require a reason" preference is turned on. | |
| requestBody | Yes |