---
type: api
title: Deactivate a watch
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-watcher-deactivate-watch
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-watcher-deactivate-watch
products:
  - Elasticsearch
---

# Deactivate a watch


Availability:

## Paths

- `POST` (also `PUT`) `/_watcher/watch/{watch_id}/_deactivate`

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

- `watch_id` (string Name)
  The watch identifier.

## Description

A watch can be either active or inactive.

## Required authorization

* Cluster privileges: `manage_watcher`

[More about how Watcher works](https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher/how-watcher-works)

## Response

`application/json`

- `status` ({} ActivationStatus)
  - `actions` (Actions)
  - `state` ({} ActivationState)
    - `active` (boolean)
    - `timestamp` (DateTime)
  - `version` (number VersionNumber)
## Code Examples

#### Console

```console
POST _watcher/watch/my_watch/_deactivate
```

#### JavaScript

```javascript
const response = await client.watcher.deactivateWatch({
  watch_id: "my_watch",
});
```

#### Python

```python
resp = client.watcher.deactivate_watch(
    watch_id="my_watch",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_watcher/watch/my_watch/_deactivate" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.watcher().deactivateWatch(d -> d
    .watchId("my_watch")
);
```

#### PHP

```php
$resp = $client->watcher()->deactivateWatch([
    "watch_id" => "my_watch",
]);
```

#### Ruby

```ruby
response = client.watcher.deactivate_watch(
  watch_id: "my_watch"
)
```

