# How to understand the “PUT /\_mapping” API

**URL:** <https://discuss.elastic.co/t/how-to-understand-the-put-mapping-api/253656>\
**Category:** Elasticsearch\
**Created:** [October 29, 2020, 8:14am UTC](https://discuss.elastic.co/t/how-to-understand-the-put-mapping-api/253656 "2020-10-29T08:14:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luchenguang](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@luchenguang](https://discuss.elastic.co/u/luchenguang)\
**Post date:** [October 29, 2020, 8:14am UTC](https://discuss.elastic.co/t/how-to-understand-the-put-mapping-api/253656/1 "2020-10-29T08:14:31Z")

</div>

Hi, everyone. I am confuse about these PUT mapping APIs in this [Guide Document](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/indices-put-mapping.html#updating-field-mappings), and need some help 🙏 🙏

The Request APIs are:

> `PUT /<index>/_mapping`  
> `PUT /_mapping`

About the path parameter `<index>`, it says that:

> To update the mapping of all indices, omit this parameter or use a value of `_all` .

But when I tryed to do this:

```auto
PUT /_mapping
{
 "properties": {
     "test": {
         "type": "text"
     }
 }
}

```

I got a 405 error:

```auto
"error": "Incorrect HTTP method for uri [/_mapping?pretty] and method [PUT], allowed: [GET]",
"status": 405

```

So, is there anything wrong about the doc or I misunderstand the meaning?why the `PUT /_mapping` endpoint is not supported but the doc give this API? Can we truely omit the `<index>` parameter, just use `PUT /_mapping` to update the mapping of all indices?

Hope there is an answer ASAP! 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:** [November 26, 2020, 8:14am UTC](https://discuss.elastic.co/t/how-to-understand-the-put-mapping-api/253656/2 "2020-11-26T08:14:36Z")

</div>

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