curl --request PATCH \
--url https://statsigapi.net/console/v1/gates/{id}/rules/{ruleID} \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '{
"name": "All Conditions",
"id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
"baseID": "38ttpCpzrQFTMKcqFKk02l",
"passPercentage": 10,
"conditions": [
{
"type": "user_id",
"targetValue": [
"35sClJFs8l0y5uRQhDwUDo"
],
"operator": "any"
}
],
"environments": [
"staging"
]
}'
{
"message": "Gate updated successfully.",
"data": {
"id": "a_gate",
"isEnabled": true,
"description": "helpful summary of what this gate does",
"status": "In Progress",
"lastModifierName": "CONSOLE API",
"lastModifierID": "1vaasdfLlkaujjajiuOSBP2",
"rules": [
{
"name": "All Conditions",
"id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
"baseID": "38ttpCpzrQFTMKcqFKk02l",
"passPercentage": 10,
"conditions": [
{
"type": "user_id",
"targetValue": [
"35sClJFs8l0y5uRQhDwUDo"
],
"operator": "any"
}
],
"environments": [
"staging"
]
}
],
"tags": [
"* Core"
]
}
}
Update all given rules. It does NOT create or delete if you add more rules and remove rules in the rules object.
curl --request PATCH \
--url https://statsigapi.net/console/v1/gates/{id}/rules/{ruleID} \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '{
"name": "All Conditions",
"id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
"baseID": "38ttpCpzrQFTMKcqFKk02l",
"passPercentage": 10,
"conditions": [
{
"type": "user_id",
"targetValue": [
"35sClJFs8l0y5uRQhDwUDo"
],
"operator": "any"
}
],
"environments": [
"staging"
]
}'
{
"message": "Gate updated successfully.",
"data": {
"id": "a_gate",
"isEnabled": true,
"description": "helpful summary of what this gate does",
"status": "In Progress",
"lastModifierName": "CONSOLE API",
"lastModifierID": "1vaasdfLlkaujjajiuOSBP2",
"rules": [
{
"name": "All Conditions",
"id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
"baseID": "38ttpCpzrQFTMKcqFKk02l",
"passPercentage": 10,
"conditions": [
{
"type": "user_id",
"targetValue": [
"35sClJFs8l0y5uRQhDwUDo"
],
"operator": "any"
}
],
"environments": [
"staging"
]
}
],
"tags": [
"* Core"
]
}
}
Optional header to respect review settings for mutation endpoints.
Update gate response
The response is of type object
.