curl --request POST \
--url https://statsigapi.net/console/v1/gates/{id}/rules \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"rules": [
{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"type": "app_version",
"targetValue": [
"<string>"
],
"operator": "<string>",
"field": "<string>",
"customID": "<string>"
}
],
"environments": [
"<string>"
],
"id": "<string>",
"baseID": "<string>",
"returnValue": {}
}
]
}
'{
"message": "Gate rules added successfully.",
"data": {
"id": "gate1",
"name": "gate1",
"description": "",
"idType": "userID",
"lastModifierID": "65pqqzT46Kl7lHnd2JCmgH",
"lastModifiedTime": 1721435847251,
"lastModifierName": "CONSOLE API",
"lastModifierEmail": null,
"creatorID": "3exemrfZ5pwOk6qyDH0dhP",
"createdTime": 1721242681598,
"creatorName": "Jathu Theivikaran",
"creatorEmail": "jathurshan@statsig.com",
"targetApps": [],
"holdoutIDs": [],
"tags": [],
"team": null,
"isEnabled": true,
"status": "In Progress",
"rules": [
{
"id": "LcDWo6mFrWaS3DtoKtEAfg1",
"baseID": "LcDWo6mFrWaS3DtoKtEAfg1",
"name": "NA",
"passPercentage": 90,
"conditions": [
{
"type": "country",
"targetValue": [
"CA"
],
"operator": "any"
}
],
"environments": null
},
{
"id": "1RoFk5jjnNpF2HZD5oQOeY",
"baseID": "1RoFk5jjnNpF2HZD5oQOeY",
"name": "NA2",
"passPercentage": 80,
"conditions": [
{
"type": "country",
"targetValue": [
"US"
],
"operator": "any"
}
],
"environments": null
}
],
"checksPerHour": 0,
"type": "TEMPORARY",
"typeReason": "NONE",
"reviewSettings": {
"requiredReview": false,
"allowedReviewers": []
},
"measureMetricLifts": true
}
}curl --request POST \
--url https://statsigapi.net/console/v1/gates/{id}/rules \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"rules": [
{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"type": "app_version",
"targetValue": [
"<string>"
],
"operator": "<string>",
"field": "<string>",
"customID": "<string>"
}
],
"environments": [
"<string>"
],
"id": "<string>",
"baseID": "<string>",
"returnValue": {}
}
]
}
'{
"message": "Gate rules added successfully.",
"data": {
"id": "gate1",
"name": "gate1",
"description": "",
"idType": "userID",
"lastModifierID": "65pqqzT46Kl7lHnd2JCmgH",
"lastModifiedTime": 1721435847251,
"lastModifierName": "CONSOLE API",
"lastModifierEmail": null,
"creatorID": "3exemrfZ5pwOk6qyDH0dhP",
"createdTime": 1721242681598,
"creatorName": "Jathu Theivikaran",
"creatorEmail": "jathurshan@statsig.com",
"targetApps": [],
"holdoutIDs": [],
"tags": [],
"team": null,
"isEnabled": true,
"status": "In Progress",
"rules": [
{
"id": "LcDWo6mFrWaS3DtoKtEAfg1",
"baseID": "LcDWo6mFrWaS3DtoKtEAfg1",
"name": "NA",
"passPercentage": 90,
"conditions": [
{
"type": "country",
"targetValue": [
"CA"
],
"operator": "any"
}
],
"environments": null
},
{
"id": "1RoFk5jjnNpF2HZD5oQOeY",
"baseID": "1RoFk5jjnNpF2HZD5oQOeY",
"name": "NA2",
"passPercentage": 80,
"conditions": [
{
"type": "country",
"targetValue": [
"US"
],
"operator": "any"
}
],
"environments": null
}
],
"checksPerHour": 0,
"type": "TEMPORARY",
"typeReason": "NONE",
"reviewSettings": {
"requiredReview": false,
"allowedReviewers": []
},
"measureMetricLifts": true
}
}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
Add Multiple Gate Rules 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