# Tag nodes with REST API

**URL:** https://discuss.elastic.co/t/tag-nodes-with-rest-api/29881
**Category:** Elasticsearch
**Created:** [September 24, 2015, 12:46am UTC](https://discuss.elastic.co/t/tag-nodes-with-rest-api/29881 "2015-09-24T00:46:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fyamaoka](https://avatars.discourse-cdn.com/v4/letter/f/919ad9/32.png) [@fyamaoka](https://discuss.elastic.co/u/fyamaoka)
#### Post date: [September 24, 2015, 12:46am UTC](https://discuss.elastic.co/t/tag-nodes-with-rest-api/29881/1 "2015-09-24T00:46:30Z")

</div>

Is it possible to tag a node with REST API instead of defining in elasticsearch.yml? The intention is to use the tag with index.routing.allocation.include.group property. I am aware of how to define such a tag in config. But I cannot find any reference on how it can be done dynamically or not.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 24, 2015, 12:52am UTC](https://discuss.elastic.co/t/tag-nodes-with-rest-api/29881/2 "2015-09-24T00:52:14Z")

</div>

It cannot be done dynamically.  
You can use things like node IP and hostname though, take a look [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-cluster.html#allocation-filtering) at the bottom of the section.

---

<div class="post-metadata">

### Author: ![fyamaoka](https://avatars.discourse-cdn.com/v4/letter/f/919ad9/32.png) [@fyamaoka](https://discuss.elastic.co/u/fyamaoka)
#### Post date: [September 24, 2015, 8:53pm UTC](https://discuss.elastic.co/t/tag-nodes-with-rest-api/29881/3 "2015-09-24T20:53:38Z")

</div>

Thanks.

---

<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: [July 5, 2017, 11:48pm UTC](https://discuss.elastic.co/t/tag-nodes-with-rest-api/29881/4 "2017-07-05T23:48:11Z")

</div>


