# Xpack PUT Watcher API

**URL:** <https://discuss.elastic.co/t/xpack-put-watcher-api/125649>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [March 26, 2018, 4:52pm UTC](https://discuss.elastic.co/t/xpack-put-watcher-api/125649 "2018-03-26T16:52:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Stevens](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Steve\_Stevens](https://discuss.elastic.co/u/Steve_Stevens)\
**Post date:** [March 26, 2018, 4:52pm UTC](https://discuss.elastic.co/t/xpack-put-watcher-api/125649/1 "2018-03-26T16:52:53Z")

</div>

Is there a query param or other method of giving the watcher a name via the API?  
I know the ID is set by path/resource reference and I can see we can set active=true|false can be set by a query param but can't see a way of setting the watcher name.

Cheers!

RE: [https://www.elastic.co/guide/en/elasticsearch/reference/6.0/watcher-api-put-watch.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/watcher-api-put-watch.html)

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 26, 2018, 5:10pm UTC](https://discuss.elastic.co/t/xpack-put-watcher-api/125649/2 "2018-03-26T17:10:08Z")

</div>

the ID is the unique identifier, nothing more is needed.

What else are you referring to by `name` here?

---

<div class="post-metadata">

**Author:** ![Steve\_Stevens](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Steve\_Stevens](https://discuss.elastic.co/u/Steve_Stevens)\
**Post date:** [March 27, 2018, 8:53am UTC](https://discuss.elastic.co/t/xpack-put-watcher-api/125649/3 "2018-03-27T08:53:11Z")

</div>

This page is the watcher list. When manually creating a watcher via the gui interface you can enter an ID and a more human "name" (2nd column).

Thanks

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/d/bd3cf1d137c7b7d009541a56f63fe66100309487.png)

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 27, 2018, 9:06am UTC](https://discuss.elastic.co/t/xpack-put-watcher-api/125649/4 "2018-03-27T09:06:17Z")

</div>

ooooooh, now I get it (backend person speaking here) - this is a special field in the `metadata` of a watch that is being used here.

--Alex

---

<div class="post-metadata">

**Author:** ![Steve\_Stevens](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Steve\_Stevens](https://discuss.elastic.co/u/Steve_Stevens)\
**Post date:** [March 27, 2018, 9:25am UTC](https://discuss.elastic.co/t/xpack-put-watcher-api/125649/5 "2018-03-27T09:25:36Z")

</div>

Ah Brilliant, that's the one

> {  
> "metadata" : {  
> "name" : "whatever"  
> },  
> "input" : ... , "action" : ...  
> }

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 24, 2018, 9:25am UTC](https://discuss.elastic.co/t/xpack-put-watcher-api/125649/6 "2018-04-24T09:25:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
