---
title: "Delete experiment"
method: DELETE
path: "/api/v2/experiments/{experiment_id}"
tags: ["Experiments"]
---

# Delete experiment

`DELETE /api/v2/experiments/{experiment_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/experiments/{experiment_id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `product_analytics_experiments_write`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/experiments/:experiment_id/delete.ts> (a function with typed inputs; its response is checked against the schema)

Delete an experiment and its linked feature flag allocations in one database transaction. After deletion, the experiment is no longer returned by the API. If the transaction fails, neither the experiment nor its allocations are deleted. Deleting an experiment cannot be undone.

## Path parameters

- `experiment_id` string, uuid, required: The UUID of the experiment.

## Response `204`

The experiment was deleted.

## Other responses

- `400`: Malformed experiment ID (not a valid UUID).
- `401`: Missing or invalid authentication (dd-api-key + dd-application-key headers, or a valid user session).
- `403`: Authenticated caller lacks the product_analytics_experiments_write permission, lacks permission to edit this experiment, or lacks contribute permission on a feature flag owning one of its allocations.
- `404`: No experiment with this ID exists for the organization.
- `409`: The experiment has a published allocation on an archived flag, must be retained for selective holdout analysis, or its linked allocations changed during authorization. Nothing was deleted.
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
