Create Gate
Changed onRequest
- Base URLhttps://statsigapi.net
- URLhttps://statsigapi.net/console/v1/gates
- AuthAPI key in header STATSIG-API-KEY
Query parameters
When "true", populate archivedAt / archivedBy* / archiveReason on the gate when it is currently archived. When omitted or "false", those fields are absent from the response.
Request body
Example request
{
"name": "a_verbose_gate",
"idType": "userID",
"isEnabled": false,
"description": "helpful summary of what this gate does",
"lastModifierName": "CONSOLE API",
"lastModifierID": "5rfuqoxLIYTscuSaaCOlB8",
"targetApps": [
"my_app"
],
"team": "team",
"rules": [
{
"name": "All Conditions",
"passPercentage": 10,
"conditions": [
{
"type": "public"
},
{
"type": "user_id",
"targetValue": [
"111",
"222"
],
"operator": "any"
},
{
"type": "email",
"targetValue": [
"@outlook.com",
"@gmail.com"
],
"operator": "str_contains_any"
},
{
"type": "custom_field",
"targetValue": 31,
"operator": "gt",
"field": "age"
},
{
"type": "app_version",
"targetValue": "1.1.1",
"operator": "version_gt"
},
{
"type": "browser_name",
"targetValue": [
"Android",
"Chrome"
],
"operator": "any"
},
{
"type": "browser_version",
"targetValue": [
"94.0.4606.81",
"94.0.4606.92"
],
"operator": "any"
},
{
"type": "os_name",
"targetValue": [
"Android",
"Windows"
],
"operator": "none"
},
{
"type": "os_version",
"targetValue": "11.0.0",
"operator": "version_lte"
},
{
"type": "country",
"targetValue": [
"NZ",
"US"
],
"operator": "any"
},
{
"type": "passes_gate",
"targetValue": "my_gate_2"
},
{
"type": "fails_gate",
"targetValue": "my_gate_2"
},
{
"type": "time",
"targetValue": 1643070357193,
"operator": "after"
},
{
"type": "environment_tier",
"targetValue": [
"production"
],
"operator": "any"
},
{
"type": "passes_segment",
"targetValue": "growth_org"
},
{
"type": "fails_segment",
"targetValue": "growth_org"
},
{
"type": "ip_address",
"targetValue": [
"1.1.1.1",
"8.8.8.8"
],
"operator": "any"
}
],
"environment": null
}
],
"checksPerHour": 0,
"tags": [],
"monitoringMetrics": [
{
"name": "dau",
"type": "user"
}
]
}Response
Create gate response
Example response
{
"message": "Gate created successfully.",
"data": {
"id": "a_gate",
"permalink": "https://console.statsig.com/company_id/gates/a_gate",
"name": "A Gate",
"description": "description",
"idType": "userID",
"lastModifierID": "1vaQaBoLlkauH9iiuOSBP2",
"lastModifiedTime": 1704929983827,
"lastModifierName": "CONSOLE API",
"lastModifierEmail": null,
"creatorID": "1vaQaBoLlkauH9iiuOSBP2",
"createdTime": 1704929979761,
"creatorName": "CONSOLE API",
"creatorEmail": null,
"targetApps": [],
"holdoutIDs": [],
"tags": [],
"isEnabled": true,
"status": "In Progress",
"rules": [],
"checksPerHour": 0,
"type": "PERMANENT",
"typeReason": "NONE",
"team": null,
"reviewSettings": {
"requiredReview": false,
"allowedReviewers": []
},
"measureMetricLifts": true,
"owner": {
"ownerID": "user123",
"ownerName": "CONSOLE API",
"ownerType": "SDK_KEY",
"ownerEmail": ""
},
"monitoringMetrics": [],
"version": 1
}
}Changes
- info
added the new optional request property
//// - info
added the new optional request property
//// - info
added the new optional request property
// - info
the request optional property
//became not read-only - info
added the optional property
//////to the response with the status - info
added the optional property
//////to the response with the status - info
added the optional property
////to the response with the status - info
the response optional property
////became not read-only for the status
- info
- breaking
request property
////was restricted to a list of enum values - warning
added the new
afterenum value to the//////response property for the response status - warning
added the new
anyenum value to the//////response property for the response status - warning
added the new
any_case_sensitiveenum value to the//////response property for the response status - warning
added the new
array_contains_allenum value to the//////response property for the response status - warning
added the new
array_contains_anyenum value to the//////response property for the response status - warning
added the new
array_contains_noneenum value to the//////response property for the response status - warning
added the new
beforeenum value to the//////response property for the response status - warning
added the new
encoded_anyenum value to the//////response property for the response status - warning
added the new
gtenum value to the//////response property for the response status - warning
added the new
gteenum value to the//////response property for the response status - warning
added the new
is_not_nullenum value to the//////response property for the response status - warning
added the new
is_nullenum value to the//////response property for the response status - warning
added the new
ltenum value to the//////response property for the response status - warning
added the new
lteenum value to the//////response property for the response status - warning
added the new
noneenum value to the//////response property for the response status - warning
added the new
none_case_sensitiveenum value to the//////response property for the response status - warning
added the new
not_array_contains_allenum value to the//////response property for the response status - warning
added the new
onenum value to the//////response property for the response status - warning
added the new
str_contains_anyenum value to the//////response property for the response status - warning
added the new
str_contains_noneenum value to the//////response property for the response status - warning
added the new
str_matchesenum value to the//////response property for the response status - warning
added the new
version_eqenum value to the//////response property for the response status - warning
added the new
version_gtenum value to the//////response property for the response status - warning
added the new
version_gteenum value to the//////response property for the response status - warning
added the new
version_ltenum value to the//////response property for the response status - warning
added the new
version_lteenum value to the//////response property for the response status - info
added the new
afterenum value to the request property//// - info
added the new
anyenum value to the request property//// - info
added the new
any_case_sensitiveenum value to the request property//// - info
added the new
array_contains_allenum value to the request property//// - info
added the new
array_contains_anyenum value to the request property//// - info
added the new
array_contains_noneenum value to the request property//// - info
added the new
beforeenum value to the request property//// - info
added the new
encoded_anyenum value to the request property//// - info
added the new
gtenum value to the request property//// - info
added the new
gteenum value to the request property//// - info
added the new
is_not_nullenum value to the request property//// - info
added the new
is_nullenum value to the request property//// - info
added the new
ltenum value to the request property//// - info
added the new
lteenum value to the request property//// - info
added the new
noneenum value to the request property//// - info
added the new
none_case_sensitiveenum value to the request property//// - info
added the new
not_array_contains_allenum value to the request property//// - info
added the new
onenum value to the request property//// - info
added the new
str_contains_anyenum value to the request property//// - info
added the new
str_contains_noneenum value to the request property//// - info
added the new
str_matchesenum value to the request property//// - info
added the new
version_eqenum value to the request property//// - info
added the new
version_gtenum value to the request property//// - info
added the new
version_gteenum value to the request property//// - info
added the new
version_ltenum value to the request property//// - info
added the new
version_lteenum value to the request property////
- breaking