---
title: Delete a Holdout
slug: feature-experimentation/api/delete-a-holdout
docTags: 
createdAt: 2026-08-28T15:54:06.731Z
---

{
  "id": "ofY90vAWC4Vy_O9_epbfA",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id}",
    "servers": [
      {
        "url": "https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id}"
      }
    ],
    "name": "Delete a Holdout",
    "description": "<p>Permanently and irreversibly delete a holdout by its unique ID. This is a destructive operation that cannot be undone.</p>\n<p><strong>⚠️ CAUTION - Permanent Deletion:</strong></p>\n<ul>\n<li>All holdout configuration data will be permanently lost</li>\n<li>Associated metric data will be deleted</li>\n<li>Experiment rules and historical data will be removed</li>\n<li>There is <strong>no way to recover</strong> this data after deletion</li>\n</ul>\n<p><strong>What gets deleted:</strong></p>\n<ul>\n<li>Holdout configuration (traffic allocation, audience conditions, etc.)</li>\n<li>All associated experiment rules and their settings</li>\n<li>Metric tracking data and historical performance</li>\n<li>System metadata and lifecycle timestamps</li>\n</ul>\n<p><strong>Safer Alternative - Archiving:</strong>\nIf you want to stop a holdout without permanent data loss, consider archiving instead:</p>\n<ol>\n<li>Update the holdout status to <code>concluded</code> (if currently running)</li>\n<li>Use the PATCH endpoint to set <code>archived: true</code></li>\n</ol>\n<p>Archived holdouts preserve all historical data while removing them from active lists and preventing further modifications.</p>\n<p><strong>When to use DELETE vs ARCHIVE:</strong></p>\n<ul>\n<li><strong>DELETE</strong>: Use only when you're certain the holdout and all its data should be permanently removed</li>\n<li><strong>ARCHIVE</strong>: Recommended for most cases - preserves data for analysis while cleaning up active experiments</li>\n</ul>\n<p><strong>Important Notes:</strong></p>\n<ul>\n<li>Can delete holdouts in any status (draft, running, concluded)</li>\n<li>Operation affects both database and metrics systems</li>\n<li>This corresponds to the <code>delete_url</code> link in holdout responses</li>\n</ul>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "project_id",
          "type": "integer",
          "example": 12345,
          "description": "The project identifier"
        },
        {
          "kind": "required",
          "name": "holdout_id",
          "type": "integer",
          "example": 54321,
          "description": "The holdout identifier"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "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": "204",
        "description": "<p>Successfully deleted the holdout. No response body is returned.</p>\n<p><strong>Deletion completed:</strong></p>\n<ul>\n<li>Holdout configuration permanently removed from database</li>\n<li>Associated metrics deleted</li>\n<li>All experiment rules and historical data destroyed</li>\n<li>Holdout is no longer accessible via any API endpoints</li>\n</ul>\n<p><strong>What happens after deletion:</strong></p>\n<ul>\n<li>GET requests to this holdout will return 404 Not Found</li>\n<li>The holdout will not appear in list responses</li>\n<li>Associated URLs (update_url, fetch_url, etc.) become invalid</li>\n<li>Any references to this holdout in other systems should be cleaned up</li>\n</ul>\n<p>A successful 204 response confirms the holdout has been completely removed from all systems.</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "<p>Bad Request - Invalid request parameters or malformed holdout ID.</p>\n<p><strong>Common causes:</strong></p>\n<ul>\n<li>Invalid <code>holdout_id</code> format (must be a positive integer)</li>\n<li>Invalid <code>project_id</code> format (must be a positive integer)</li>\n<li>Malformed request structure</li>\n</ul>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"detail\":\"Holdout ID must be a positive integer\",\"status\":400,\"title\":\"Invalid holdout ID\",\"type\":\"about:blank\"}",
            "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": "<p>Forbidden - You don't have permission to delete holdouts in this project.</p>\n<p><strong>Permission requirements:</strong></p>\n<ul>\n<li>Must have project-level access</li>\n<li>Must have holdout deletion permissions</li>\n<li>Holdouts feature must be enabled for this project</li>\n</ul>\n<p><strong>Common causes:</strong></p>\n<ul>\n<li>Insufficient user permissions for destructive operations</li>\n<li>Project-level permissions don't include holdout management</li>\n<li>Organization-level policies restrict holdout deletion</li>\n<li>Holdouts feature flag is disabled for this project</li>\n</ul>",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// Forbidden - You don't have permission to delete holdouts in this project.\nPermission requirements:\n\nMust have project-level access\nMust have holdout deletion permissions\nHoldouts feature must be enabled for this project\n\nCommon causes:\n\nInsufficient user permissions for destructive operations\nProject-level permissions don't include holdout management\nOrganization-level policies restrict holdout deletion\nHoldouts feature flag is disabled for this project\n{\n  \"detail\": \"\",\n  \"status\": 0,\n  \"title\": \"\",\n  \"type\": \"\",\n  \"uuid\": \"\"\n}"
          },
          {
            "label": "feature_disabled",
            "code": "// Holdouts feature disabled\n{\n  \"detail\": \"Holdouts feature is not enabled for this project\",\n  \"status\": 403,\n  \"title\": \"Feature not enabled\",\n  \"type\": \"about:blank\"\n}"
          },
          {
            "label": "insufficient_permissions",
            "code": "// Insufficient permissions\n{\n  \"detail\": \"Permission denied - insufficient privileges to delete holdouts\",\n  \"status\": 403,\n  \"title\": \"Forbidden\",\n  \"type\": \"about:blank\"\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"detail\":\"Holdouts feature is not enabled for this project\",\"status\":403,\"title\":\"Feature not enabled\",\"type\":\"about:blank\"}",
            "examples": [
              {
                "label": "Holdouts feature disabled",
                "value": "{\"detail\":\"Holdouts feature is not enabled for this project\",\"status\":403,\"title\":\"Feature not enabled\",\"type\":\"about:blank\"}"
              },
              {
                "label": "Insufficient permissions",
                "value": "{\"detail\":\"Permission denied - insufficient privileges to delete holdouts\",\"status\":403,\"title\":\"Forbidden\",\"type\":\"about:blank\"}"
              }
            ],
            "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": "404",
        "description": "<p>Not Found - The specified holdout does not exist or has already been deleted.</p>\n<p><strong>Possible reasons:</strong></p>\n<ul>\n<li>Holdout ID does not exist in the specified project</li>\n<li>Project ID does not exist or you don't have access to it</li>\n<li>Holdout was already deleted by another user/process</li>\n<li>Insufficient permissions to view or delete this holdout</li>\n</ul>\n<p><strong>Note</strong>: This is also returned if the holdout exists but you lack delete permissions,\nfor security reasons (to prevent ID enumeration attacks).</p>",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// Not Found - The specified holdout does not exist or has already been deleted.\nPossible reasons:\n\nHoldout ID does not exist in the specified project\nProject ID does not exist or you don't have access to it\nHoldout was already deleted by another user/process\nInsufficient permissions to view or delete this holdout\n\nNote: This is also returned if the holdout exists but you lack delete permissions,\nfor security reasons (to prevent ID enumeration attacks).\n{\n  \"detail\": \"\",\n  \"status\": 0,\n  \"title\": \"\",\n  \"type\": \"\",\n  \"uuid\": \"\"\n}"
          },
          {
            "label": "holdout_not_found",
            "code": "// Holdout does not exist\n{\n  \"detail\": \"Holdout not found with id '987'\",\n  \"status\": 404,\n  \"title\": \"Holdout not found\",\n  \"type\": \"about:blank\"\n}"
          },
          {
            "label": "project_not_found",
            "code": "// Project does not exist\n{\n  \"detail\": \"Project not found with id '12345'\",\n  \"status\": 404,\n  \"title\": \"Project not found\",\n  \"type\": \"about:blank\"\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"detail\":\"Holdout not found with id '987'\",\"status\":404,\"title\":\"Holdout not found\",\"type\":\"about:blank\"}",
            "examples": [
              {
                "label": "Holdout does not exist",
                "value": "{\"detail\":\"Holdout not found with id '987'\",\"status\":404,\"title\":\"Holdout not found\",\"type\":\"about:blank\"}"
              },
              {
                "label": "Project does not exist",
                "value": "{\"detail\":\"Project not found with id '12345'\",\"status\":404,\"title\":\"Project not found\",\"type\":\"about:blank\"}"
              }
            ],
            "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
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "JMhddTNxw9aaCpRFjwvgH",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "9t4i5V1cC2hSSRqOehEFT",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "dJwTjt68HtbUCJFKw_CA7",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "lHbK8CxZCg2rOGJk9VUQ1",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.optimizely.com/flags/v1//projects/{project_id}/holdouts/{holdout_id}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "JMhddTNxw9aaCpRFjwvgH"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-204",
          "language": "204",
          "code": "// Successfully deleted the holdout. No response body is returned.\nDeletion completed:\n\nHoldout configuration permanently removed from database\nAssociated metrics deleted\nAll experiment rules and historical data destroyed\nHoldout is no longer accessible via any API endpoints\n\nWhat happens after deletion:\n\nGET requests to this holdout will return 404 Not Found\nThe holdout will not appear in list responses\nAssociated URLs (update_url, fetch_url, etc.) become invalid\nAny references to this holdout in other systems should be cleaned up\n\nA successful 204 response confirms the holdout has been completely removed from all systems.\n"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad Request - Invalid request parameters or malformed holdout ID.\nCommon causes:\n\nInvalid holdout_id format (must be a positive integer)\nInvalid project_id format (must be a positive integer)\nMalformed request structure\n{\n  \"detail\": \"\",\n  \"status\": 0,\n  \"title\": \"\",\n  \"type\": \"\",\n  \"uuid\": \"\"\n}"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Invalid credentials\n"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// Forbidden - You don't have permission to delete holdouts in this project.\nPermission requirements:\n\nMust have project-level access\nMust have holdout deletion permissions\nHoldouts feature must be enabled for this project\n\nCommon causes:\n\nInsufficient user permissions for destructive operations\nProject-level permissions don't include holdout management\nOrganization-level policies restrict holdout deletion\nHoldouts feature flag is disabled for this project\n{\n  \"detail\": \"\",\n  \"status\": 0,\n  \"title\": \"\",\n  \"type\": \"\",\n  \"uuid\": \"\"\n}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// Forbidden - You don't have permission to delete holdouts in this project.\nPermission requirements:\n\nMust have project-level access\nMust have holdout deletion permissions\nHoldouts feature must be enabled for this project\n\nCommon causes:\n\nInsufficient user permissions for destructive operations\nProject-level permissions don't include holdout management\nOrganization-level policies restrict holdout deletion\nHoldouts feature flag is disabled for this project\n{\n  \"detail\": \"\",\n  \"status\": 0,\n  \"title\": \"\",\n  \"type\": \"\",\n  \"uuid\": \"\"\n}"
            },
            {
              "label": "feature_disabled",
              "code": "// Holdouts feature disabled\n{\n  \"detail\": \"Holdouts feature is not enabled for this project\",\n  \"status\": 403,\n  \"title\": \"Feature not enabled\",\n  \"type\": \"about:blank\"\n}"
            },
            {
              "label": "insufficient_permissions",
              "code": "// Insufficient permissions\n{\n  \"detail\": \"Permission denied - insufficient privileges to delete holdouts\",\n  \"status\": 403,\n  \"title\": \"Forbidden\",\n  \"type\": \"about:blank\"\n}"
            }
          ]
        },
        {
          "id": "response-4-404",
          "language": "404",
          "code": "// Not Found - The specified holdout does not exist or has already been deleted.\nPossible reasons:\n\nHoldout ID does not exist in the specified project\nProject ID does not exist or you don't have access to it\nHoldout was already deleted by another user/process\nInsufficient permissions to view or delete this holdout\n\nNote: This is also returned if the holdout exists but you lack delete permissions,\nfor security reasons (to prevent ID enumeration attacks).\n{\n  \"detail\": \"\",\n  \"status\": 0,\n  \"title\": \"\",\n  \"type\": \"\",\n  \"uuid\": \"\"\n}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// Not Found - The specified holdout does not exist or has already been deleted.\nPossible reasons:\n\nHoldout ID does not exist in the specified project\nProject ID does not exist or you don't have access to it\nHoldout was already deleted by another user/process\nInsufficient permissions to view or delete this holdout\n\nNote: This is also returned if the holdout exists but you lack delete permissions,\nfor security reasons (to prevent ID enumeration attacks).\n{\n  \"detail\": \"\",\n  \"status\": 0,\n  \"title\": \"\",\n  \"type\": \"\",\n  \"uuid\": \"\"\n}"
            },
            {
              "label": "holdout_not_found",
              "code": "// Holdout does not exist\n{\n  \"detail\": \"Holdout not found with id '987'\",\n  \"status\": 404,\n  \"title\": \"Holdout not found\",\n  \"type\": \"about:blank\"\n}"
            },
            {
              "label": "project_not_found",
              "code": "// Project does not exist\n{\n  \"detail\": \"Project not found with id '12345'\",\n  \"status\": 404,\n  \"title\": \"Project not found\",\n  \"type\": \"about:blank\"\n}"
            }
          ]
        }
      ],
      "selectedLanguageId": "response-0-204"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}