Fully Update Dynamic Config
curl --request POST \
--url https://statsigapi.net/console/v1/dynamic_configs/{id} \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"isEnabled": true,
"description": "helpful summary of what this dynamic config does",
"rules": [
{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"targetValue": [
"<string>"
],
"operator": "<string>",
"field": "<string>",
"customID": "<string>"
}
],
"environments": [
"<string>"
],
"id": "<string>",
"baseID": "<string>",
"returnValue": {},
"returnValueJson5": "<string>"
}
],
"defaultValue": {},
"defaultValueJson5": "<string>",
"idType": "userID",
"tags": [
"a tag"
],
"creatorID": "<string>",
"owner": {
"ownerID": "user123",
"ownerType": "USER",
"ownerName": "John Doe",
"ownerEmail": "owner123@test.com"
},
"creatorEmail": "<string>",
"schema": "<string>",
"schemaJson5": "<string>",
"targetApps": "<string>",
"team": "<string>",
"teamID": "<string>",
"precommitWebhook": {
"url": "<string>",
"internalStatusUrl": "<string>"
}
}
'import requests
url = "https://statsigapi.net/console/v1/dynamic_configs/{id}"
payload = {
"isEnabled": True,
"description": "helpful summary of what this dynamic config does",
"rules": [
{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"targetValue": ["<string>"],
"operator": "<string>",
"field": "<string>",
"customID": "<string>"
}
],
"environments": ["<string>"],
"id": "<string>",
"baseID": "<string>",
"returnValue": {},
"returnValueJson5": "<string>"
}
],
"defaultValue": {},
"defaultValueJson5": "<string>",
"idType": "userID",
"tags": ["a tag"],
"creatorID": "<string>",
"owner": {
"ownerID": "user123",
"ownerType": "USER",
"ownerName": "John Doe",
"ownerEmail": "owner123@test.com"
},
"creatorEmail": "<string>",
"schema": "<string>",
"schemaJson5": "<string>",
"targetApps": "<string>",
"team": "<string>",
"teamID": "<string>",
"precommitWebhook": {
"url": "<string>",
"internalStatusUrl": "<string>"
}
}
headers = {
"STATSIG-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'STATSIG-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
isEnabled: true,
description: 'helpful summary of what this dynamic config does',
rules: [
{
name: '<string>',
passPercentage: 50,
conditions: [
{
targetValue: ['<string>'],
operator: '<string>',
field: '<string>',
customID: '<string>'
}
],
environments: ['<string>'],
id: '<string>',
baseID: '<string>',
returnValue: {},
returnValueJson5: '<string>'
}
],
defaultValue: {},
defaultValueJson5: '<string>',
idType: 'userID',
tags: ['a tag'],
creatorID: '<string>',
owner: {
ownerID: 'user123',
ownerType: 'USER',
ownerName: 'John Doe',
ownerEmail: 'owner123@test.com'
},
creatorEmail: '<string>',
schema: '<string>',
schemaJson5: '<string>',
targetApps: '<string>',
team: '<string>',
teamID: '<string>',
precommitWebhook: {url: '<string>', internalStatusUrl: '<string>'}
})
};
fetch('https://statsigapi.net/console/v1/dynamic_configs/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'isEnabled' => true,
'description' => 'helpful summary of what this dynamic config does',
'rules' => [
[
'name' => '<string>',
'passPercentage' => 50,
'conditions' => [
[
'targetValue' => [
'<string>'
],
'operator' => '<string>',
'field' => '<string>',
'customID' => '<string>'
]
],
'environments' => [
'<string>'
],
'id' => '<string>',
'baseID' => '<string>',
'returnValue' => [
],
'returnValueJson5' => '<string>'
]
],
'defaultValue' => [
],
'defaultValueJson5' => '<string>',
'idType' => 'userID',
'tags' => [
'a tag'
],
'creatorID' => '<string>',
'owner' => [
'ownerID' => 'user123',
'ownerType' => 'USER',
'ownerName' => 'John Doe',
'ownerEmail' => 'owner123@test.com'
],
'creatorEmail' => '<string>',
'schema' => '<string>',
'schemaJson5' => '<string>',
'targetApps' => '<string>',
'team' => '<string>',
'teamID' => '<string>',
'precommitWebhook' => [
'url' => '<string>',
'internalStatusUrl' => '<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}"
payload := strings.NewReader("{\n \"isEnabled\": true,\n \"description\": \"helpful summary of what this dynamic config does\",\n \"rules\": [\n {\n \"name\": \"<string>\",\n \"passPercentage\": 50,\n \"conditions\": [\n {\n \"targetValue\": [\n \"<string>\"\n ],\n \"operator\": \"<string>\",\n \"field\": \"<string>\",\n \"customID\": \"<string>\"\n }\n ],\n \"environments\": [\n \"<string>\"\n ],\n \"id\": \"<string>\",\n \"baseID\": \"<string>\",\n \"returnValue\": {},\n \"returnValueJson5\": \"<string>\"\n }\n ],\n \"defaultValue\": {},\n \"defaultValueJson5\": \"<string>\",\n \"idType\": \"userID\",\n \"tags\": [\n \"a tag\"\n ],\n \"creatorID\": \"<string>\",\n \"owner\": {\n \"ownerID\": \"user123\",\n \"ownerType\": \"USER\",\n \"ownerName\": \"John Doe\",\n \"ownerEmail\": \"owner123@test.com\"\n },\n \"creatorEmail\": \"<string>\",\n \"schema\": \"<string>\",\n \"schemaJson5\": \"<string>\",\n \"targetApps\": \"<string>\",\n \"team\": \"<string>\",\n \"teamID\": \"<string>\",\n \"precommitWebhook\": {\n \"url\": \"<string>\",\n \"internalStatusUrl\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://statsigapi.net/console/v1/dynamic_configs/{id}")
.header("STATSIG-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"isEnabled\": true,\n \"description\": \"helpful summary of what this dynamic config does\",\n \"rules\": [\n {\n \"name\": \"<string>\",\n \"passPercentage\": 50,\n \"conditions\": [\n {\n \"targetValue\": [\n \"<string>\"\n ],\n \"operator\": \"<string>\",\n \"field\": \"<string>\",\n \"customID\": \"<string>\"\n }\n ],\n \"environments\": [\n \"<string>\"\n ],\n \"id\": \"<string>\",\n \"baseID\": \"<string>\",\n \"returnValue\": {},\n \"returnValueJson5\": \"<string>\"\n }\n ],\n \"defaultValue\": {},\n \"defaultValueJson5\": \"<string>\",\n \"idType\": \"userID\",\n \"tags\": [\n \"a tag\"\n ],\n \"creatorID\": \"<string>\",\n \"owner\": {\n \"ownerID\": \"user123\",\n \"ownerType\": \"USER\",\n \"ownerName\": \"John Doe\",\n \"ownerEmail\": \"owner123@test.com\"\n },\n \"creatorEmail\": \"<string>\",\n \"schema\": \"<string>\",\n \"schemaJson5\": \"<string>\",\n \"targetApps\": \"<string>\",\n \"team\": \"<string>\",\n \"teamID\": \"<string>\",\n \"precommitWebhook\": {\n \"url\": \"<string>\",\n \"internalStatusUrl\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://statsigapi.net/console/v1/dynamic_configs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["STATSIG-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isEnabled\": true,\n \"description\": \"helpful summary of what this dynamic config does\",\n \"rules\": [\n {\n \"name\": \"<string>\",\n \"passPercentage\": 50,\n \"conditions\": [\n {\n \"targetValue\": [\n \"<string>\"\n ],\n \"operator\": \"<string>\",\n \"field\": \"<string>\",\n \"customID\": \"<string>\"\n }\n ],\n \"environments\": [\n \"<string>\"\n ],\n \"id\": \"<string>\",\n \"baseID\": \"<string>\",\n \"returnValue\": {},\n \"returnValueJson5\": \"<string>\"\n }\n ],\n \"defaultValue\": {},\n \"defaultValueJson5\": \"<string>\",\n \"idType\": \"userID\",\n \"tags\": [\n \"a tag\"\n ],\n \"creatorID\": \"<string>\",\n \"owner\": {\n \"ownerID\": \"user123\",\n \"ownerType\": \"USER\",\n \"ownerName\": \"John Doe\",\n \"ownerEmail\": \"owner123@test.com\"\n },\n \"creatorEmail\": \"<string>\",\n \"schema\": \"<string>\",\n \"schemaJson5\": \"<string>\",\n \"targetApps\": \"<string>\",\n \"team\": \"<string>\",\n \"teamID\": \"<string>\",\n \"precommitWebhook\": {\n \"url\": \"<string>\",\n \"internalStatusUrl\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Dynamic config updated successfully.",
"data": {
"id": "a_dynamic_config",
"description": "helpful summary of what this dynamic config does",
"idType": "userID",
"lastModifierID": "1vaQaBoLlkauH9iiuOSBP2",
"lastModifierName": "CONSOLE API",
"creatorEmail": "johnsmith@mydomain.com",
"creatorName": "John Smith",
"createdTime": 1674769467002,
"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
}
}
],
"defaultValue": {
"key": "the default value"
},
"tags": [
"a tag"
]
}
}{
"status": 400,
"message": "Invalid request. Please check the request input and try again."
}{
"status": 401,
"message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}{
"status": 403,
"message": "Forbidden. The request was valid, but the server is refusing action. You might not have the necessary permissions to access the resource."
}Dynamic Configs
Fully Update Dynamic Config
POST
/
console
/
v1
/
dynamic_configs
/
{id}
Fully Update Dynamic Config
curl --request POST \
--url https://statsigapi.net/console/v1/dynamic_configs/{id} \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"isEnabled": true,
"description": "helpful summary of what this dynamic config does",
"rules": [
{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"targetValue": [
"<string>"
],
"operator": "<string>",
"field": "<string>",
"customID": "<string>"
}
],
"environments": [
"<string>"
],
"id": "<string>",
"baseID": "<string>",
"returnValue": {},
"returnValueJson5": "<string>"
}
],
"defaultValue": {},
"defaultValueJson5": "<string>",
"idType": "userID",
"tags": [
"a tag"
],
"creatorID": "<string>",
"owner": {
"ownerID": "user123",
"ownerType": "USER",
"ownerName": "John Doe",
"ownerEmail": "owner123@test.com"
},
"creatorEmail": "<string>",
"schema": "<string>",
"schemaJson5": "<string>",
"targetApps": "<string>",
"team": "<string>",
"teamID": "<string>",
"precommitWebhook": {
"url": "<string>",
"internalStatusUrl": "<string>"
}
}
'import requests
url = "https://statsigapi.net/console/v1/dynamic_configs/{id}"
payload = {
"isEnabled": True,
"description": "helpful summary of what this dynamic config does",
"rules": [
{
"name": "<string>",
"passPercentage": 50,
"conditions": [
{
"targetValue": ["<string>"],
"operator": "<string>",
"field": "<string>",
"customID": "<string>"
}
],
"environments": ["<string>"],
"id": "<string>",
"baseID": "<string>",
"returnValue": {},
"returnValueJson5": "<string>"
}
],
"defaultValue": {},
"defaultValueJson5": "<string>",
"idType": "userID",
"tags": ["a tag"],
"creatorID": "<string>",
"owner": {
"ownerID": "user123",
"ownerType": "USER",
"ownerName": "John Doe",
"ownerEmail": "owner123@test.com"
},
"creatorEmail": "<string>",
"schema": "<string>",
"schemaJson5": "<string>",
"targetApps": "<string>",
"team": "<string>",
"teamID": "<string>",
"precommitWebhook": {
"url": "<string>",
"internalStatusUrl": "<string>"
}
}
headers = {
"STATSIG-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'STATSIG-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
isEnabled: true,
description: 'helpful summary of what this dynamic config does',
rules: [
{
name: '<string>',
passPercentage: 50,
conditions: [
{
targetValue: ['<string>'],
operator: '<string>',
field: '<string>',
customID: '<string>'
}
],
environments: ['<string>'],
id: '<string>',
baseID: '<string>',
returnValue: {},
returnValueJson5: '<string>'
}
],
defaultValue: {},
defaultValueJson5: '<string>',
idType: 'userID',
tags: ['a tag'],
creatorID: '<string>',
owner: {
ownerID: 'user123',
ownerType: 'USER',
ownerName: 'John Doe',
ownerEmail: 'owner123@test.com'
},
creatorEmail: '<string>',
schema: '<string>',
schemaJson5: '<string>',
targetApps: '<string>',
team: '<string>',
teamID: '<string>',
precommitWebhook: {url: '<string>', internalStatusUrl: '<string>'}
})
};
fetch('https://statsigapi.net/console/v1/dynamic_configs/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'isEnabled' => true,
'description' => 'helpful summary of what this dynamic config does',
'rules' => [
[
'name' => '<string>',
'passPercentage' => 50,
'conditions' => [
[
'targetValue' => [
'<string>'
],
'operator' => '<string>',
'field' => '<string>',
'customID' => '<string>'
]
],
'environments' => [
'<string>'
],
'id' => '<string>',
'baseID' => '<string>',
'returnValue' => [
],
'returnValueJson5' => '<string>'
]
],
'defaultValue' => [
],
'defaultValueJson5' => '<string>',
'idType' => 'userID',
'tags' => [
'a tag'
],
'creatorID' => '<string>',
'owner' => [
'ownerID' => 'user123',
'ownerType' => 'USER',
'ownerName' => 'John Doe',
'ownerEmail' => 'owner123@test.com'
],
'creatorEmail' => '<string>',
'schema' => '<string>',
'schemaJson5' => '<string>',
'targetApps' => '<string>',
'team' => '<string>',
'teamID' => '<string>',
'precommitWebhook' => [
'url' => '<string>',
'internalStatusUrl' => '<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}"
payload := strings.NewReader("{\n \"isEnabled\": true,\n \"description\": \"helpful summary of what this dynamic config does\",\n \"rules\": [\n {\n \"name\": \"<string>\",\n \"passPercentage\": 50,\n \"conditions\": [\n {\n \"targetValue\": [\n \"<string>\"\n ],\n \"operator\": \"<string>\",\n \"field\": \"<string>\",\n \"customID\": \"<string>\"\n }\n ],\n \"environments\": [\n \"<string>\"\n ],\n \"id\": \"<string>\",\n \"baseID\": \"<string>\",\n \"returnValue\": {},\n \"returnValueJson5\": \"<string>\"\n }\n ],\n \"defaultValue\": {},\n \"defaultValueJson5\": \"<string>\",\n \"idType\": \"userID\",\n \"tags\": [\n \"a tag\"\n ],\n \"creatorID\": \"<string>\",\n \"owner\": {\n \"ownerID\": \"user123\",\n \"ownerType\": \"USER\",\n \"ownerName\": \"John Doe\",\n \"ownerEmail\": \"owner123@test.com\"\n },\n \"creatorEmail\": \"<string>\",\n \"schema\": \"<string>\",\n \"schemaJson5\": \"<string>\",\n \"targetApps\": \"<string>\",\n \"team\": \"<string>\",\n \"teamID\": \"<string>\",\n \"precommitWebhook\": {\n \"url\": \"<string>\",\n \"internalStatusUrl\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://statsigapi.net/console/v1/dynamic_configs/{id}")
.header("STATSIG-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"isEnabled\": true,\n \"description\": \"helpful summary of what this dynamic config does\",\n \"rules\": [\n {\n \"name\": \"<string>\",\n \"passPercentage\": 50,\n \"conditions\": [\n {\n \"targetValue\": [\n \"<string>\"\n ],\n \"operator\": \"<string>\",\n \"field\": \"<string>\",\n \"customID\": \"<string>\"\n }\n ],\n \"environments\": [\n \"<string>\"\n ],\n \"id\": \"<string>\",\n \"baseID\": \"<string>\",\n \"returnValue\": {},\n \"returnValueJson5\": \"<string>\"\n }\n ],\n \"defaultValue\": {},\n \"defaultValueJson5\": \"<string>\",\n \"idType\": \"userID\",\n \"tags\": [\n \"a tag\"\n ],\n \"creatorID\": \"<string>\",\n \"owner\": {\n \"ownerID\": \"user123\",\n \"ownerType\": \"USER\",\n \"ownerName\": \"John Doe\",\n \"ownerEmail\": \"owner123@test.com\"\n },\n \"creatorEmail\": \"<string>\",\n \"schema\": \"<string>\",\n \"schemaJson5\": \"<string>\",\n \"targetApps\": \"<string>\",\n \"team\": \"<string>\",\n \"teamID\": \"<string>\",\n \"precommitWebhook\": {\n \"url\": \"<string>\",\n \"internalStatusUrl\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://statsigapi.net/console/v1/dynamic_configs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["STATSIG-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"isEnabled\": true,\n \"description\": \"helpful summary of what this dynamic config does\",\n \"rules\": [\n {\n \"name\": \"<string>\",\n \"passPercentage\": 50,\n \"conditions\": [\n {\n \"targetValue\": [\n \"<string>\"\n ],\n \"operator\": \"<string>\",\n \"field\": \"<string>\",\n \"customID\": \"<string>\"\n }\n ],\n \"environments\": [\n \"<string>\"\n ],\n \"id\": \"<string>\",\n \"baseID\": \"<string>\",\n \"returnValue\": {},\n \"returnValueJson5\": \"<string>\"\n }\n ],\n \"defaultValue\": {},\n \"defaultValueJson5\": \"<string>\",\n \"idType\": \"userID\",\n \"tags\": [\n \"a tag\"\n ],\n \"creatorID\": \"<string>\",\n \"owner\": {\n \"ownerID\": \"user123\",\n \"ownerType\": \"USER\",\n \"ownerName\": \"John Doe\",\n \"ownerEmail\": \"owner123@test.com\"\n },\n \"creatorEmail\": \"<string>\",\n \"schema\": \"<string>\",\n \"schemaJson5\": \"<string>\",\n \"targetApps\": \"<string>\",\n \"team\": \"<string>\",\n \"teamID\": \"<string>\",\n \"precommitWebhook\": {\n \"url\": \"<string>\",\n \"internalStatusUrl\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Dynamic config updated successfully.",
"data": {
"id": "a_dynamic_config",
"description": "helpful summary of what this dynamic config does",
"idType": "userID",
"lastModifierID": "1vaQaBoLlkauH9iiuOSBP2",
"lastModifierName": "CONSOLE API",
"creatorEmail": "johnsmith@mydomain.com",
"creatorName": "John Smith",
"createdTime": 1674769467002,
"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
}
}
],
"defaultValue": {
"key": "the default value"
},
"tags": [
"a tag"
]
}
}{
"status": 400,
"message": "Invalid request. Please check the request input and try again."
}{
"status": 401,
"message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}{
"status": 403,
"message": "Forbidden. The request was valid, but the server is refusing action. You might not have the necessary permissions to access the resource."
}Headers
Body
application/json

