Gates
post/console/v1/gates/{id}/rule

Request

  • Base URL
    https://statsigapi.net
  • URL
    https://statsigapi.net/console/v1/gates/{id}/rule
  • Auth
    API key in header STATSIG-API-KEY

Path parameters

idstring required

id

Query parameters

includeArchiveMetadata'true' | 'false'

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

namestring required

The name of this rule.

passPercentagenumber double required

Of the users that meet the conditions of this rule, what percent should return true.

environmentsstring[] nullable

The environments this rule is enabled for.

idstring

The Statsig ID of this rule.

baseIDstring

The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout

returnValueobject

The return value of the rule.

Response

Add Gate Rule Response

messagestring required

A simple string explaining the result of the operation.

Example response

{
  "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
  }
}

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

    • breaking

      request property // was restricted to a list of enum values

    • warning

      added the new after enum value to the ////// response property for the response status

    • warning

      added the new any enum value to the ////// response property for the response status

    • warning

      added the new any_case_sensitive enum value to the ////// response property for the response status

    • warning

      added the new array_contains_all enum value to the ////// response property for the response status

    • warning

      added the new array_contains_any enum value to the ////// response property for the response status

    • warning

      added the new array_contains_none enum value to the ////// response property for the response status

    • warning

      added the new before enum value to the ////// response property for the response status

    • warning

      added the new encoded_any enum value to the ////// response property for the response status

    • warning

      added the new gt enum value to the ////// response property for the response status

    • warning

      added the new gte enum value to the ////// response property for the response status

    • warning

      added the new is_not_null enum value to the ////// response property for the response status

    • warning

      added the new is_null enum value to the ////// response property for the response status

    • warning

      added the new lt enum value to the ////// response property for the response status

    • warning

      added the new lte enum value to the ////// response property for the response status

    • warning

      added the new none enum value to the ////// response property for the response status

    • warning

      added the new none_case_sensitive enum value to the ////// response property for the response status

    • warning

      added the new not_array_contains_all enum value to the ////// response property for the response status

    • warning

      added the new on enum value to the ////// response property for the response status

    • warning

      added the new str_contains_any enum value to the ////// response property for the response status

    • warning

      added the new str_contains_none enum value to the ////// response property for the response status

    • warning

      added the new str_matches enum value to the ////// response property for the response status

    • warning

      added the new version_eq enum value to the ////// response property for the response status

    • warning

      added the new version_gt enum value to the ////// response property for the response status

    • warning

      added the new version_gte enum value to the ////// response property for the response status

    • warning

      added the new version_lt enum value to the ////// response property for the response status

    • warning

      added the new version_lte enum value to the ////// response property for the response status

    • info

      added the new after enum value to the request property //

    • info

      added the new any enum value to the request property //

    • info

      added the new any_case_sensitive enum value to the request property //

    • info

      added the new array_contains_all enum value to the request property //

    • info

      added the new array_contains_any enum value to the request property //

    • info

      added the new array_contains_none enum value to the request property //

    • info

      added the new before enum value to the request property //

    • info

      added the new encoded_any enum value to the request property //

    • info

      added the new gt enum value to the request property //

    • info

      added the new gte enum value to the request property //

    • info

      added the new is_not_null enum value to the request property //

    • info

      added the new is_null enum value to the request property //

    • info

      added the new lt enum value to the request property //

    • info

      added the new lte enum value to the request property //

    • info

      added the new none enum value to the request property //

    • info

      added the new none_case_sensitive enum value to the request property //

    • info

      added the new not_array_contains_all enum value to the request property //

    • info

      added the new on enum value to the request property //

    • info

      added the new str_contains_any enum value to the request property //

    • info

      added the new str_contains_none enum value to the request property //

    • info

      added the new str_matches enum value to the request property //

    • info

      added the new version_eq enum value to the request property //

    • info

      added the new version_gt enum value to the request property //

    • info

      added the new version_gte enum value to the request property //

    • info

      added the new version_lt enum value to the request property //

    • info

      added the new version_lte enum value to the request property //