Patch holdout by id. You can pass in only the data you want to update.
curl --request PATCH \
--url https://statsigapi.net/console/v1/holdouts/{id} \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"isEnabled": true,
"description": "example holdout description",
"passPercentage": 5,
"gateIDs": [
"4pjeXYDjC2WinSgOiII7wh"
],
"experimentIDs": [
"70fCNphHGesdLwHdHau99q"
],
"layerIDs": [
"5O908pyGoCqw6QH1nt8v82"
],
"isGlobal": false,
"targetingGateID": "4pjeXYDjC2WinSgOiII7wh"
}
'import requests
url = "https://statsigapi.net/console/v1/holdouts/{id}"
payload = {
"isEnabled": True,
"description": "example holdout description",
"passPercentage": 5,
"gateIDs": ["4pjeXYDjC2WinSgOiII7wh"],
"experimentIDs": ["70fCNphHGesdLwHdHau99q"],
"layerIDs": ["5O908pyGoCqw6QH1nt8v82"],
"isGlobal": False,
"targetingGateID": "4pjeXYDjC2WinSgOiII7wh"
}
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({
isEnabled: true,
description: 'example holdout description',
passPercentage: 5,
gateIDs: ['4pjeXYDjC2WinSgOiII7wh'],
experimentIDs: ['70fCNphHGesdLwHdHau99q'],
layerIDs: ['5O908pyGoCqw6QH1nt8v82'],
isGlobal: false,
targetingGateID: '4pjeXYDjC2WinSgOiII7wh'
})
};
fetch('https://statsigapi.net/console/v1/holdouts/{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/holdouts/{id}",
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([
'isEnabled' => true,
'description' => 'example holdout description',
'passPercentage' => 5,
'gateIDs' => [
'4pjeXYDjC2WinSgOiII7wh'
],
'experimentIDs' => [
'70fCNphHGesdLwHdHau99q'
],
'layerIDs' => [
'5O908pyGoCqw6QH1nt8v82'
],
'isGlobal' => false,
'targetingGateID' => '4pjeXYDjC2WinSgOiII7wh'
]),
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/holdouts/{id}"
payload := strings.NewReader("{\n \"isEnabled\": true,\n \"description\": \"example holdout description\",\n \"passPercentage\": 5,\n \"gateIDs\": [\n \"4pjeXYDjC2WinSgOiII7wh\"\n ],\n \"experimentIDs\": [\n \"70fCNphHGesdLwHdHau99q\"\n ],\n \"layerIDs\": [\n \"5O908pyGoCqw6QH1nt8v82\"\n ],\n \"isGlobal\": false,\n \"targetingGateID\": \"4pjeXYDjC2WinSgOiII7wh\"\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/holdouts/{id}")
.header("STATSIG-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"isEnabled\": true,\n \"description\": \"example holdout description\",\n \"passPercentage\": 5,\n \"gateIDs\": [\n \"4pjeXYDjC2WinSgOiII7wh\"\n ],\n \"experimentIDs\": [\n \"70fCNphHGesdLwHdHau99q\"\n ],\n \"layerIDs\": [\n \"5O908pyGoCqw6QH1nt8v82\"\n ],\n \"isGlobal\": false,\n \"targetingGateID\": \"4pjeXYDjC2WinSgOiII7wh\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://statsigapi.net/console/v1/holdouts/{id}")
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 \"isEnabled\": true,\n \"description\": \"example holdout description\",\n \"passPercentage\": 5,\n \"gateIDs\": [\n \"4pjeXYDjC2WinSgOiII7wh\"\n ],\n \"experimentIDs\": [\n \"70fCNphHGesdLwHdHau99q\"\n ],\n \"layerIDs\": [\n \"5O908pyGoCqw6QH1nt8v82\"\n ],\n \"isGlobal\": false,\n \"targetingGateID\": \"4pjeXYDjC2WinSgOiII7wh\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Holdout updated successfully.",
"data": {
"id": "testing_holdout",
"name": "testing holdout",
"description": "helpful summary of what the holdout does",
"idType": "userID",
"lastModifierID": "4dcQUIpS8PHObBGD7HJwOx",
"lastModifiedTime": 1719939380702,
"lastModifierName": "CONSOLE API",
"lastModifierEmail": null,
"creatorID": "4dcQUIpS8PHObBGD7HJwOx",
"createdTime": 1719873870785,
"creatorName": "CONSOLE API",
"creatorEmail": null,
"targetApps": [],
"tags": [],
"team": "Console Team",
"isEnabled": false,
"isGlobal": false,
"passPercentage": 0,
"gateIDs": [],
"experimentIDs": [],
"layerIDs": [],
"targetingGateID": null
}
}{
"status": 401,
"message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}{
"status": 404,
"message": "Holdout not found."
}Holdouts
Patch holdout by id. You can pass in only the data you want to update.
PATCH
/
console
/
v1
/
holdouts
/
{id}
Patch holdout by id. You can pass in only the data you want to update.
curl --request PATCH \
--url https://statsigapi.net/console/v1/holdouts/{id} \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"isEnabled": true,
"description": "example holdout description",
"passPercentage": 5,
"gateIDs": [
"4pjeXYDjC2WinSgOiII7wh"
],
"experimentIDs": [
"70fCNphHGesdLwHdHau99q"
],
"layerIDs": [
"5O908pyGoCqw6QH1nt8v82"
],
"isGlobal": false,
"targetingGateID": "4pjeXYDjC2WinSgOiII7wh"
}
'import requests
url = "https://statsigapi.net/console/v1/holdouts/{id}"
payload = {
"isEnabled": True,
"description": "example holdout description",
"passPercentage": 5,
"gateIDs": ["4pjeXYDjC2WinSgOiII7wh"],
"experimentIDs": ["70fCNphHGesdLwHdHau99q"],
"layerIDs": ["5O908pyGoCqw6QH1nt8v82"],
"isGlobal": False,
"targetingGateID": "4pjeXYDjC2WinSgOiII7wh"
}
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({
isEnabled: true,
description: 'example holdout description',
passPercentage: 5,
gateIDs: ['4pjeXYDjC2WinSgOiII7wh'],
experimentIDs: ['70fCNphHGesdLwHdHau99q'],
layerIDs: ['5O908pyGoCqw6QH1nt8v82'],
isGlobal: false,
targetingGateID: '4pjeXYDjC2WinSgOiII7wh'
})
};
fetch('https://statsigapi.net/console/v1/holdouts/{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/holdouts/{id}",
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([
'isEnabled' => true,
'description' => 'example holdout description',
'passPercentage' => 5,
'gateIDs' => [
'4pjeXYDjC2WinSgOiII7wh'
],
'experimentIDs' => [
'70fCNphHGesdLwHdHau99q'
],
'layerIDs' => [
'5O908pyGoCqw6QH1nt8v82'
],
'isGlobal' => false,
'targetingGateID' => '4pjeXYDjC2WinSgOiII7wh'
]),
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/holdouts/{id}"
payload := strings.NewReader("{\n \"isEnabled\": true,\n \"description\": \"example holdout description\",\n \"passPercentage\": 5,\n \"gateIDs\": [\n \"4pjeXYDjC2WinSgOiII7wh\"\n ],\n \"experimentIDs\": [\n \"70fCNphHGesdLwHdHau99q\"\n ],\n \"layerIDs\": [\n \"5O908pyGoCqw6QH1nt8v82\"\n ],\n \"isGlobal\": false,\n \"targetingGateID\": \"4pjeXYDjC2WinSgOiII7wh\"\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/holdouts/{id}")
.header("STATSIG-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"isEnabled\": true,\n \"description\": \"example holdout description\",\n \"passPercentage\": 5,\n \"gateIDs\": [\n \"4pjeXYDjC2WinSgOiII7wh\"\n ],\n \"experimentIDs\": [\n \"70fCNphHGesdLwHdHau99q\"\n ],\n \"layerIDs\": [\n \"5O908pyGoCqw6QH1nt8v82\"\n ],\n \"isGlobal\": false,\n \"targetingGateID\": \"4pjeXYDjC2WinSgOiII7wh\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://statsigapi.net/console/v1/holdouts/{id}")
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 \"isEnabled\": true,\n \"description\": \"example holdout description\",\n \"passPercentage\": 5,\n \"gateIDs\": [\n \"4pjeXYDjC2WinSgOiII7wh\"\n ],\n \"experimentIDs\": [\n \"70fCNphHGesdLwHdHau99q\"\n ],\n \"layerIDs\": [\n \"5O908pyGoCqw6QH1nt8v82\"\n ],\n \"isGlobal\": false,\n \"targetingGateID\": \"4pjeXYDjC2WinSgOiII7wh\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Holdout updated successfully.",
"data": {
"id": "testing_holdout",
"name": "testing holdout",
"description": "helpful summary of what the holdout does",
"idType": "userID",
"lastModifierID": "4dcQUIpS8PHObBGD7HJwOx",
"lastModifiedTime": 1719939380702,
"lastModifierName": "CONSOLE API",
"lastModifierEmail": null,
"creatorID": "4dcQUIpS8PHObBGD7HJwOx",
"createdTime": 1719873870785,
"creatorName": "CONSOLE API",
"creatorEmail": null,
"targetApps": [],
"tags": [],
"team": "Console Team",
"isEnabled": false,
"isGlobal": false,
"passPercentage": 0,
"gateIDs": [],
"experimentIDs": [],
"layerIDs": [],
"targetingGateID": null
}
}{
"status": 401,
"message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}{
"status": 404,
"message": "Holdout not found."
}Authorizations
Headers
Optional header to respect review settings for mutation endpoints.
Path Parameters
id
Body
application/json
enable or disable the holdout
Example:
true
brief summary of what the holdout is being used for
Maximum string length:
1000Example:
"example holdout description"
percentage of users between 0-10% to pass through the holdout
Required range:
0 <= x <= 10Example:
5
an array of gateIDs which this holdout is applied to
Example:
["4pjeXYDjC2WinSgOiII7wh"]
an array of experimentIDs which this holdout is applied to
Example:
["70fCNphHGesdLwHdHau99q"]
an array of layerIDs which this holdout is applied to
Example:
["5O908pyGoCqw6QH1nt8v82"]
whether the holdout is being applied to all new gates
Example:
false
the gateID that the holdout is targeting
Example:
"4pjeXYDjC2WinSgOiII7wh"
⌘I

