I need to modify rollout rules with additional audience condition for features using Optimizely APIs. Trying to call with url [PATCH] api.optimizely.com/v2/features/{feature_id}, returns 400 BAD Request.
{
"archived": false,
"description": "Parsing of response fails when there is an unknown property",
"environments": {
"scale01": {
"is_primary": false,
"rollout_rules": [
{
"audience_conditions": "[\"or\", {\"audience_id\": 0733}]",
"enabled": true,
"percentage_included": 100
},
{
"audience_conditions": "everyone",
"enabled": true,
"percentage_included": 0
}
]
}
},
"key": "fail_for_unknown_property",
"name": "Fail parsing for unknown property"
}
Tried configuring this audience condition from UI, then did a GET call for this feature. Whatever payload did the GET call gave me, used it for configuring this feature with modified rollout rules. Still it gives me 400 bad request. Only time it returns 200 success is when I match the rollout rules with the configured ones. Whats the correct way to modify rollout rules for a feature?