Delete a Holdout
1 min
DELETE
https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id}
Path Parameters
- project_idintegerrequiredExampleDescription
- holdout_idintegerrequiredExampleDescription
Responses
204
400
- ProblemDetailExample
{ "detail": "Holdout ID must be a positive integer", "status": 400, "title": "Invalid holdout ID", "type": "about:blank" }Description- detailstringrequiredDescription
- statusintegerrequiredDescription
- titlestringrequiredDescription
- typestringrequiredDescription
- uuidstringDescription
401
403
- ProblemDetailExamplesHoldouts feature disabled:
{ "detail": "Holdouts feature is not enabled for this project", "status": 403, "title": "Feature not enabled", "type": "about:blank" }Insufficient permissions:{ "detail": "Permission denied - insufficient privileges to delete holdouts", "status": 403, "title": "Forbidden", "type": "about:blank" }Description- detailstringrequiredDescription
- statusintegerrequiredDescription
- titlestringrequiredDescription
- typestringrequiredDescription
- uuidstringDescription
404
- ProblemDetailExamplesHoldout does not exist:
{ "detail": "Holdout not found with id '987'", "status": 404, "title": "Holdout not found", "type": "about:blank" }Project does not exist:{ "detail": "Project not found with id '12345'", "status": 404, "title": "Project not found", "type": "about:blank" }Description- detailstringrequiredDescription
- statusintegerrequiredDescription
- titlestringrequiredDescription
- typestringrequiredDescription
- uuidstringDescription
curl
curl --request DELETE \
--url https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id} \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'DELETE',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
204
// Successfully deleted the holdout. No response body is returned.
Deletion completed:
Holdout configuration permanently removed from database
Associated metrics deleted
All experiment rules and historical data destroyed
Holdout is no longer accessible via any API endpoints
What happens after deletion:
GET requests to this holdout will return 404 Not Found
The holdout will not appear in list responses
Associated URLs (update_url, fetch_url, etc.) become invalid
Any references to this holdout in other systems should be cleaned up
A successful 204 response confirms the holdout has been completely removed from all systems.
400
// Bad Request - Invalid request parameters or malformed holdout ID.
Common causes:
Invalid holdout_id format (must be a positive integer)
Invalid project_id format (must be a positive integer)
Malformed request structure
{
"detail": "",
"status": 0,
"title": "",
"type": "",
"uuid": ""
}401
// Invalid credentials
403
// Forbidden - You don't have permission to delete holdouts in this project.
Permission requirements:
Must have project-level access
Must have holdout deletion permissions
Holdouts feature must be enabled for this project
Common causes:
Insufficient user permissions for destructive operations
Project-level permissions don't include holdout management
Organization-level policies restrict holdout deletion
Holdouts feature flag is disabled for this project
{
"detail": "",
"status": 0,
"title": "",
"type": "",
"uuid": ""
}GENERATED
// Forbidden - You don't have permission to delete holdouts in this project.
Permission requirements:
Must have project-level access
Must have holdout deletion permissions
Holdouts feature must be enabled for this project
Common causes:
Insufficient user permissions for destructive operations
Project-level permissions don't include holdout management
Organization-level policies restrict holdout deletion
Holdouts feature flag is disabled for this project
{
"detail": "",
"status": 0,
"title": "",
"type": "",
"uuid": ""
}feature_disabled
// Holdouts feature disabled
{
"detail": "Holdouts feature is not enabled for this project",
"status": 403,
"title": "Feature not enabled",
"type": "about:blank"
}insufficient_permissions
// Insufficient permissions
{
"detail": "Permission denied - insufficient privileges to delete holdouts",
"status": 403,
"title": "Forbidden",
"type": "about:blank"
}404
// Not Found - The specified holdout does not exist or has already been deleted.
Possible reasons:
Holdout ID does not exist in the specified project
Project ID does not exist or you don't have access to it
Holdout was already deleted by another user/process
Insufficient permissions to view or delete this holdout
Note: This is also returned if the holdout exists but you lack delete permissions,
for security reasons (to prevent ID enumeration attacks).
{
"detail": "",
"status": 0,
"title": "",
"type": "",
"uuid": ""
}GENERATED
// Not Found - The specified holdout does not exist or has already been deleted.
Possible reasons:
Holdout ID does not exist in the specified project
Project ID does not exist or you don't have access to it
Holdout was already deleted by another user/process
Insufficient permissions to view or delete this holdout
Note: This is also returned if the holdout exists but you lack delete permissions,
for security reasons (to prevent ID enumeration attacks).
{
"detail": "",
"status": 0,
"title": "",
"type": "",
"uuid": ""
}holdout_not_found
// Holdout does not exist
{
"detail": "Holdout not found with id '987'",
"status": 404,
"title": "Holdout not found",
"type": "about:blank"
}project_not_found
// Project does not exist
{
"detail": "Project not found with id '12345'",
"status": 404,
"title": "Project not found",
"type": "about:blank"
}