delete-watch.asciidoc 2.1 KB

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