This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Delete watch API
editDelete watch API
editRemoves a watch from Watcher.
Request
editDELETE _watcher/watch/<watch_id>
Prerequisites
edit-
You must have
manage_watcher
cluster privileges to use this API. For more information, see Security privileges.
Description
editWhen the watch is removed, the document representing the watch in the .watches
index is gone and it will never be run again.
Please note that deleting a watch does not delete any watch execution records related to this watch from the watch history.
Deleting a watch must be done via this API only. 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 over the .watches
index.
Path parameters
edit-
<watch_id>
- (Required, string) Identifier for the watch.
Examples
editThe following example deletes a watch with the my-watch
id:
resp = client.watcher.delete_watch( id="my_watch", ) print(resp)
response = client.watcher.delete_watch( id: 'my_watch' ) puts response
const response = await client.watcher.deleteWatch({ id: "my_watch", }); console.log(response);
DELETE _watcher/watch/my_watch
Response:
{ "found": true, "_id": "my_watch", "_version": 2 }