---
type: api
title: Delete a datafeed
description: ## Required authorization
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-delete-datafeed
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-ml-delete-datafeed
products:
  - Elasticsearch
---

# Delete a datafeed

Availability: 5.4+

## Paths

- `DELETE` `/_ml/datafeeds/{datafeed_id}`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#bearerauth)

#### Path Parameters

- `datafeed_id` (string Id)
  A numerical character string that uniquely identifies the datafeed. This
identifier can contain lowercase alphanumeric characters (a-z and 0-9),
hyphens, and underscores. It must start and end with alphanumeric
characters.

## Description



## Required authorization

* Cluster privileges: `manage_ml`

## Query String Parameters

- `force` (boolean)
  Use to forcefully delete a started datafeed; this method is quicker than
stopping and deleting the datafeed.

## Response

`application/json`

- `acknowledged` (boolean)
  For a successful response, this value is always true. On failure, an exception is returned instead.
## Code Examples

#### Console

```console
DELETE _ml/datafeeds/datafeed-total-requests
```

#### JavaScript

```javascript
const response = await client.ml.deleteDatafeed({
  datafeed_id: "datafeed-total-requests",
});
```

#### Python

```python
resp = client.ml.delete_datafeed(
    datafeed_id="datafeed-total-requests",
)
```

#### curl

```curl
curl -X DELETE "$ELASTICSEARCH_URL/_ml/datafeeds/datafeed-total-requests" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.ml().deleteDatafeed(d -> d
    .datafeedId("datafeed-total-requests")
);
```

#### C#

```c#
var response = await client.MachineLearning.DeleteDatafeedAsync(datafeedId: "datafeed-total-requests");
```

#### PHP

```php
$resp = $client->ml()->deleteDatafeed([
    "datafeed_id" => "datafeed-total-requests",
]);
```

#### Ruby

```ruby
response = client.ml.delete_datafeed(
  datafeed_id: "datafeed-total-requests"
)
```

## Response Examples

#### Ml delete datafeed response example1

A successful response when deleting a datafeed.

```json
{
  "acknowledged": true
}
```

