Delete a watch
Generally available
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
Path parameters
-
id
string Required The watch identifier.
DELETE
/_watcher/watch/{id}
Console
DELETE _watcher/watch/my_watch
resp = client.watcher.delete_watch(
id="my_watch",
)
const response = await client.watcher.deleteWatch({
id: "my_watch",
});
response = client.watcher.delete_watch(
id: "my_watch"
)
$resp = $client->watcher()->deleteWatch([
"id" => "my_watch",
]);
curl -X DELETE -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch"
Response examples (200)
A successful response from `DELETE _watcher/watch/my_watch`.
{
"found": true,
"_id": "my_watch",
"_version": 2
}