---
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/4493/api/doc/elasticsearch/v8/operation/operation-watcher-delete-watch
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v8/operation/operation-watcher-delete-watch
products:
  - Elasticsearch
---

# Delete a watch

## Paths

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

#### Path parameters

- `id` (string) — required
  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`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/guide/en/elasticsearch/reference/current/token-authentication-services.html)

## Response

`application/json`

- `found` (boolean)
- `_id` (string)
- `_version` (number)
## 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
}
```

