Fetch a single Holdout
1 min
GET
https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id}
Path Parameters
- project_idintegerrequiredExampleDescription
- holdout_idintegerrequiredExampleDescription
Responses
200
- HoldoutExamplesConcluded holdout with complete lifecycle:
{ "archive_url": "/projects/12345/holdouts/archived", "archived": false, "created_time": "2024-06-28T10:00:00.000Z", "delete_url": "/projects/12345/holdouts/987", "description": "Completed control group study showing 15% incremental impact", "end_time": "2024-08-31T23:59:59.000Z", "environment_key": "production", "holdout_results_api_token": "SampleToken.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9", "id": 987, "key": "q3_control_group", "metrics": [ { "id": "conversion_rate", "name": "Conversion Rate", "type": "custom" }, { "id": "revenue_per_visitor", "name": "Revenue per Visitor", "type": "custom" } ], "name": "Q3 Marketing Control Group - Concluded", "project_id": 12345, "rules": { "456": { "created_time": "2024-06-15T10:00:00.000Z", "flag_key": "promo_banner", "flag_name": "Promotional Banner", "flag_status": "archived", "rule_key": "summer_promo", "rule_name": "Summer Promotion", "traffic_allocation": 2000, "updated_time": "2024-08-31T23:59:59.000Z" } }, "start_time": "2024-07-01T09:00:00.000Z", "status": "concluded", "traffic_allocation": 1000, "updated_time": "2024-08-31T23:59:59.000Z", "url": "/projects/12345/holdouts/987", "urn": "holdouts.flag.optimizely.com::987" }Draft holdout ready for configuration:{ "archive_url": "/projects/12345/holdouts/archived", "archived": false, "created_time": "2024-09-15T10:00:00.000Z", "delete_url": "/projects/12345/holdouts/987", "description": "Control group for Q4 marketing campaigns to measure incremental impact", "environment_key": "production", "holdout_results_api_token": "SampleToken.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9", "id": 987, "key": "q4_control_group", "metrics": [], "name": "Q4 Marketing Control Group", "project_id": 12345, "rules": {}, "status": "draft", "traffic_allocation": 1000, "update_url": "/projects/12345/holdouts/987", "updated_time": "2024-09-15T10:00:00.000Z", "url": "/projects/12345/holdouts/987", "urn": "holdouts.flag.optimizely.com::987" }Active holdout with experiment rules:{ "archived": false, "created_time": "2024-09-15T10:00:00.000Z", "delete_url": "/projects/12345/holdouts/987", "description": "Active control group excluding 10% traffic from all experiments", "environment_key": "production", "holdout_results_api_token": "SampleToken.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9", "id": 987, "key": "q4_control_group", "metrics": [ { "id": "revenue_impact", "name": "Revenue Impact", "type": "custom" } ], "name": "Q4 Marketing Control Group", "project_id": 12345, "rules": { "456": { "created_time": "2024-09-10T14:30:00.000Z", "flag_key": "new_checkout", "flag_name": "New Checkout Experience", "flag_status": "unarchived", "rule_key": "checkout_experiment", "rule_name": "Checkout Flow Test", "traffic_allocation": 2000, "updated_time": "2024-09-12T11:15:00.000Z" } }, "start_time": "2024-09-16T09:00:00.000Z", "status": "running", "traffic_allocation": 1000, "update_url": "/projects/12345/holdouts/987", "updated_time": "2024-09-16T09:00:00.000Z", "url": "/projects/12345/holdouts/987", "urn": "holdouts.flag.optimizely.com::987" }Description- archivedbooleanDescription
- audience_conditionsobject[]ExampleDescription
- audience_idsinteger[]Example
[ 5340810295, 1234567890 ]
Description - created_by_user_emailstringExampleDescription
- created_timestring<date-time>ExampleDescriptionFormatdate-time
- descriptionstringExampleDescriptionMax Length1000
- end_timestring<date-time>ExampleDescriptionFormatdate-time
- environment_keystringExampleDescription
- environment_namestringExampleDescription
- exclude_targeted_deliveriesbooleanDescriptionDefaultfalse
- holdout_results_api_tokenstringExampleDescription
- idintegerrequiredExampleDescription
- keystringrequiredExampleDescriptionMax Length64Pattern^[a-zA-Z0-9_\-]+$
- metricsMetric[]Description
- aggregatorstring<unique | count | sum | ratio>requiredDescriptionAlloweduniquecountsumratio
- display_titlestringDescription
- display_unitstringDescription
- event_idinteger<int64>ExampleDescriptionFormatint64
- event_propertiesobject
- filterobject
- combine_operatorstring<or | and>Allowedorand
- conditionsEventPropertyCondition[]
- namestringrequired
- operatorstring<equal_to | not_equal_to | greater_than | greater_than_or_equal_to | less_than | less_than_or_equal_to | contains | does_not_contain>requiredAllowedequal_tonot_equal_togreater_thangreater_than_or_equal_toless_thanless_than_or_equal_tocontainsdoes_not_contain
- typestring<string | number | boolean>requiredAllowedstringnumberboolean
- valuestringrequired
- event_typestring
- fieldstring<revenue | value>DescriptionAllowedrevenuevalue
- idstringDescription
- metricsSubMetric[]
- aggregatorstring
- display_titlestring
- event_idinteger
- event_typestring
- fieldstring
- rolestring<numerator | denominator>Allowednumeratordenominator
- scopestring
- project_idintegerDescription
- scopestring<session | visitor | event>DescriptionAllowedsessionvisitorevent
- visibilitystring<account | experiment | project>DescriptionAllowedaccountexperimentproject
- winning_directionstring<increasing | decreasing>requiredDescriptionAllowedincreasingdecreasing
- namestringrequiredExampleDescriptionMax Length255
- project_idinteger<int64>ExampleDescriptionFormatint64
- projectsobject[]Example
[ { "id": 123 } ]Description- idinteger<int64>DescriptionFormatint64
- revisionintegerExampleDescription
- rulesobject[]Example
[ { "flag_key": "my_flag", "id": 456, "key": "experiment_rule_a", "name": "Experiment Rule A", "project_id": 123 } ]Description- flag_idinteger<int64>DescriptionFormatint64
- flag_keystringDescription
- flag_namestringDescription
- idinteger<int64>DescriptionFormatint64
- keystringDescription
- namestringDescription
- project_idinteger<int64>DescriptionFormatint64
- scopestring<global | local>ExampleDescriptionAllowedgloballocal
- start_timestring<date-time>ExampleDescriptionFormatdate-time
- statusstring<draft | running | concluded>ExampleDescriptionAlloweddraftrunningconcluded
- traffic_allocationintegerExampleDescriptionMinimum0Maximum10000
- updated_timestring<date-time>ExampleDescriptionFormatdate-time
- urlstringExampleDescription
- urnstringExampleDescription
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
404
- ProblemDetailExample
{ "detail": "Holdout not found with id '987'", "status": 404, "title": "Holdout not found", "type": "about:blank" }Description- detailstringrequiredDescription
- statusintegerrequiredDescription
- titlestringrequiredDescription
- typestringrequiredDescription
- uuidstringDescription
curl
curl --request GET \
--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: 'GET',
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::Get.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("GET", url, headers=headers, data=payload)
print(response.text)
200
// Successfully retrieved the holdout with all its configuration details.
Response includes:
Core properties: ID, key, name, description, status, traffic allocation
Lifecycle data: Created/updated timestamps, start/end times (if applicable)
Configuration: Environment, audience conditions, metrics setup
Experiment rules: Associated experiments and their allocation settings
Management links: URLs for update, archive, delete operations (if authorized)
System metadata: URN, project association, archive status
Link availability depends on user permissions:
Missing update_url: Cannot modify this holdout
Missing delete_url: Cannot permanently delete
Missing archive_url/unarchive_url: Cannot change archive status
Status-specific data:
Draft holdouts: Full configuration, no timing data
Running holdouts: Includes start_time, active experiment rules
Concluded holdouts: Includes both start_time and end_time
{
"archived": false,
"audience_conditions": [
{}
],
"audience_ids": [
0
],
"created_by_user_email": "[email protected]",
"created_time": "2023-12-15T10:00:00.000Z",
"description": "Holdout group to measure the overall impact of our growth experiments throughout the year",
"end_time": "2024-12-31T23:59:59.000Z",
"environment_key": "production",
"environment_name": "Production",
"exclude_targeted_deliveries": false,
"holdout_results_api_token": "SampleToken.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"id": 12345,
"key": "annual_growth_holdout",
"metrics": [
{
"aggregator": "",
"display_title": "",
"display_unit": "",
"event_id": 32334454244,
"event_properties": {
"filter": {
"combine_operator": "",
"conditions": [
{
"name": "",
"operator": "",
"type": "",
"value": ""
}
]
}
},
"event_type": "",
"field": "",
"id": "",
"metrics": [
{
"aggregator": "",
"display_title": "",
"event_id": 0,
"event_type": "",
"field": "",
"role": "",
"scope": ""
}
],
"project_id": 0,
"scope": "",
"visibility": "",
"winning_direction": ""
}
],
"name": "Annual Growth Control Group",
"project_id": 98765,
"projects": [
{
"id": ""
}
],
"revision": 3,
"rules": [
{
"flag_id": "",
"flag_key": "",
"flag_name": "",
"id": "",
"key": "",
"name": "",
"project_id": ""
}
],
"scope": "global",
"start_time": "2024-01-01T00:00:00.000Z",
"status": "running",
"traffic_allocation": 1000,
"updated_time": "2024-01-01T10:00:00.000Z",
"url": "/holdouts/12345",
"urn": "holdout.flag.optimizely.com::12345"
}GENERATED
// Successfully retrieved the holdout with all its configuration details.
Response includes:
Core properties: ID, key, name, description, status, traffic allocation
Lifecycle data: Created/updated timestamps, start/end times (if applicable)
Configuration: Environment, audience conditions, metrics setup
Experiment rules: Associated experiments and their allocation settings
Management links: URLs for update, archive, delete operations (if authorized)
System metadata: URN, project association, archive status
Link availability depends on user permissions:
Missing update_url: Cannot modify this holdout
Missing delete_url: Cannot permanently delete
Missing archive_url/unarchive_url: Cannot change archive status
Status-specific data:
Draft holdouts: Full configuration, no timing data
Running holdouts: Includes start_time, active experiment rules
Concluded holdouts: Includes both start_time and end_time
{
"archived": false,
"audience_conditions": [
{}
],
"audience_ids": [
0
],
"created_by_user_email": "[email protected]",
"created_time": "2023-12-15T10:00:00.000Z",
"description": "Holdout group to measure the overall impact of our growth experiments throughout the year",
"end_time": "2024-12-31T23:59:59.000Z",
"environment_key": "production",
"environment_name": "Production",
"exclude_targeted_deliveries": false,
"holdout_results_api_token": "SampleToken.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"id": 12345,
"key": "annual_growth_holdout",
"metrics": [
{
"aggregator": "",
"display_title": "",
"display_unit": "",
"event_id": 32334454244,
"event_properties": {
"filter": {
"combine_operator": "",
"conditions": [
{
"name": "",
"operator": "",
"type": "",
"value": ""
}
]
}
},
"event_type": "",
"field": "",
"id": "",
"metrics": [
{
"aggregator": "",
"display_title": "",
"event_id": 0,
"event_type": "",
"field": "",
"role": "",
"scope": ""
}
],
"project_id": 0,
"scope": "",
"visibility": "",
"winning_direction": ""
}
],
"name": "Annual Growth Control Group",
"project_id": 98765,
"projects": [
{
"id": ""
}
],
"revision": 3,
"rules": [
{
"flag_id": "",
"flag_key": "",
"flag_name": "",
"id": "",
"key": "",
"name": "",
"project_id": ""
}
],
"scope": "global",
"start_time": "2024-01-01T00:00:00.000Z",
"status": "running",
"traffic_allocation": 1000,
"updated_time": "2024-01-01T10:00:00.000Z",
"url": "/holdouts/12345",
"urn": "holdout.flag.optimizely.com::12345"
}concluded_holdout
// Concluded holdout with complete lifecycle
{
"archive_url": "/projects/12345/holdouts/archived",
"archived": false,
"created_time": "2024-06-28T10:00:00.000Z",
"delete_url": "/projects/12345/holdouts/987",
"description": "Completed control group study showing 15% incremental impact",
"end_time": "2024-08-31T23:59:59.000Z",
"environment_key": "production",
"holdout_results_api_token": "SampleToken.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"id": 987,
"key": "q3_control_group",
"metrics": [
{
"id": "conversion_rate",
"name": "Conversion Rate",
"type": "custom"
},
{
"id": "revenue_per_visitor",
"name": "Revenue per Visitor",
"type": "custom"
}
],
"name": "Q3 Marketing Control Group - Concluded",
"project_id": 12345,
"rules": {
"456": {
"created_time": "2024-06-15T10:00:00.000Z",
"flag_key": "promo_banner",
"flag_name": "Promotional Banner",
"flag_status": "archived",
"rule_key": "summer_promo",
"rule_name": "Summer Promotion",
"traffic_allocation": 2000,
"updated_time": "2024-08-31T23:59:59.000Z"
}
},
"start_time": "2024-07-01T09:00:00.000Z",
"status": "concluded",
"traffic_allocation": 1000,
"updated_time": "2024-08-31T23:59:59.000Z",
"url": "/projects/12345/holdouts/987",
"urn": "holdouts.flag.optimizely.com::987"
}draft_holdout
// Draft holdout ready for configuration
{
"archive_url": "/projects/12345/holdouts/archived",
"archived": false,
"created_time": "2024-09-15T10:00:00.000Z",
"delete_url": "/projects/12345/holdouts/987",
"description": "Control group for Q4 marketing campaigns to measure incremental impact",
"environment_key": "production",
"holdout_results_api_token": "SampleToken.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"id": 987,
"key": "q4_control_group",
"metrics": [],
"name": "Q4 Marketing Control Group",
"project_id": 12345,
"rules": {},
"status": "draft",
"traffic_allocation": 1000,
"update_url": "/projects/12345/holdouts/987",
"updated_time": "2024-09-15T10:00:00.000Z",
"url": "/projects/12345/holdouts/987",
"urn": "holdouts.flag.optimizely.com::987"
}running_holdout
// Active holdout with experiment rules
{
"archived": false,
"created_time": "2024-09-15T10:00:00.000Z",
"delete_url": "/projects/12345/holdouts/987",
"description": "Active control group excluding 10% traffic from all experiments",
"environment_key": "production",
"holdout_results_api_token": "SampleToken.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"id": 987,
"key": "q4_control_group",
"metrics": [
{
"id": "revenue_impact",
"name": "Revenue Impact",
"type": "custom"
}
],
"name": "Q4 Marketing Control Group",
"project_id": 12345,
"rules": {
"456": {
"created_time": "2024-09-10T14:30:00.000Z",
"flag_key": "new_checkout",
"flag_name": "New Checkout Experience",
"flag_status": "unarchived",
"rule_key": "checkout_experiment",
"rule_name": "Checkout Flow Test",
"traffic_allocation": 2000,
"updated_time": "2024-09-12T11:15:00.000Z"
}
},
"start_time": "2024-09-16T09:00:00.000Z",
"status": "running",
"traffic_allocation": 1000,
"update_url": "/projects/12345/holdouts/987",
"updated_time": "2024-09-16T09:00:00.000Z",
"url": "/projects/12345/holdouts/987",
"urn": "holdouts.flag.optimizely.com::987"
}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 or unsupported query parameters
{
"detail": "",
"status": 0,
"title": "",
"type": "",
"uuid": ""
}401
// Invalid credentials
403
// Do not have permission to perform the operation
404
// Not Found - The specified holdout does not exist or you don't have access to it.
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 permanently deleted
Insufficient permissions to view this holdout
{
"detail": "",
"status": 0,
"title": "",
"type": "",
"uuid": ""
}