delete-watch.asciidoc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. [role="xpack"]
  2. [[watcher-api-delete-watch]]
  3. === Delete watch API
  4. ++++
  5. <titleabbrev>Delete watch</titleabbrev>
  6. ++++
  7. Removes a watch from {watcher}.
  8. [[watcher-api-delete-watch-request]]
  9. ==== {api-request-title}
  10. `DELETE _watcher/watch/<watch_id>`
  11. [[watcher-api-delete-watch-prereqs]]
  12. ==== {api-prereq-title}
  13. * You must have `manage_watcher` cluster privileges to use this API. For more
  14. information, see <<security-privileges>>.
  15. [[watcher-api-delete-watch-desc]]
  16. ==== {api-description-title}
  17. When the watch is removed, the document representing the watch in the `.watches`
  18. index is gone and it will never be run again.
  19. Please note that deleting a watch **does not** delete any watch execution records
  20. related to this watch from the watch history.
  21. IMPORTANT: Deleting a watch must be done via this API only. Do not delete the
  22. watch directly from the `.watches` index using the Elasticsearch
  23. DELETE Document API. When {es} {security-features} are enabled, make
  24. sure no `write` privileges are granted to anyone over the `.watches`
  25. index.
  26. [[watcher-api-delete-watch-path-params]]
  27. ==== {api-path-parms-title}
  28. `<watch_id>`::
  29. (Required, string) Identifier for the watch.
  30. //[[watcher-api-delete-watch-query-params]]
  31. //==== {api-query-parms-title}
  32. //[[watcher-api-delete-watch-request-body]]
  33. //==== {api-request-body-title}
  34. //[[watcher-api-delete-watch-response-body]]
  35. //==== {api-response-body-title}
  36. //[[watcher-api-delete-watch-response-codes]]
  37. //==== {api-response-codes-title}
  38. [[watcher-api-delete-watch-example]]
  39. ==== {api-examples-title}
  40. The following example deletes a watch with the `my-watch` id:
  41. [source,console]
  42. --------------------------------------------------
  43. DELETE _watcher/watch/my_watch
  44. --------------------------------------------------
  45. // TEST[setup:my_active_watch]
  46. Response:
  47. [source,console-result]
  48. --------------------------------------------------
  49. {
  50. "found": true,
  51. "_id": "my_watch",
  52. "_version": 2
  53. }
  54. --------------------------------------------------