---
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/4493/api/doc/elasticsearch-serverless/operation/operation-esql-delete-dataset
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch-serverless/operation/operation-esql-delete-dataset
products:
  - Elasticsearch Serverless
---

# Delete ES|QL datasets

Availability: Experimental

## Paths

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

#### Path parameters

- `name` (union string | string[]) — required
  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.

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

## Required authorization

- Index privileges: `manage`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs use 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}"
  ```
  
  For more information about where to find API keys for the Elasticsearch endpoint (${ES_URL}) for a project, go to [Get started with Elasticsearch Serverless](https://www.elastic.co/docs/solutions/search/serverless-elasticsearch-get-started).

## Query string parameters

- `master_timeout` (string · default: 30s) — optional
  Period to wait for a connection to the master node.
- `timeout` (string · default: 30s) — optional
  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
}
```

