---
type: api
title: Delete a data frame analytics job
description: ## Required authorization
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-ml-delete-data-frame-analytics
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-ml-delete-data-frame-analytics
products:
  - Elasticsearch
---

# Delete a data frame analytics job

Availability: Generally available since 7.3

## Paths

- `DELETE` `/_ml/data_frame/analytics/{id}`

#### Path parameters

- `id` (string) — required
  Identifier for the data frame analytics job.

## Required authorization

- Cluster privileges: `manage_ml`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Query string parameters

- `force` (boolean · default: false) — optional
  If `true`, it deletes a job that is not stopped; this method is quicker than stopping and deleting the job.
- `timeout` (string · default: 1m) — optional
  The time to wait for the job to be deleted.

## 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/data_frame/analytics/loganalytics
```

#### JavaScript

```javascript
const response = await client.ml.deleteDataFrameAnalytics({
  id: "loganalytics",
});
```

#### Python

```python
resp = client.ml.delete_data_frame_analytics(
    id="loganalytics",
)
```

#### curl

```curl
curl -X DELETE "$ELASTICSEARCH_URL/_ml/data_frame/analytics/loganalytics" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.ml().deleteDataFrameAnalytics(d -> d
    .id("loganalytics")
);
```

#### C#

```c#
var response = await client.MachineLearning.DeleteDataFrameAnalyticsAsync(id: "loganalytics");
```

#### PHP

```php
$resp = $client->ml()->deleteDataFrameAnalytics([
    "id" => "loganalytics",
]);
```

#### Ruby

```ruby
response = client.ml.delete_data_frame_analytics(
  id: "loganalytics"
)
```

## Response examples

#### Ml delete data frame analytics response example1

A successful response when deleting a data frame analytics job.

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

