replace-setting-value-v2
Replace the default value and targeting rules of a feature flag or setting in a specific environment, with full control over modifications and audit logging.
Instructions
This endpoint replaces the value and the Targeting Rules of a Feature Flag or Setting
in a specified Environment identified by the SDK key passed in the X-CONFIGCAT-SDKKEY header.
Only the defaultValue, targetingRules, and percentageEvaluationAttribute fields are modifiable by this endpoint.
Important: As this endpoint is doing a complete replace, it's important to set every other field that you don't want to change to its original state. Not listing one means it will reset.
For example: We have the following resource of a Feature Flag.
{
"defaultValue": {
"boolValue": false
},
"targetingRules": [
{
"conditions": [
{
"userCondition": {
"comparisonAttribute": "Email",
"comparator": "sensitiveTextEquals",
"comparisonValue": {
"stringValue": "test@example.com"
}
}
}
],
"percentageOptions": [],
"value": {
"boolValue": true
}
}
]
}If we send a replace request body as below:
{
"defaultValue": {
"boolValue": true
}
}Then besides that the default served value is set to true, all the Targeting Rules are deleted.
So we get a response like this:
{
"defaultValue": {
"boolValue": true
},
"targetingRules": []
}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 |