curl --request POST \
--url https://statsigapi.net/console/v1/gates/{id}/rule \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"targetValue": [
"<string>"
],
"operator": "<string>",
"field": "<string>",
"customID": "<string>",
"type": "app_version"
}
],
"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}/rule \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"targetValue": [
"<string>"
],
"operator": "<string>",
"field": "<string>",
"customID": "<string>",
"type": "app_version"
}
],
"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
Add Gate Rule Response
The response is of type object
.