---
type: api
title: Delete ES|QL datasets
description: Deletes one or more datasets used in ES|QL data federation.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-esql-delete-dataset
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-esql-delete-dataset
products:
  - Elasticsearch
---

# Delete ES|QL datasets

Availability: 9.5+

## Paths

- `DELETE` `/_query/dataset/{name}`

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

#### Path Parameters

- `name` (union Name | [] Name)
  A comma-separated list of dataset names to delete.

## Description

Deletes one or more datasets used in ES|QL data federation.
If any specified dataset does not exist, the request fails and no datasets are deleted.

## Required authorization

* Index privileges: `manage`

[ES|QL Data Federation](https://www.elastic.co/docs/reference/query-languages/esql/esql-data-federation)

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  Period to wait for a connection to the master node.
- `timeout` (string Duration · default: 30s)
  The time to wait for the request to be completed.

## 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 /_query/dataset/access_logs
```

#### JavaScript

```javascript
const response = await client.esql.deleteDataset({
  name: "access_logs",
});
```

#### Python

```python
resp = client.esql.delete_dataset(
    name="access_logs",
)
```

#### curl

```curl
curl -X DELETE "$ELASTICSEARCH_URL/_query/dataset/access_logs" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.esql().deleteDataset(d -> d
    .name("access_logs")
);
```

#### PHP

```php
$resp = $client->esql()->deleteDataset([
    "name" => "access_logs",
]);
```

#### Ruby

```ruby
response = client.esql.delete_dataset(
  name: "access_logs"
)
```

## Response Examples

#### Dataset deleted

The dataset definition was deleted successfully.

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

