---
title: Partially update holdout by id
description: You can pass in only the data you want to update.
product: general
token_estimate: 2176
---
# Partially update holdout by id

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Partially update holdout by id

**PATCH** `/console/v1/holdouts/{id}`

Full URL: `https://statsigapi.net/console/v1/holdouts/{id}`

Partially update holdout by id

You can pass in only the data you want to update.

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| id (path) | string | Yes | — | id |

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| isEnabled | boolean | No | true | enable or disable the holdout |
| description | string | No | example holdout description | brief summary of what the holdout is being used for Constraints: max length: 1000 |
| passPercentage | number | No | 5 | percentage of users between 0-10% to pass through the holdout Constraints: format: double, min: 0, max: 10 |
| gateIDs | string[] | No | ["my_gate"] | an array of gate IDs which this holdout is applied to |
| experimentIDs | string[] | No | ["my_experiment"] | an array of experiment IDs which this holdout is applied to |
| layerIDs | string[] | No | ["my_layer"] | an array of layer IDs which this holdout is applied to |
| isGlobal | boolean | No | false | whether the holdout is being applied to all new gates |
| targetingGateID | string | No | my_targeting_gate | the ID of the gate that the holdout is targeting; an empty string clears it, null leaves it unchanged Constraints: nullable |
| monitoringMetrics | object[] | No | — | — |
| monitoringMetrics.name | string | Yes | — | — |
| monitoringMetrics.type | string | Yes | — | — |

## Response (application/json)

**200** — Update holdout response

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | — | — |
| data.id | string | Yes | — | ID |
| data.name | string | No | — | Optional name for the configuration. |
| data.idType | string | Yes | — | type of id |
| data.description | string | Yes | example holdout description | brief summary of what the holdout is being used for Constraints: max length: 1000 |
| data.lastModifierID | string | Yes | — | ID of the last modifier. Constraints: nullable |
| data.lastModifiedTime | number | Yes | — | Time of the last modification. Constraints: format: double, nullable |
| data.lastModifierEmail | string | Yes | — | Email of the last modifier. Constraints: nullable |
| data.lastModifierName | string | Yes | — | Name of the last modifier. Constraints: nullable |
| data.creatorID | string | Yes | — | ID of the user who created the entity. Constraints: nullable |
| data.createdTime | number | Yes | — | Timestamp when the entity was created. Constraints: format: double |
| data.creatorName | string | Yes | — | Name of the creator. Constraints: nullable |
| data.creatorEmail | string | Yes | — | Email of the creator. Constraints: nullable |
| data.tags | string[] | No | — | Optional tags for categorization. |
| data.targetApps | string[] | No | — | List of target applications associated with this configuration. |
| data.holdoutIDs | string[] | No | — | Holdouts applied to this configuration. |
| data.team | string | No | — | Optional name for the responsible team. Constraints: nullable |
| data.teamID | string | No | — | Optional ID of the responsible team. Constraints: nullable |
| data.version | number | No | — | Version number Constraints: format: double |
| data.permalink | string | Yes | — | A permalink to this holdout in the Statsig Console. Constraints: format: uri |
| data.isEnabled | boolean | Yes | true | enable or disable the holdout |
| data.passPercentage | number | Yes | 5 | percentage of users between 0-10% to pass through the holdout Constraints: format: double, min: 0, max: 10 |
| data.gateIDs | string[] | Yes | ["my_gate"] | an array of gate IDs which this holdout is applied to |
| data.experimentIDs | string[] | Yes | ["my_experiment"] | an array of experiment IDs which this holdout is applied to |
| data.layerIDs | string[] | Yes | ["my_layer"] | an array of layer IDs which this holdout is applied to |
| data.isGlobal | boolean | Yes | false | whether the holdout is being applied to all new gates |
| data.targetingGateID | string | Yes | 4pjeXYDjC2WinSgOiII7wh | the internal ID of the gate that the holdout is targeting; null or empty when unset Constraints: nullable |
| data.monitoringMetrics | object[] | No | — | — |
| data.monitoringMetrics.name | string | Yes | — | — |
| data.monitoringMetrics.type | string | Yes | — | — |

```json
{
  "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,
    "permalink": "https://console.statsig.com/company_id/holdouts/testing_holdout"
  }
}
```

**401** — This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 401 |
| message | string | Yes | — | — |

```json
{
  "status": 401,
  "message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}
```

**404** — Holdout not found.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 404 |
| message | string | Yes | — | — |

```json
{
  "status": 404,
  "message": "Holdout not found."
}
```

## Code samples

### cURL

```bash
curl -X PATCH "https://statsigapi.net/console/v1/holdouts/{id}" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.patch(
    "https://statsigapi.net/console/v1/holdouts/{id}",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/holdouts/{id}", {
  method: "PATCH",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/holdouts/{id}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("PATCH", "https://statsigapi.net/console/v1/holdouts/{id}", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/holdouts/{id}"))
      .method("PATCH", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/holdouts/{id}")
request = Net::HTTP::Patch.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

