curl --request PATCH \
--url https://statsigapi.net/console/v1/gates/{id}/rules \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"rules": [
{
"name": "All Conditions",
"id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
"baseID": "38ttpCpzrQFTMKcqFKk02l",
"passPercentage": 10,
"conditions": [
{
"type": "user_id",
"operator": "any",
"targetValue": [
0
],
"field": "string",
"customID": "string"
}
],
"returnValue": {},
"returnValueJson5": {},
"environments": [
"string"
]
}
]
}
'{
"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 list of current Gate Rules settings. It does NOT replace, create or delete if you add more rules and remove rules in the rules object. Please get the current rules through GET and use that as the base object.
curl --request PATCH \
--url https://statsigapi.net/console/v1/gates/{id}/rules \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"rules": [
{
"name": "All Conditions",
"id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
"baseID": "38ttpCpzrQFTMKcqFKk02l",
"passPercentage": 10,
"conditions": [
{
"type": "user_id",
"operator": "any",
"targetValue": [
0
],
"field": "string",
"customID": "string"
}
],
"returnValue": {},
"returnValueJson5": {},
"environments": [
"string"
]
}
]
}
'{
"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.
id
Show child attributes
The name of this rule.
Of the users that meet the conditions of this rule, what percent should return true.
0 <= x <= 100Must be a multiple of 0.01An array of Condition objects.
Show child attributes
app_version, browser_name, browser_version, country, custom_field, email, environment_tier, fails_gate, fails_segment, ip_address, locale, os_name, os_version, passes_gate, passes_segment, public, time, unit_id, user_id, url, javascript, device_model, target_app The environments this rule is enabled for.
The Statsig ID of this rule.
The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
Update gate response
A simple string explaining the result of the operation.
A single result.
Show child attributes
ID
1000ID of the last modifier.
Time of the last modification.
Email of the last modifier.
Name of the last modifier.
Timestamp when the entity was created.
Name of the creator.
In Progress, Launched, Disabled, Archived TEMPORARY, PERMANENT, STALE, TEMPLATE NONE, STALE_PROBABLY_LAUNCHED, STALE_PROBABLY_UNLAUNCHED, STALE_PROBABLY_FORGOTTEN, STALE_NO_RULES, STALE_PROBABLY_DEAD_CHECK, STALE_EMPTY_CHECKS, STALE_ALL_TRUE, STALE_ALL_FALSE Show child attributes
The name of this rule.
Of the users that meet the conditions of this rule, what percent should return true.
0 <= x <= 100Must be a multiple of 0.01An array of Condition objects.
Show child attributes
app_version, browser_name, browser_version, country, custom_field, email, environment_tier, fails_gate, fails_segment, ip_address, locale, os_name, os_version, passes_gate, passes_segment, public, time, unit_id, user_id, url, javascript, device_model, target_app The environments this rule is enabled for.
The Statsig ID of this rule.
The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout
Optional name for the configuration.
Holdouts applied to this configuration.
Version number
Schema for owner data including ID, type, name. Note that if Entity is created by CONSOLE API, owner will be undefined.
Show child attributes
ID of the owner
"abc123"
Type of the owner (e.g., SDK_KEY or USER)
"USER"
The name of the owner. This field is optional.
"John Doe"
The email of the owner. This field is optional.
{
"ownerID": "user123",
"ownerType": "USER",
"ownerName": "John Doe",
"ownerEmail": "owner123@test.com"
}Show child attributes