provider Holdouts (beta) PATCH
/api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts/{holdoutKey} @utdk/launchdarkly
/api/v2/projects/{projectKey}/environments/{environmentKey}/holdouts/{holdoutKey} Patch holdout
Updates an existing holdout, and returns the updated holdout. Updating holdouts uses the semantic patch format.
To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch).
### Instructions
Semantic patch requests support the following `kind` instructions for updating holdouts.
<details>
<summary>Click to expand instructions for <strong>updating holdouts</strong></summary>
#### endHoldout
Ends a holdout.
##### Parameters
None.
Here's an example:
```json
{
"comment": "Optional comment describing why the holdout is ending",
"instructions": [{
"kind": "endHoldout"
}]
}
```
#### removeExperiment
Removes an experiment from a holdout.
##### Parameters
- `value`: The key of the experiment to remove
Here's an example:
```json
{
"comment": "Optional comment describing the change",
"instructions": [{
"kind": "removeExperiment",
"value": "experiment-key"
}]
}
```
#### updateDescription
Updates the description of the holdout.
##### Parameters
- `value`: The new description.
Here's an example:
```json
{
"comment": "Optional comment describing the update",
"instructions": [{
"kind": "updateDescription",
"value": "Updated holdout description"
}]
}
```
#### updateName
Updates the name of the holdout.
##### Parameters
- `value`: The new name.
Here's an example:
```json
{
"comment": "Optional comment describing the update",
"instructions": [{
"kind": "updateName",
"value": "Updated holdout name"
}]
}
```
</details>
- projectKey path required
- The project key
- string
- environmentKey path required
- The environment key
- string
- holdoutKey path required
- The holdout key
- string
Try it
Authentication
Configure credentials for LaunchDarkly REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import launchdarkly from '@utdk/launchdarkly';
await launchdarkly.patchholdout()