v2

latestOpenAPI 3.0.02026-08-073221853.1 MB
Gates

Update Gate Rules

Update all given rules. It does NOT create or delete if you add more rules and remove rules in the rules object.

patch/console/v1/gates/{id}/rules/{ruleID}

Path parameters

idstring required

Gate ID

ruleIDstring required

Rule 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

The name of this rule.

passPercentagenumber double

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.

Example request

{
  "name": "All Conditions",
  "id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
  "baseID": "38ttpCpzrQFTMKcqFKk02l",
  "passPercentage": 10,
  "conditions": [
    {
      "type": "user_id",
      "targetValue": [
        "35sClJFs8l0y5uRQhDwUDo"
      ],
      "operator": "any"
    }
  ],
  "environments": [
    "staging"
  ]
}

Response

Update gate response

messagestring required

A simple string explaining the result of the operation.

Example response

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