# POST adding new keys

**URL:** <https://discuss.elastic.co/t/post-adding-new-keys/243753>\
**Category:** Elasticsearch\
**Created:** [August 4, 2020, 5:15pm UTC](https://discuss.elastic.co/t/post-adding-new-keys/243753 "2020-08-04T17:15:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdiaz](https://avatars.discourse-cdn.com/v4/letter/g/74df32/32.png) [@gdiaz](https://discuss.elastic.co/u/gdiaz)\
**Post date:** [August 4, 2020, 5:15pm UTC](https://discuss.elastic.co/t/post-adding-new-keys/243753/1 "2020-08-04T17:15:17Z")

</div>

Hi all,

I'm writing a service where other services can CRUD ElasticSearch. I'm have a schema that I stick to it to create POST body. I'm testing the service with Postman and I notice something unexpected. Just for giggles, I added a new `kew: value` that was never included in a POST body. I noticed that I got a 200 on Postman. I opened Kibana and looked at `/_mapping` and the new `key: value` was there with types.

My question is how dynamic is ElasticSearch in that regard? Should I implement validation at the application layer? Is there a flag I can turn on in ES to avoid dynamic POST.

I kind of like the freedom of adding a new field and allow ES infer the type without `DELETE` the index and moving the data to a new index with the new mappings.

1. I created my dev index by creating a `JSON` file with 1K docs. I didn't create mappings first but rather did a bulk `POST` and let ES auto-create the mappings.
2. I'm using ES 7.8

Thoughts about my assumptions?

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:** [September 1, 2020, 5:15pm UTC](https://discuss.elastic.co/t/post-adding-new-keys/243753/2 "2020-09-01T17:15:35Z")

</div>

Closed on September 1, 2020, 5:15pm UTC

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