---
type: api
title: Update Watcher index settings
description: Update settings for the Watcher internal index (`.watches`).
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-watcher-update-settings
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-watcher-update-settings
products:
  - Elasticsearch
---

# Update Watcher index settings

Availability:

## Paths

- `PUT` `/_watcher/settings`

- [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)

## Description

Update settings for the Watcher internal index (`.watches`).
Only a subset of settings can be modified.
This includes `index.auto_expand_replicas`, `index.number_of_replicas`, `index.routing.allocation.exclude.*`,
`index.routing.allocation.include.*` and `index.routing.allocation.require.*`.
Modification of `index.routing.allocation.include._tier_preference` is an exception and is not allowed as the
Watcher shards must always be in the `data_content` tier.

## Required authorization

* Cluster privileges: `manage_watcher`

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  The 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)
  The 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`

- `index.auto_expand_replicas` (string) — optional
- `index.number_of_replicas` (number) — optional

## Response

`application/json`

- `acknowledged` (boolean)
## Code Examples

#### Console

```console
PUT /_watcher/settings
{
  "index.auto_expand_replicas": "0-4"
}
```

#### JavaScript

```javascript
const response = await client.watcher.updateSettings({
  "index.auto_expand_replicas": "0-4",
});
```

#### Python

```python
resp = client.watcher.update_settings(
    index_auto_expand_replicas="0-4",
)
```

#### curl

```curl
curl -X PUT "$ELASTICSEARCH_URL/_watcher/settings" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "index.auto_expand_replicas": "0-4"
  }'
```

#### Java

```java
client.watcher().updateSettings(u -> u
    .indexAutoExpandReplicas("0-4")
);
```

#### PHP

```php
$resp = $client->watcher()->updateSettings([
    "body" => [
        "index.auto_expand_replicas" => "0-4",
    ],
]);
```

#### Ruby

```ruby
response = client.watcher.update_settings(
  body: {
    "index.auto_expand_replicas": "0-4"
  }
)
```

