post-setting-values-v2
Batch replace feature flags and settings in a specific environment. Include the full updated state for each flag to avoid resetting omitted fields.
Instructions
This endpoint batch updates the Feature Flags and Settings of a Config identified by the configId parameter
in a specified Environment identified by the environmentId parameter.
Only those Feature Flags and Settings are updated which are part of the request, all the others are left untouched.
Important: As this endpoint is doing a complete replace on those Feature Flags and Settings, which are set in the request. It's important to set every other field that you don't want to change in its original state. Not listing a field means that it will reset.
For example: We have the following resource of a Feature Flag.
{
"settingFormulas": [
{
"defaultValue": {
"boolValue": false
},
"targetingRules": [
{
"conditions": [
{
"userCondition": {
"comparisonAttribute": "Email",
"comparator": "sensitiveTextEquals",
"comparisonValue": {
"stringValue": "test@example.com"
}
}
}
],
"percentageOptions": [],
"value": {
"boolValue": true
}
}
],
"settingId": 1
}
]
}If we send a batch replace request body as below:
{
"updateFormulas": [
{
"defaultValue": {
"boolValue": false
},
"settingId": 1
}
]
}Then besides that the default value is set to true, all Targeting Rules of the related Feature Flag are deleted.
So we get a response like this:
{
"settingFormulas": [
{
"defaultValue": {
"boolValue": false
},
"targetingRules": [],
"setting":
{
"settingId": 1
}
}
]
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| configId | Yes | ||
| environmentId | Yes | ||
| reason | No | ||
| requestBody | Yes |