---
type: api
title: Delete data streams
description: Deletes one or more data streams and their backing indices.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/elasticsearch/v9/operation/operation-indices-delete-data-stream
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/elasticsearch/v9/operation/operation-indices-delete-data-stream
products:
  - Elasticsearch
---

# Delete data streams

Authentication: required

Availability: Generally available since 7.9

## Paths

- `DELETE` `/_data_stream/{name}`

#### Path parameters

- `name` (union string | string[]) — required
  Comma-separated list of data streams to delete. Wildcard (`*`) expressions are supported.

## Description

Deletes one or more data streams and their backing indices.

## Required authorization

- Index privileges: `delete_index`

## Query string parameters

- `master_timeout` (string · default: 30s) — optional
  Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
- `expand_wildcards` (union oneOf · default: open) — optional
  Type of data stream that wildcard patterns can match. Supports comma-separated values,such as `open,hidden`.

Supported values include:
  - `all`: Match any data stream or index, including hidden ones.
  - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.
  - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
  - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.
  - `none`: Wildcard expressions are not accepted.
  Values: `all`, `open`, `closed`, `hidden`, `none`

## 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 _data_stream/my-data-stream
```

#### JavaScript

```javascript
const response = await client.indices.deleteDataStream({
  name: "my-data-stream",
});
```

#### Python

```python
resp = client.indices.delete_data_stream(
    name="my-data-stream",
)
```

#### curl

```curl
curl -X DELETE "$ELASTICSEARCH_URL/_data_stream/my-data-stream" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.indices().deleteDataStream(d -> d
    .name("my-data-stream")
);
```

#### C#

```c#
var response = await client.Indices.DeleteDataStreamAsync(name: new[] { "my-data-stream" });
```

#### PHP

```php
$resp = $client->indices()->deleteDataStream([
    "name" => "my-data-stream",
]);
```

#### Ruby

```ruby
response = client.indices.delete_data_stream(
  name: "my-data-stream"
)
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "acknowledged": false
}
```

