---
title: Create a cross-project Holdout
slug: feature-experimentation/api/create-a-cross-project-holdout
docTags: 
createdAt: 2026-10-13T18:16:15.508Z
---

{
  "id": "2kHD2fwt0PnKx5-bMVQuw",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.optimizely.com/flags/v1//holdouts",
    "servers": [
      {
        "url": "https://api.optimizely.com/flags/v1//holdouts"
      }
    ],
    "name": "Create a cross-project Holdout",
    "description": "<p>Creates a new holdout via a project-agnostic endpoint. Supports both global\n(applies to all rules in selected projects) and local (applies to specific rules)\nscopes. This endpoint does not require a project_id in the URL — the client\nprovides <code>project_id</code> in the request body.</p>\n<p><strong>Required field:</strong> <code>project_id</code> — The ID of the project that owns this holdout.\nUsed for database unique constraints and permission inheritance.</p>\n<p><strong>Global holdouts:</strong></p>\n<ul>\n<li>Provide <code>project_ids</code> — the holdout applies to ALL rules in the specified projects.</li>\n<li>The <code>project_id</code> must be one of the <code>project_ids</code>.</li>\n</ul>\n<p><strong>Local holdouts:</strong></p>\n<ul>\n<li>Provide <code>rule_ids</code> — the holdout applies to ONLY the specified rules.</li>\n<li>The <code>project_ids</code> are auto-derived from each rule's flag ownership. Not required — will be ignored if provided.</li>\n<li>The <code>project_id</code> must be the owner of at least one of the <code>rule_ids</code>.</li>\n</ul>\n<p>Gated behind the <code>holdouts-m2</code> feature flag.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "example": "{\"audience_conditions\":[\"or\",{\"audience_id\":5340810295}],\"description\":\"Holdout group to measure the overall impact of our growth experiments throughout the year\",\"environment_key\":\"production\",\"key\":\"annual_growth_holdout\",\"metrics\":[{\"aggregator\":\"unique\",\"display_title\":\"Conversion Rate\",\"scope\":\"visitor\",\"winning_direction\":\"increasing\"}],\"name\":\"Annual Growth Control Group\",\"project_id\":12345,\"project_ids\":[12345,67890],\"scope\":\"global\",\"start_time\":\"2024-01-01T00:00:00.000Z\",\"traffic_allocation\":500}",
          "description": "<p>Request body schema for creating or updating a holdout.</p>\n<p>Holdouts are experiments that reserve a portion of your traffic to measure the impact of your feature flags and experiments. They help establish a control group by excluding a percentage of users from seeing any experiments, allowing you to measure the overall impact of your experimentation program.</p>\n<p><strong>NOTE:</strong> This schema is shared between two endpoints with different validation rules:</p>\n<ul>\n<li><strong>POST /projects/{project_id}/holdouts</strong>: <code>project_id</code>, <code>project_ids</code>, and <code>rule_ids</code> from the body are ignored (project comes from URL)</li>\n<li><strong>POST /holdouts</strong>: <code>project_id</code> is required in the body, plus either <code>project_ids</code> (global) or <code>rule_ids</code> (local)</li>\n</ul>\n<p>These constraints are enforced at runtime by the API, not by OpenAPI schema validation.</p>",
          "customType": "HoldoutRequestBody",
          "schema": [
            {
              "name": "audience_conditions",
              "kind": "optional",
              "type": "array",
              "description": "<p>Defines which audiences this holdout should apply to. If omitted, the holdout applies to all users.\nUses the same structure as audience conditions in experiments - supports logical operators like 'and', 'or', 'not'.</p>",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "itemExample": "[\"or\",{\"audience_id\":5340810295},{\"audience_id\":1234567890}]",
              "itemDefault": ""
            },
            {
              "name": "audience_ids",
              "kind": "optional",
              "type": "array",
              "deprecated": true,
              "description": "Warning: Deprecated\n<p>DEPRECATED: Use audience_conditions instead. List of audience IDs that this holdout should apply to.\nThis field is maintained for backward compatibility.</p>",
              "example": "[5340810295,1234567890]",
              "itemType": "integer",
              "customType": "integer[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Optional detailed description explaining the purpose and context of this holdout. \nHelps team members understand what this holdout is measuring.\n",
              "example": "Holdout group to measure the overall impact of our growth experiments throughout the year",
              "maxLength": 1000
            },
            {
              "name": "environment_key",
              "kind": "optional",
              "type": "string",
              "description": "<p>The environment where this holdout will be active (e.g., 'production', 'staging').\nThe holdout will only affect traffic in this specific environment.</p>",
              "example": "production"
            },
            {
              "name": "exclude_targeted_deliveries",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>When true, Targeted Delivery rules are excluded from this holdout, so\nholdout users are not withheld from them. Targeted Deliveries represent\npermanent ship decisions rather than active experiments, so there is\nnothing to measure by withholding them.\nApplies to global holdouts only; ignored for local holdouts.\nCan only be changed while the holdout is in draft status.\nDefaults to false.</p>",
              "example": false,
              "default": false
            },
            {
              "name": "key",
              "kind": "required",
              "type": "string",
              "description": "<p>Unique identifier for the holdout. Must be unique within the project.\nUse alphanumeric characters, underscores, and hyphens only.</p>",
              "example": "annual_growth_holdout",
              "maxLength": 64,
              "pattern": "^[a-zA-Z0-9_\\-]+$"
            },
            {
              "name": "metrics",
              "kind": "optional",
              "type": "array",
              "description": "List of metrics that will be tracked and analyzed for this holdout.\nThese metrics help measure the impact of experiments on your control group.\n",
              "modelRef": "#/components/schemas/Metric",
              "customType": "Metric[]",
              "schema": [
                {
                  "name": "aggregator",
                  "kind": "required",
                  "type": "string<unique | count | sum | ratio>",
                  "description": "<p>The aggregation function for the numerator of the metric. 'unique' measures the number of unique visitors/sessions that include the specified Event. 'count' measures the total number of occurrences of Event for the scope (visitor/session). 'sum' is the sum of the 'field' value</p>",
                  "enum": [
                    "unique",
                    "count",
                    "sum",
                    "ratio"
                  ]
                },
                {
                  "name": "display_title",
                  "kind": "optional",
                  "type": "string",
                  "description": "<p>An optional title for the unique metric configuration. If not provided, the event name will be used.</p>"
                },
                {
                  "name": "display_unit",
                  "kind": "optional",
                  "type": "string",
                  "description": "An optional name for the unit of the unique metric configuration."
                },
                {
                  "name": "event_id",
                  "kind": "optional",
                  "type": "integer<int64>",
                  "description": "<p>The ID for the Event to select data from. Omitted for global metrics that are not relative to a specific Event, i.e. \"overall revenue\"</p>",
                  "example": 32334454244,
                  "format": "int64"
                },
                {
                  "name": "event_properties",
                  "kind": "optional",
                  "type": "object",
                  "description": "",
                  "example": "",
                  "schema": [
                    {
                      "name": "filter",
                      "kind": "optional",
                      "type": "object",
                      "description": "",
                      "example": "",
                      "schema": [
                        {
                          "name": "combine_operator",
                          "kind": "optional",
                          "type": "string<or | and>",
                          "description": "",
                          "enum": [
                            "or",
                            "and"
                          ]
                        },
                        {
                          "name": "conditions",
                          "kind": "optional",
                          "type": "array",
                          "description": "",
                          "modelRef": "#/components/schemas/EventPropertyCondition",
                          "customType": "EventPropertyCondition[]",
                          "schema": [
                            {
                              "name": "name",
                              "kind": "required",
                              "type": "string",
                              "description": ""
                            },
                            {
                              "name": "operator",
                              "kind": "required",
                              "type": "string<equal_to | not_equal_to | greater_than | greater_than_or_equal_to | less_than | less_than_or_equal_to | contains | does_not_contain>",
                              "description": "",
                              "enum": [
                                "equal_to",
                                "not_equal_to",
                                "greater_than",
                                "greater_than_or_equal_to",
                                "less_than",
                                "less_than_or_equal_to",
                                "contains",
                                "does_not_contain"
                              ]
                            },
                            {
                              "name": "type",
                              "kind": "required",
                              "type": "string<string | number | boolean>",
                              "description": "",
                              "enum": [
                                "string",
                                "number",
                                "boolean"
                              ]
                            },
                            {
                              "name": "value",
                              "kind": "required",
                              "type": "string",
                              "description": ""
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "name": "event_type",
                  "kind": "optional",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "field",
                  "kind": "optional",
                  "type": "string<revenue | value>",
                  "nullable": true,
                  "description": "<p>The field to aggregate for the numerator of the metric. Required when 'aggregator' = 'sum', otherwise omitted</p>",
                  "enum": [
                    "revenue",
                    "value"
                  ]
                },
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "string",
                  "description": "A unique identifier for the metric configuration."
                },
                {
                  "name": "metrics",
                  "kind": "optional",
                  "type": "array",
                  "description": "",
                  "modelRef": "#/components/schemas/SubMetric",
                  "customType": "SubMetric[]",
                  "schema": [
                    {
                      "name": "aggregator",
                      "kind": "optional",
                      "type": "string",
                      "description": ""
                    },
                    {
                      "name": "display_title",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": ""
                    },
                    {
                      "name": "event_id",
                      "kind": "optional",
                      "type": "integer",
                      "description": ""
                    },
                    {
                      "name": "event_type",
                      "kind": "optional",
                      "type": "string",
                      "description": ""
                    },
                    {
                      "name": "field",
                      "kind": "optional",
                      "type": "string",
                      "nullable": true,
                      "description": ""
                    },
                    {
                      "name": "role",
                      "kind": "optional",
                      "type": "string<numerator | denominator>",
                      "description": "",
                      "enum": [
                        "numerator",
                        "denominator"
                      ]
                    },
                    {
                      "name": "scope",
                      "kind": "optional",
                      "type": "string",
                      "description": ""
                    }
                  ]
                },
                {
                  "name": "project_id",
                  "kind": "optional",
                  "type": "integer",
                  "description": "A unique identifier for the project associated with the metric."
                },
                {
                  "name": "scope",
                  "kind": "optional",
                  "type": "string<session | visitor | event>",
                  "description": "<p>Specifies how Events should be grouped together. Can also be thought of as the denonimator of the metric. 'session' divides by the number of sessions. \"Influenced sessions\", or sessions that do not contain a decision Event but carry a decision from a previous session are not included in counts for numerator or denominator. 'visitor' divides by the number of visitors. 'event' divides by the total occurrences (impressions) of the specified Event</p>",
                  "enum": [
                    "session",
                    "visitor",
                    "event"
                  ]
                },
                {
                  "name": "visibility",
                  "kind": "optional",
                  "type": "string<account | experiment | project>",
                  "description": "The visibility of the metric.",
                  "enum": [
                    "account",
                    "experiment",
                    "project"
                  ]
                },
                {
                  "name": "winning_direction",
                  "kind": "required",
                  "type": "string<increasing | decreasing>",
                  "description": "The winning direction of this metric",
                  "enum": [
                    "increasing",
                    "decreasing"
                  ]
                }
              ]
            },
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "<p>Human-readable name for the holdout that will be displayed in the UI.</p>",
              "example": "Annual Growth Control Group",
              "maxLength": 255
            },
            {
              "name": "project_id",
              "kind": "optional",
              "type": "integer<int64>",
              "description": "<p>The ID of the project that owns this holdout.</p>\n<p><strong>For POST /holdouts (cross-project creates) - required, validated at runtime:</strong></p>\n<ul>\n<li><strong>Global scope</strong>: Must be one of the <code>project_ids</code> in the request.</li>\n<li><strong>Local scope</strong>: Must be the project ID that owns at least one of the specified <code>rule_ids</code>.</li>\n<li>Returns 400 if missing or invalid.</li>\n</ul>\n<p><strong>For POST /projects/{project_id}/holdouts (project-scoped creates):</strong>\nIgnored in the request body. The project_id comes from the URL path parameter.</p>\n<p><strong>In responses:</strong> Always present. Indicates which project owns the holdout.</p>\n<p>Used for:</p>\n<ul>\n<li>Database unique constraint on (key, project_id)</li>\n<li>Permission inheritance</li>\n</ul>",
              "example": 12345,
              "format": "int64"
            },
            {
              "name": "project_ids",
              "kind": "optional",
              "type": "array",
              "description": "<p>List of project IDs that this holdout applies to.</p>\n<p><strong>For POST /holdouts (cross-project):</strong></p>\n<ul>\n<li><strong>Global scope</strong>: Required (validated at runtime). Specifies which projects the holdout affects.</li>\n<li><strong>Local scope</strong>: Ignored. Projects are auto-derived from <code>rule_ids</code>.</li>\n</ul>\n<p><strong>For POST /projects/{project_id}/holdouts (project-scoped):</strong></p>\n<ul>\n<li>Ignored. The project comes from the URL path parameter.</li>\n</ul>",
              "example": "[12345,67890]",
              "itemType": "integer",
              "customType": "integer[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "rule_ids",
              "kind": "optional",
              "type": "array",
              "description": "<p>List of rule IDs that this holdout applies to.</p>\n<p><strong>For POST /holdouts (cross-project):</strong></p>\n<ul>\n<li><strong>Local scope</strong>: Required (validated at runtime). Specifies which rules the holdout affects.</li>\n<li><strong>Global scope</strong>: Ignored. Mutually exclusive with global scope.</li>\n</ul>\n<p><strong>For POST /projects/{project_id}/holdouts (project-scoped):</strong></p>\n<ul>\n<li>Ignored. Only single-project holdouts are supported via this endpoint.</li>\n</ul>",
              "example": "[111,222]",
              "itemType": "integer",
              "customType": "integer[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "scope",
              "kind": "optional",
              "type": "string<global | local>",
              "description": "<p>Defines the scope of the holdout:</p>\n<ul>\n<li>'global': Affects all experiments across the entire project</li>\n<li>'local': Affects only specific experiments or flags (requires additional configuration)</li>\n</ul>\n<p>Defaults to 'global' when omitted (enforced at runtime, not by OpenAPI\nschema validation).</p>\n<p><strong>For POST /projects/{project_id}/holdouts (project-scoped):</strong></p>\n<ul>\n<li>Only 'global' is supported. 'local' is rejected with a 400 error,\nbecause this endpoint ignores <code>rule_ids</code> and a local-scope holdout\ncannot be targeted here. Use the cross-project endpoint\n(POST /holdouts) with <code>rule_ids</code> to create a local-scope holdout.</li>\n</ul>",
              "example": "global",
              "default": "global",
              "enum": [
                "global",
                "local"
              ]
            },
            {
              "name": "start_time",
              "kind": "optional",
              "type": "string<date-time>",
              "description": "<p>When the holdout should become active. If not specified, the holdout will be active immediately upon creation.\nMust be in ISO 8601 format.</p>",
              "example": "2024-01-01T00:00:00.000Z",
              "format": "date-time"
            },
            {
              "name": "traffic_allocation",
              "kind": "optional",
              "type": "integer",
              "description": "<p>Percentage of traffic to allocate to this holdout, expressed in basis points (1/100th of a percent).\nFor example: 100 = 1%, 1000 = 10%, 5000 = 50%. The remaining traffic will see experiments normally.</p>",
              "example": 1000,
              "minimum": 0,
              "maximum": 10000
            }
          ],
          "modelRef": "#/components/schemas/HoldoutRequestBody",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKey",
          "name": "apiKey",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        },
        {
          "id": "OAuth2",
          "name": "OAuth2",
          "kind": "optional",
          "type": "oauth2",
          "description": "Write applications that authenticate with the REST API via OAuth 2.0.",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://app.optimizely.com/oauth2/authorize",
              "tokenUrl": "https://app.optimizely.com/oauth2/token",
              "scopes": {
                "all": "Grants all access"
              }
            }
          },
          "requiredScopes": [
            "read",
            "write"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "<p>Successful retrieval, creation or update of a Holdout.</p>\n<p>The response includes RESTful JSON (<a href=\"https://restfuljson.org/\" target=\"_blank\">https://restfuljson.org/</a>) styled links. If a\nlink is not present in the response, it indicates a user is not authorized to access\nthe related resource.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"archived\":false,\"audience_conditions\":[\"or\",{\"audience_id\":5340810295}],\"created_by_user_email\":\"user@company.com\",\"created_time\":\"2023-12-15T10:00:00.000Z\",\"description\":\"Holdout group to measure the overall impact of our growth experiments throughout the year\",\"environment_key\":\"production\",\"holdout_results_api_token\":\"SampleToken.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\",\"id\":12345,\"key\":\"annual_growth_holdout\",\"metrics\":[{\"aggregator\":\"unique\",\"display_title\":\"Conversion Rate\",\"scope\":\"visitor\",\"winning_direction\":\"increasing\"}],\"name\":\"Annual Growth Control Group\",\"project_id\":98765,\"revision\":3,\"scope\":\"global\",\"start_time\":\"2024-01-01T00:00:00.000Z\",\"status\":\"running\",\"traffic_allocation\":1000,\"updated_time\":\"2024-01-01T10:00:00.000Z\",\"urn\":\"holdout.flag.optimizely.com::12345\"}",
            "description": "<p>Represents a holdout experiment that reserves a portion of traffic to measure the impact of feature flags and experiments.</p>\n<p>Holdouts help establish control groups by excluding a percentage of users from seeing any experiments, allowing you to measure the overall impact of your experimentation program against a baseline.</p>",
            "customType": "Holdout",
            "schema": [
              {
                "name": "archived",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether the holdout is archived. Archived holdouts are hidden from normal views\nbut retain their historical data and configuration.\n",
                "example": false
              },
              {
                "name": "audience_conditions",
                "kind": "optional",
                "type": "array",
                "description": "<p>Defines which audiences this holdout applies to. If omitted, the holdout applies to all users.\nUses logical operators like 'and', 'or', 'not' to combine multiple audience conditions.</p>",
                "example": "[\"[\"or\",{\"audience_id\":5340810295},{\"audience_id\":1234567890}]\"]",
                "itemType": "object",
                "customType": "object[]",
                "itemExample": "[\"or\",{\"audience_id\":5340810295},{\"audience_id\":1234567890}]",
                "itemDefault": ""
              },
              {
                "name": "audience_ids",
                "kind": "optional",
                "type": "array",
                "deprecated": true,
                "description": "Warning: Deprecated\n<p>DEPRECATED: Use audience_conditions instead. List of audience IDs that this holdout applies to.\nThis field is maintained for backward compatibility.</p>",
                "example": "[5340810295,1234567890]",
                "itemType": "integer",
                "customType": "integer[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "created_by_user_email",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "Email address of the user who created the holdout.",
                "example": "user@company.com"
              },
              {
                "name": "created_time",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "nullable": true,
                "description": "Timestamp when the holdout was originally created.",
                "example": "2023-12-15T10:00:00.000Z",
                "format": "date-time"
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Optional detailed description explaining the purpose and context of this holdout.\nHelps team members understand what this holdout is measuring.\n",
                "example": "Holdout group to measure the overall impact of our growth experiments throughout the year",
                "maxLength": 1000
              },
              {
                "name": "end_time",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "nullable": true,
                "description": "Timestamp when the holdout finished or will finish.\nNull for holdouts that are still running or have no defined end time.\n",
                "example": "2024-12-31T23:59:59.000Z",
                "format": "date-time"
              },
              {
                "name": "environment_key",
                "kind": "optional",
                "type": "string",
                "description": "<p>The environment where this holdout is active (e.g., 'production', 'staging').\nThe holdout only affects traffic in this specific environment.</p>",
                "example": "production"
              },
              {
                "name": "environment_name",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "<p>The human-readable name of the environment where this holdout is active.</p>",
                "example": "Production"
              },
              {
                "name": "exclude_targeted_deliveries",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>When true, Targeted Delivery rules are excluded from this holdout, so\nholdout users are not withheld from them. Targeted Deliveries represent\npermanent ship decisions rather than active experiments, so there is\nnothing to measure by withholding them.\nApplies to global holdouts only; ignored for local holdouts.\nCan only be changed while the holdout is in draft status.\nDefaults to false.</p>",
                "example": false,
                "default": false
              },
              {
                "name": "holdout_results_api_token",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "<p>API token for accessing holdout results and analytics data.\nThis token is dynamically generated for each API response and provides\nsecure access to holdout-specific results endpoints.</p>",
                "example": "SampleToken.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
              },
              {
                "name": "id",
                "kind": "required",
                "type": "integer",
                "readOnly": true,
                "description": "<p>System-generated unique identifier for the holdout.</p>",
                "example": 12345
              },
              {
                "name": "key",
                "kind": "required",
                "type": "string",
                "description": "<p>Unique user-defined identifier for the holdout within the project.\nMust contain only alphanumeric characters, underscores, and hyphens.</p>",
                "example": "annual_growth_holdout",
                "maxLength": 64,
                "pattern": "^[a-zA-Z0-9_\\-]+$"
              },
              {
                "name": "metrics",
                "kind": "optional",
                "type": "array",
                "description": "List of metrics being tracked and analyzed for this holdout.\nThese metrics help measure the impact of experiments on the control group.\n",
                "modelRef": "#/components/schemas/Metric",
                "customType": "Metric[]",
                "schema": [
                  {
                    "name": "aggregator",
                    "kind": "required",
                    "type": "string<unique | count | sum | ratio>",
                    "description": "<p>The aggregation function for the numerator of the metric. 'unique' measures the number of unique visitors/sessions that include the specified Event. 'count' measures the total number of occurrences of Event for the scope (visitor/session). 'sum' is the sum of the 'field' value</p>",
                    "enum": [
                      "unique",
                      "count",
                      "sum",
                      "ratio"
                    ]
                  },
                  {
                    "name": "display_title",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>An optional title for the unique metric configuration. If not provided, the event name will be used.</p>"
                  },
                  {
                    "name": "display_unit",
                    "kind": "optional",
                    "type": "string",
                    "description": "An optional name for the unit of the unique metric configuration."
                  },
                  {
                    "name": "event_id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "<p>The ID for the Event to select data from. Omitted for global metrics that are not relative to a specific Event, i.e. \"overall revenue\"</p>",
                    "example": 32334454244,
                    "format": "int64"
                  },
                  {
                    "name": "event_properties",
                    "kind": "optional",
                    "type": "object",
                    "description": "",
                    "example": "",
                    "schema": [
                      {
                        "name": "filter",
                        "kind": "optional",
                        "type": "object",
                        "description": "",
                        "example": "",
                        "schema": [
                          {
                            "name": "combine_operator",
                            "kind": "optional",
                            "type": "string<or | and>",
                            "description": "",
                            "enum": [
                              "or",
                              "and"
                            ]
                          },
                          {
                            "name": "conditions",
                            "kind": "optional",
                            "type": "array",
                            "description": "",
                            "modelRef": "#/components/schemas/EventPropertyCondition",
                            "customType": "EventPropertyCondition[]",
                            "schema": [
                              {
                                "name": "name",
                                "kind": "required",
                                "type": "string",
                                "description": ""
                              },
                              {
                                "name": "operator",
                                "kind": "required",
                                "type": "string<equal_to | not_equal_to | greater_than | greater_than_or_equal_to | less_than | less_than_or_equal_to | contains | does_not_contain>",
                                "description": "",
                                "enum": [
                                  "equal_to",
                                  "not_equal_to",
                                  "greater_than",
                                  "greater_than_or_equal_to",
                                  "less_than",
                                  "less_than_or_equal_to",
                                  "contains",
                                  "does_not_contain"
                                ]
                              },
                              {
                                "name": "type",
                                "kind": "required",
                                "type": "string<string | number | boolean>",
                                "description": "",
                                "enum": [
                                  "string",
                                  "number",
                                  "boolean"
                                ]
                              },
                              {
                                "name": "value",
                                "kind": "required",
                                "type": "string",
                                "description": ""
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "event_type",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "field",
                    "kind": "optional",
                    "type": "string<revenue | value>",
                    "nullable": true,
                    "description": "<p>The field to aggregate for the numerator of the metric. Required when 'aggregator' = 'sum', otherwise omitted</p>",
                    "enum": [
                      "revenue",
                      "value"
                    ]
                  },
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string",
                    "description": "A unique identifier for the metric configuration."
                  },
                  {
                    "name": "metrics",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "modelRef": "#/components/schemas/SubMetric",
                    "customType": "SubMetric[]",
                    "schema": [
                      {
                        "name": "aggregator",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "display_title",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": ""
                      },
                      {
                        "name": "event_id",
                        "kind": "optional",
                        "type": "integer",
                        "description": ""
                      },
                      {
                        "name": "event_type",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "field",
                        "kind": "optional",
                        "type": "string",
                        "nullable": true,
                        "description": ""
                      },
                      {
                        "name": "role",
                        "kind": "optional",
                        "type": "string<numerator | denominator>",
                        "description": "",
                        "enum": [
                          "numerator",
                          "denominator"
                        ]
                      },
                      {
                        "name": "scope",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      }
                    ]
                  },
                  {
                    "name": "project_id",
                    "kind": "optional",
                    "type": "integer",
                    "description": "A unique identifier for the project associated with the metric."
                  },
                  {
                    "name": "scope",
                    "kind": "optional",
                    "type": "string<session | visitor | event>",
                    "description": "<p>Specifies how Events should be grouped together. Can also be thought of as the denonimator of the metric. 'session' divides by the number of sessions. \"Influenced sessions\", or sessions that do not contain a decision Event but carry a decision from a previous session are not included in counts for numerator or denominator. 'visitor' divides by the number of visitors. 'event' divides by the total occurrences (impressions) of the specified Event</p>",
                    "enum": [
                      "session",
                      "visitor",
                      "event"
                    ]
                  },
                  {
                    "name": "visibility",
                    "kind": "optional",
                    "type": "string<account | experiment | project>",
                    "description": "The visibility of the metric.",
                    "enum": [
                      "account",
                      "experiment",
                      "project"
                    ]
                  },
                  {
                    "name": "winning_direction",
                    "kind": "required",
                    "type": "string<increasing | decreasing>",
                    "description": "The winning direction of this metric",
                    "enum": [
                      "increasing",
                      "decreasing"
                    ]
                  }
                ]
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "<p>Human-readable name for the holdout displayed in the UI.</p>",
                "example": "Annual Growth Control Group",
                "maxLength": 255
              },
              {
                "name": "project_id",
                "kind": "optional",
                "type": "integer<int64>",
                "readOnly": true,
                "description": "The unique identifier of the project this holdout belongs to.",
                "example": 98765,
                "format": "int64"
              },
              {
                "name": "projects",
                "kind": "optional",
                "type": "array",
                "readOnly": true,
                "description": "<p>Project objects returned by cross-project GET endpoints.\nFor global-scope holdouts, lists target project IDs.\nEmpty array for local-scope holdouts.\nFrontend resolves project names via entity-management API.</p>",
                "example": "[{\"id\":123}]",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "Project ID.",
                    "format": "int64"
                  }
                ]
              },
              {
                "name": "revision",
                "kind": "optional",
                "type": "integer",
                "readOnly": true,
                "description": "Revision number that increments with each change to the holdout.\nUsed for tracking modifications and ensuring data consistency.\n",
                "example": 3
              },
              {
                "name": "rules",
                "kind": "optional",
                "type": "array",
                "readOnly": true,
                "description": "<p>Enriched rule objects returned by cross-project GET endpoints.\nFor local-scope holdouts, lists target rules with metadata.\nEmpty array for global-scope holdouts.</p>",
                "example": "[{\"flag_key\":\"my_flag\",\"id\":456,\"key\":\"experiment_rule_a\",\"name\":\"Experiment Rule A\",\"project_id\":123}]",
                "itemType": "object",
                "customType": "object[]",
                "schema": [
                  {
                    "name": "flag_id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "ID of the flag containing this rule.",
                    "format": "int64"
                  },
                  {
                    "name": "flag_key",
                    "kind": "optional",
                    "type": "string",
                    "description": "Key of the flag containing this rule."
                  },
                  {
                    "name": "flag_name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Name of the flag containing this rule."
                  },
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "Rule ID.",
                    "format": "int64"
                  },
                  {
                    "name": "key",
                    "kind": "optional",
                    "type": "string",
                    "description": "Rule key."
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Rule name."
                  },
                  {
                    "name": "project_id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "ID of the project this rule belongs to.",
                    "format": "int64"
                  }
                ]
              },
              {
                "name": "scope",
                "kind": "optional",
                "type": "string<global | local>",
                "description": "<p>Defines the scope of the holdout:</p>\n<ul>\n<li>'global': Affects all experiments across the entire project</li>\n<li>'local': Affects only specific experiments or flags</li>\n</ul>",
                "example": "global",
                "enum": [
                  "global",
                  "local"
                ]
              },
              {
                "name": "start_time",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "Timestamp when the holdout became or will become active.\nWhen the holdout starts affecting traffic allocation.\n",
                "example": "2024-01-01T00:00:00.000Z",
                "format": "date-time"
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string<draft | running | concluded>",
                "description": "<p>Current operational status of the holdout:</p>\n<ul>\n<li>'draft': Holdout is configured but not yet active</li>\n<li>'running': Holdout is currently active and affecting traffic</li>\n<li>'concluded': Holdout has finished and is no longer active</li>\n</ul>",
                "example": "running",
                "enum": [
                  "draft",
                  "running",
                  "concluded"
                ]
              },
              {
                "name": "traffic_allocation",
                "kind": "optional",
                "type": "integer",
                "description": "<p>Percentage of traffic allocated to this holdout, expressed in basis points (1/100th of a percent).\nFor example: 100 = 1%, 1000 = 10%, 5000 = 50%. The remaining traffic sees experiments normally.</p>",
                "example": 1000,
                "minimum": 0,
                "maximum": 10000
              },
              {
                "name": "updated_time",
                "kind": "optional",
                "type": "string<date-time>",
                "readOnly": true,
                "description": "Timestamp when the holdout was last modified.",
                "example": "2024-01-01T10:00:00.000Z",
                "format": "date-time"
              },
              {
                "name": "url",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "<p>RESTful link to fetch this holdout's details.\nFor project-scoped endpoints: /projects/{project_id}/holdouts/{holdout_id}\nFor cross-project endpoints: /holdouts/{holdout_id}</p>",
                "example": "/holdouts/12345"
              },
              {
                "name": "urn",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "<p>Universal Resource Name (URN) for the holdout, used for global identification.</p>",
                "example": "holdout.flag.optimizely.com::12345"
              }
            ],
            "modelRef": "#/components/schemas/Holdout",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "<p>Bad Request - Invalid input data or validation failure.</p>\n<p>Common causes:</p>\n<ul>\n<li>Missing <code>project_id</code> (required for cross-project creates)</li>\n<li>Global scope: <code>project_id</code> not in <code>project_ids</code></li>\n<li>Local scope: <code>project_id</code> doesn't own any of the specified <code>rule_ids</code></li>\n<li>Global holdout missing <code>project_ids</code></li>\n<li>Local holdout missing <code>rule_ids</code></li>\n<li>Global holdout with <code>rule_ids</code> (not allowed)</li>\n<li>Invalid scope value</li>\n<li>Duplicate holdout key</li>\n<li>Rule not found</li>\n<li><code>audience_conditions</code> set on a holdout whose targeted rules span more than one project</li>\n</ul>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p><a href=\"https://tools.ietf.org/html/rfc7807#section-3.1\" target=\"_blank\">https://tools.ietf.org/html/rfc7807#section-3.1</a></p>",
            "customType": "ProblemDetail",
            "schema": [
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": "<p>A human-readable explanation specific to this occurrence of the problem.</p>"
              },
              {
                "name": "status",
                "kind": "required",
                "type": "integer",
                "description": "<p>The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.</p>"
              },
              {
                "name": "title",
                "kind": "required",
                "type": "string",
                "description": "<p>A short, human-readable summary of the problem type.</p>"
              },
              {
                "name": "type",
                "kind": "required",
                "type": "string",
                "description": "<p>A URI reference [RFC3986] that identifies the problem type. Contains 'about</p><div></div>' if unspecified.<p></p>"
              },
              {
                "name": "uuid",
                "kind": "optional",
                "type": "string",
                "description": "Error reference for customer support"
              }
            ],
            "modelRef": "#/components/schemas/ProblemDetail",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Invalid credentials",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Do not have permission to perform the operation",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "JeGp_CH6BUGzXL4Wy_Kv4",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.optimizely.com/flags/v1//holdouts \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"key\": \"annual_growth_holdout\",\n     \"metrics\": [\n     {\n     \"aggregator\": \"\",\n     \"event_properties\": {\n     \"filter\": {\n     \"conditions\": [\n     {\n     \"name\": \"\",\n     \"operator\": \"\",\n     \"type\": \"\",\n     \"value\": \"\"\n     }\n     ]\n     }\n     },\n     \"winning_direction\": \"\"\n     }\n     ],\n     \"name\": \"Annual Growth Control Group\",\n     \"scope\": \"global\"\n     }'"
        },
        {
          "id": "fQ_AIelAa1yJEHPqC8EKZ",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"key\": \"annual_growth_holdout\",\n   \"metrics\": [\n      {\n         \"aggregator\": \"\",\n         \"event_properties\": {\n            \"filter\": {\n               \"conditions\": [\n                  {\n                     \"name\": \"\",\n                     \"operator\": \"\",\n                     \"type\": \"\",\n                     \"value\": \"\"\n                  }\n               ]\n            }\n         },\n         \"winning_direction\": \"\"\n      }\n   ],\n   \"name\": \"Annual Growth Control Group\",\n   \"scope\": \"global\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.optimizely.com/flags/v1//holdouts\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "TS9Jg6_NgzGizYTf73_i_",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.optimizely.com/flags/v1//holdouts\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"key\": \"annual_growth_holdout\",\n   \"metrics\": [\n      {\n         \"aggregator\": \"\",\n         \"event_properties\": {\n            \"filter\": {\n               \"conditions\": [\n                  {\n                     \"name\": \"\",\n                     \"operator\": \"\",\n                     \"type\": \"\",\n                     \"value\": \"\"\n                  }\n               ]\n            }\n         },\n         \"winning_direction\": \"\"\n      }\n   ],\n   \"name\": \"Annual Growth Control Group\",\n   \"scope\": \"global\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "WDfWGmaP9hOSiIgNpZZFW",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.optimizely.com/flags/v1//holdouts\"\n\npayload = json.dumps({\n   \"key\": \"annual_growth_holdout\",\n   \"metrics\": [\n      {\n         \"aggregator\": \"\",\n         \"event_properties\": {\n            \"filter\": {\n               \"conditions\": [\n                  {\n                     \"name\": \"\",\n                     \"operator\": \"\",\n                     \"type\": \"\",\n                     \"value\": \"\"\n                  }\n               ]\n            }\n         },\n         \"winning_direction\": \"\"\n      }\n   ],\n   \"name\": \"Annual Growth Control Group\",\n   \"scope\": \"global\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "JeGp_CH6BUGzXL4Wy_Kv4"
    },
    "results": {
      "languages": [
        {
          "id": "zNV-BrAgTGsKAG5AB-tX1",
          "language": "201",
          "code": "// Successful retrieval, creation or update of a Holdout.\nThe response includes RESTful JSON (https://restfuljson.org/) styled links. If a\nlink is not present in the response, it indicates a user is not authorized to access\nthe related resource.\n{\n  \"archived\": false,\n  \"audience_conditions\": [\n    {}\n  ],\n  \"audience_ids\": [\n    0\n  ],\n  \"created_by_user_email\": \"user@company.com\",\n  \"created_time\": \"2023-12-15T10:00:00.000Z\",\n  \"description\": \"Holdout group to measure the overall impact of our growth experiments throughout the year\",\n  \"end_time\": \"2024-12-31T23:59:59.000Z\",\n  \"environment_key\": \"production\",\n  \"environment_name\": \"Production\",\n  \"exclude_targeted_deliveries\": false,\n  \"holdout_results_api_token\": \"SampleToken.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\",\n  \"id\": 12345,\n  \"key\": \"annual_growth_holdout\",\n  \"metrics\": [\n    {\n      \"aggregator\": \"\",\n      \"display_title\": \"\",\n      \"display_unit\": \"\",\n      \"event_id\": 32334454244,\n      \"event_properties\": {\n        \"filter\": {\n          \"combine_operator\": \"\",\n          \"conditions\": [\n            {\n              \"name\": \"\",\n              \"operator\": \"\",\n              \"type\": \"\",\n              \"value\": \"\"\n            }\n          ]\n        }\n      },\n      \"event_type\": \"\",\n      \"field\": \"\",\n      \"id\": \"\",\n      \"metrics\": [\n        {\n          \"aggregator\": \"\",\n          \"display_title\": \"\",\n          \"event_id\": 0,\n          \"event_type\": \"\",\n          \"field\": \"\",\n          \"role\": \"\",\n          \"scope\": \"\"\n        }\n      ],\n      \"project_id\": 0,\n      \"scope\": \"\",\n      \"visibility\": \"\",\n      \"winning_direction\": \"\"\n    }\n  ],\n  \"name\": \"Annual Growth Control Group\",\n  \"project_id\": 98765,\n  \"projects\": [\n    {\n      \"id\": \"\"\n    }\n  ],\n  \"revision\": 3,\n  \"rules\": [\n    {\n      \"flag_id\": \"\",\n      \"flag_key\": \"\",\n      \"flag_name\": \"\",\n      \"id\": \"\",\n      \"key\": \"\",\n      \"name\": \"\",\n      \"project_id\": \"\"\n    }\n  ],\n  \"scope\": \"global\",\n  \"start_time\": \"2024-01-01T00:00:00.000Z\",\n  \"status\": \"running\",\n  \"traffic_allocation\": 1000,\n  \"updated_time\": \"2024-01-01T10:00:00.000Z\",\n  \"url\": \"/holdouts/12345\",\n  \"urn\": \"holdout.flag.optimizely.com::12345\"\n}"
        },
        {
          "id": "8Echt_Aw_QT4Fdf8deQD7",
          "language": "400",
          "code": "// Bad Request - Invalid input data or validation failure.\nCommon causes:\n\nMissing project_id (required for cross-project creates)\nGlobal scope: project_id not in project_ids\nLocal scope: project_id doesn't own any of the specified rule_ids\nGlobal holdout missing project_ids\nLocal holdout missing rule_ids\nGlobal holdout with rule_ids (not allowed)\nInvalid scope value\nDuplicate holdout key\nRule not found\naudience_conditions set on a holdout whose targeted rules span more than one project\n{\n  \"detail\": \"\",\n  \"status\": 0,\n  \"title\": \"\",\n  \"type\": \"\",\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "0PuBC1alE6OLFOndthjWK",
          "language": "401",
          "code": "// Invalid credentials\n"
        },
        {
          "id": "urcSrqzryCbZhfdTszuPY",
          "language": "403",
          "code": "// Do not have permission to perform the operation\n"
        }
      ],
      "selectedLanguageId": "zNV-BrAgTGsKAG5AB-tX1"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}