Skip to main content
PATCH
/
console
/
v1
/
dynamic_configs
/
{id}
/
rule
/
{ruleId}
Update Dynamic Config Rule By Id
curl --request PATCH \
  --url https://statsigapi.net/console/v1/dynamic_configs/{id}/rule/{ruleId} \
  --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": {},
  "completedAutomatedRollouts": [
    {
      "time": 123,
      "passPercent": 123
    }
  ],
  "pendingAutomatedRollouts": [
    {
      "time": 123,
      "passPercent": 123
    }
  ],
  "returnValueJson5": "<string>",
  "variants": [
    {
      "id": "<string>",
      "name": "<string>",
      "passPercentage": 50,
      "returnValue": {},
      "returnValueJson5": "<string>"
    }
  ]
}'
{
  "message": "Dynamic Config rules updated successfully.",
  "data": {
    "id": "a_dynamic_config",
    "description": "helpful summary of what this dynamic config does",
    "idType": "userID",
    "creatorEmail": "johnsmith@mydomain.com",
    "creatorName": "John Smith",
    "createdTime": 1674769467002,
    "lastModifierID": "1vaQaBoLlkauH9iiuOSBP2",
    "lastModifierName": "CONSOLE API",
    "lastModifiedTime": 1707344887865,
    "lastModifierEmail": null,
    "holdoutIDs": [],
    "isEnabled": true,
    "rules": [
      {
        "name": "All Conditions",
        "id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
        "baseID": "38ttpCpzrQFTMKcqFKk02l",
        "passPercentage": 10,
        "conditions": [
          {
            "type": "public",
            "operator": "string",
            "targetValue": 0,
            "field": "string",
            "customID": "string"
          }
        ],
        "returnValue": {
          "key": true
        },
        "completedAutomatedRollouts": [],
        "pendingAutomatedRollouts": []
      }
    ],
    "defaultValue": {
      "key": "the default value"
    },
    "tags": [
      "a tag"
    ]
  }
}

Authorizations

STATSIG-API-KEY
string
header
required

Headers

x-respect-review-settings
string

Optional header to respect review settings for mutation endpoints.

Path Parameters

id
string
required

Dynamic Config ID

ruleId
string
required

Rule ID

Body

application/json
name
string

The name of this rule.

passPercentage
number

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

Required range: 0 <= x <= 100Must be a multiple of 0.01
conditions
object[]

An array of Condition objects.

environments
string[] | null
id
string

The Statsig ID of this rule.

baseID
string

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

returnValue
object
completedAutomatedRollouts
object[]
pendingAutomatedRollouts
object[]
returnValueJson5
string
variants
object[]

Response

200 - application/json

Update Dynamic Config Rule Response

message
string
required

A simple string explaining the result of the operation.

data
object
required

A single result.

I