---
type: api
title: Update data stream options
description: Update the data stream options of the specified data streams.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-indices-put-data-stream-options
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-indices-put-data-stream-options
products:
  - Elasticsearch
---

# Update data stream options

Availability: 8.19+

## Paths

- `PUT` `/_data_stream/{name}/_options`

- [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 DataStreamName | [] DataStreamName)
  Comma-separated list of data streams used to limit the request.
Supports wildcards (`*`).
To target all data streams use `*` or `_all`.

## Description

Update the data stream options of the specified data streams.

## Query String Parameters

- `expand_wildcards` (string ExpandWildcards · default: open)
  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`
- `master_timeout` (string Duration · default: 30s)
  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.
- `timeout` (string Duration · default: 30s)
  Period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.

## Request Body

`application/json`

- `failure_store` ({} DataStreamFailureStore) — optional
  If defined, it will update the failure store configuration of every data stream resolved by the name expression.
  - `enabled` (boolean · default: true) — optional
    If defined, it turns the failure store on/off (`true`/`false`) for this data stream. A data stream failure store
that's disabled (enabled: `false`) will redirect no new failed indices to the failure store; however, it will
not remove any existing data from the failure store.
  - `lifecycle` ({} FailureStoreLifecycle) — optional
    If defined, it specifies the lifecycle configuration for the failure store of this data stream.
    - `data_retention` (string Duration) — optional
      If defined, every document added to this data stream will be stored at least for this time frame.
Any time after this duration the document could be deleted.
When empty, every document in this data stream will be stored indefinitely.
    - `enabled` (boolean · default: true) — optional
      If defined, it turns data stream lifecycle on/off (`true`/`false`) for this data stream. A data stream lifecycle
that's disabled (enabled: `false`) will have no effect on the data stream.

## 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
PUT /_data_stream/{name}/_options
```

#### curl

```curl
curl -X PUT "/_data_stream/{name}/_options"
```

