---
type: api
title: Delete a watch
description: When the watch is removed, the document representing the watch in the `.watches` index is gone and it will never be run again.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-watcher-delete-watch
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-watcher-delete-watch
products:
  - Elasticsearch
---

# Delete a watch

Availability:

## Paths

- `DELETE` `/_watcher/watch/{id}`

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

#### Path Parameters

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

## Description

When the watch is removed, the document representing the watch in the `.watches` index is gone and it will never be run again.

Deleting a watch does not delete any watch execution records related to this watch from the watch history.

IMPORTANT: Deleting a watch must be done by using only this API.
Do not delete the watch directly from the `.watches` index using the Elasticsearch delete document API
When Elasticsearch security features are enabled, make sure no write privileges are granted to anyone for the `.watches` index.

## Required authorization

* Cluster privileges: `manage_watcher`

## Response

`application/json`

- `found` (boolean)
- `_id` (string Id)
- `_version` (number VersionNumber)
## Code Examples

#### Console

```console
DELETE _watcher/watch/my_watch
```

#### JavaScript

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

#### Python

```python
resp = client.watcher.delete_watch(
    id="my_watch",
)
```

#### curl

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

#### Java

```java
client.watcher().deleteWatch(d -> d
    .id("my_watch")
);
```

#### PHP

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

#### Ruby

```ruby
response = client.watcher.delete_watch(
  id: "my_watch"
)
```

## Response Examples

#### Delete watch response example1

A successful response from `DELETE _watcher/watch/my_watch`.

```json
{
  "found": true,
  "_id": "my_watch",
  "_version": 2
}
```

