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

# Delete ES|QL data sources

Availability:

## Paths

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

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

#### Path Parameters

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

## Description

Deletes one or more data sources used in ES|QL data federation.
Fails with `409` if any dataset references one of the named data sources;
delete the dependent datasets first.

## Required authorization

* Cluster 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/data_source/prod_s3_logs
```

#### JavaScript

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

#### Python

```python
resp = client.esql.delete_data_source(
    name="prod_s3_logs",
)
```

#### curl

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

#### Java

```java
client.esql().deleteDataSource(d -> d
    .name("prod_s3_logs")
);
```

#### C#

```c#
var response = await client.Esql.DeleteDataSourceAsync(name: new[] { "prod_s3_logs" });
```

#### PHP

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

#### Ruby

```ruby
response = client.esql.delete_data_source(
  name: "prod_s3_logs"
)
```

## Response Examples

#### Data source deleted

The data source configuration was deleted successfully.

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

