Update List of Dynamic Config Rules
curl --request PATCH \
--url https://statsigapi.net/console/v1/dynamic_configs/{id}/rules \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"rules": [
{
"name": "All Conditions",
"id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
"baseID": "38ttpCpzrQFTMKcqFKk02l",
"passPercentage": 10,
"conditions": [
{
"type": "user_id",
"operator": "any",
"targetValue": [
0
],
"field": "string",
"customID": "string"
}
],
"returnValue": {},
"returnValueJson5": {},
"environments": [
"string"
]
}
]
}
'import requests
url = "https://statsigapi.net/console/v1/dynamic_configs/{id}/rules"
payload = { "rules": [
{
"name": "All Conditions",
"id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
"baseID": "38ttpCpzrQFTMKcqFKk02l",
"passPercentage": 10,
"conditions": [
{
"type": "user_id",
"operator": "any",
"targetValue": [0],
"field": "string",
"customID": "string"
}
],
"returnValue": {},
"returnValueJson5": {},
"environments": ["string"]
}
] }
headers = {
"STATSIG-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'STATSIG-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
rules: [
{
name: 'All Conditions',
id: '38ttpCpzrQFTMKcqFKk02l:10.00:1',
baseID: '38ttpCpzrQFTMKcqFKk02l',
passPercentage: 10,
conditions: [
{
type: 'user_id',
operator: 'any',
targetValue: [0],
field: 'string',
customID: 'string'
}
],
returnValue: {},
returnValueJson5: {},
environments: ['string']
}
]
})
};
fetch('https://statsigapi.net/console/v1/dynamic_configs/{id}/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://statsigapi.net/console/v1/dynamic_configs/{id}/rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'name' => 'All Conditions',
'id' => '38ttpCpzrQFTMKcqFKk02l:10.00:1',
'baseID' => '38ttpCpzrQFTMKcqFKk02l',
'passPercentage' => 10,
'conditions' => [
[
'type' => 'user_id',
'operator' => 'any',
'targetValue' => [
0
],
'field' => 'string',
'customID' => 'string'
]
],
'returnValue' => [
],
'returnValueJson5' => [
],
'environments' => [
'string'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"STATSIG-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://statsigapi.net/console/v1/dynamic_configs/{id}/rules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"name\": \"All Conditions\",\n \"id\": \"38ttpCpzrQFTMKcqFKk02l:10.00:1\",\n \"baseID\": \"38ttpCpzrQFTMKcqFKk02l\",\n \"passPercentage\": 10,\n \"conditions\": [\n {\n \"type\": \"user_id\",\n \"operator\": \"any\",\n \"targetValue\": [\n 0\n ],\n \"field\": \"string\",\n \"customID\": \"string\"\n }\n ],\n \"returnValue\": {},\n \"returnValueJson5\": {},\n \"environments\": [\n \"string\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("STATSIG-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://statsigapi.net/console/v1/dynamic_configs/{id}/rules")
.header("STATSIG-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"rules\": [\n {\n \"name\": \"All Conditions\",\n \"id\": \"38ttpCpzrQFTMKcqFKk02l:10.00:1\",\n \"baseID\": \"38ttpCpzrQFTMKcqFKk02l\",\n \"passPercentage\": 10,\n \"conditions\": [\n {\n \"type\": \"user_id\",\n \"operator\": \"any\",\n \"targetValue\": [\n 0\n ],\n \"field\": \"string\",\n \"customID\": \"string\"\n }\n ],\n \"returnValue\": {},\n \"returnValueJson5\": {},\n \"environments\": [\n \"string\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://statsigapi.net/console/v1/dynamic_configs/{id}/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["STATSIG-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"name\": \"All Conditions\",\n \"id\": \"38ttpCpzrQFTMKcqFKk02l:10.00:1\",\n \"baseID\": \"38ttpCpzrQFTMKcqFKk02l\",\n \"passPercentage\": 10,\n \"conditions\": [\n {\n \"type\": \"user_id\",\n \"operator\": \"any\",\n \"targetValue\": [\n 0\n ],\n \"field\": \"string\",\n \"customID\": \"string\"\n }\n ],\n \"returnValue\": {},\n \"returnValueJson5\": {},\n \"environments\": [\n \"string\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Dynamic Config rules updated successfully.",
"data": {
"id": "dc2",
"name": "dc2",
"description": "",
"idType": "userID",
"lastModifierID": "65pqqzT46Kl7lHnd2JCmgH",
"lastModifiedTime": 1721256932961,
"lastModifierName": "CONSOLE API",
"lastModifierEmail": null,
"creatorID": "3exemrfZ5pwOk6qyDH0dhP",
"createdTime": 1721247911588,
"creatorName": "Jathu Theivikaran",
"creatorEmail": "jathurshan@statsig.com",
"targetApps": [],
"holdoutIDs": [],
"tags": [],
"team": null,
"isEnabled": true,
"rules": [
{
"id": "2IIQAN6wbUyHJiLbrcBuvx:80.00:4",
"baseID": "2IIQAN6wbUyHJiLbrcBuvx",
"name": "Other2",
"passPercentage": 80,
"conditions": [],
"returnValue": true,
"returnValueJson5": "true",
"environments": null
},
{
"id": "H8AtJA3Vhyeyn6XbH1Xwe:71.00:1",
"baseID": "H8AtJA3Vhyeyn6XbH1Xwe",
"name": "CA",
"passPercentage": 71,
"conditions": [
{
"type": "country",
"targetValue": [
"CA"
],
"operator": "any"
}
],
"returnValue": {},
"returnValueJson5": "{}",
"environments": null
}
],
"defaultValue": {},
"defaultValueJson5": "{}"
}
}Dynamic Configs
Update List of Dynamic Config Rules
PATCH
/
console
/
v1
/
dynamic_configs
/
{id}
/
rules
Update List of Dynamic Config Rules
curl --request PATCH \
--url https://statsigapi.net/console/v1/dynamic_configs/{id}/rules \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"rules": [
{
"name": "All Conditions",
"id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
"baseID": "38ttpCpzrQFTMKcqFKk02l",
"passPercentage": 10,
"conditions": [
{
"type": "user_id",
"operator": "any",
"targetValue": [
0
],
"field": "string",
"customID": "string"
}
],
"returnValue": {},
"returnValueJson5": {},
"environments": [
"string"
]
}
]
}
'import requests
url = "https://statsigapi.net/console/v1/dynamic_configs/{id}/rules"
payload = { "rules": [
{
"name": "All Conditions",
"id": "38ttpCpzrQFTMKcqFKk02l:10.00:1",
"baseID": "38ttpCpzrQFTMKcqFKk02l",
"passPercentage": 10,
"conditions": [
{
"type": "user_id",
"operator": "any",
"targetValue": [0],
"field": "string",
"customID": "string"
}
],
"returnValue": {},
"returnValueJson5": {},
"environments": ["string"]
}
] }
headers = {
"STATSIG-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'STATSIG-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
rules: [
{
name: 'All Conditions',
id: '38ttpCpzrQFTMKcqFKk02l:10.00:1',
baseID: '38ttpCpzrQFTMKcqFKk02l',
passPercentage: 10,
conditions: [
{
type: 'user_id',
operator: 'any',
targetValue: [0],
field: 'string',
customID: 'string'
}
],
returnValue: {},
returnValueJson5: {},
environments: ['string']
}
]
})
};
fetch('https://statsigapi.net/console/v1/dynamic_configs/{id}/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://statsigapi.net/console/v1/dynamic_configs/{id}/rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'rules' => [
[
'name' => 'All Conditions',
'id' => '38ttpCpzrQFTMKcqFKk02l:10.00:1',
'baseID' => '38ttpCpzrQFTMKcqFKk02l',
'passPercentage' => 10,
'conditions' => [
[
'type' => 'user_id',
'operator' => 'any',
'targetValue' => [
0
],
'field' => 'string',
'customID' => 'string'
]
],
'returnValue' => [
],
'returnValueJson5' => [
],
'environments' => [
'string'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"STATSIG-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://statsigapi.net/console/v1/dynamic_configs/{id}/rules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"name\": \"All Conditions\",\n \"id\": \"38ttpCpzrQFTMKcqFKk02l:10.00:1\",\n \"baseID\": \"38ttpCpzrQFTMKcqFKk02l\",\n \"passPercentage\": 10,\n \"conditions\": [\n {\n \"type\": \"user_id\",\n \"operator\": \"any\",\n \"targetValue\": [\n 0\n ],\n \"field\": \"string\",\n \"customID\": \"string\"\n }\n ],\n \"returnValue\": {},\n \"returnValueJson5\": {},\n \"environments\": [\n \"string\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("STATSIG-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://statsigapi.net/console/v1/dynamic_configs/{id}/rules")
.header("STATSIG-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"rules\": [\n {\n \"name\": \"All Conditions\",\n \"id\": \"38ttpCpzrQFTMKcqFKk02l:10.00:1\",\n \"baseID\": \"38ttpCpzrQFTMKcqFKk02l\",\n \"passPercentage\": 10,\n \"conditions\": [\n {\n \"type\": \"user_id\",\n \"operator\": \"any\",\n \"targetValue\": [\n 0\n ],\n \"field\": \"string\",\n \"customID\": \"string\"\n }\n ],\n \"returnValue\": {},\n \"returnValueJson5\": {},\n \"environments\": [\n \"string\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://statsigapi.net/console/v1/dynamic_configs/{id}/rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["STATSIG-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rules\": [\n {\n \"name\": \"All Conditions\",\n \"id\": \"38ttpCpzrQFTMKcqFKk02l:10.00:1\",\n \"baseID\": \"38ttpCpzrQFTMKcqFKk02l\",\n \"passPercentage\": 10,\n \"conditions\": [\n {\n \"type\": \"user_id\",\n \"operator\": \"any\",\n \"targetValue\": [\n 0\n ],\n \"field\": \"string\",\n \"customID\": \"string\"\n }\n ],\n \"returnValue\": {},\n \"returnValueJson5\": {},\n \"environments\": [\n \"string\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Dynamic Config rules updated successfully.",
"data": {
"id": "dc2",
"name": "dc2",
"description": "",
"idType": "userID",
"lastModifierID": "65pqqzT46Kl7lHnd2JCmgH",
"lastModifiedTime": 1721256932961,
"lastModifierName": "CONSOLE API",
"lastModifierEmail": null,
"creatorID": "3exemrfZ5pwOk6qyDH0dhP",
"createdTime": 1721247911588,
"creatorName": "Jathu Theivikaran",
"creatorEmail": "jathurshan@statsig.com",
"targetApps": [],
"holdoutIDs": [],
"tags": [],
"team": null,
"isEnabled": true,
"rules": [
{
"id": "2IIQAN6wbUyHJiLbrcBuvx:80.00:4",
"baseID": "2IIQAN6wbUyHJiLbrcBuvx",
"name": "Other2",
"passPercentage": 80,
"conditions": [],
"returnValue": true,
"returnValueJson5": "true",
"environments": null
},
{
"id": "H8AtJA3Vhyeyn6XbH1Xwe:71.00:1",
"baseID": "H8AtJA3Vhyeyn6XbH1Xwe",
"name": "CA",
"passPercentage": 71,
"conditions": [
{
"type": "country",
"targetValue": [
"CA"
],
"operator": "any"
}
],
"returnValue": {},
"returnValueJson5": "{}",
"environments": null
}
],
"defaultValue": {},
"defaultValueJson5": "{}"
}
}Authorizations
Headers
Optional header to respect review settings for mutation endpoints.
Path Parameters
id
Body
application/json
Show child attributes
Show child attributes
⌘I

