Skip to main content

Replace value

PUT 

/v2/settings/:settingKeyOrId/value

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": "[email protected]"
}
}
}
],
"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": []
}

Request

Responses