# Create default mapping through the API

**URL:** <https://discuss.elastic.co/t/create-default-mapping-through-the-api/9243>\
**Category:** Elasticsearch\
**Created:** [October 4, 2012, 5:03pm UTC](https://discuss.elastic.co/t/create-default-mapping-through-the-api/9243 "2012-10-04T17:03:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jurg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jurg/32/2289_2.png) [@jurg](https://discuss.elastic.co/u/jurg)\
**Post date:** [October 4, 2012, 5:03pm UTC](https://discuss.elastic.co/t/create-default-mapping-through-the-api/9243/1 "2012-10-04T17:03:52Z")

</div>

Hi all,

I am trying to create a _default_ mapping like this

curl -XPUT '[http://localhost/heystaq-development-trending](http://localhost/heystaq-development-trending)' -d '  
{  
"mappings": {  
"_default_" : {  
"\_timestamp" : { "enabled" : true, "store" : true },  
"dynamic\_templates" : [  
{  
"whitespace" : {  
"match" : "\*",  
"match\_mapping\_type" : "string",  
"mapping" : { "type" : "string", "analyzer" :  
"whitespace" }  
}  
}  
]  
}  
}  
}  
'

Why doesn't that work? (I end up with a _default_ type in my index, that  
was definitely not expected.)

Groet,  
Jurg.

--

---

<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 6, 2017, 3:10am UTC](https://discuss.elastic.co/t/create-default-mapping-through-the-api/9243/2 "2017-07-06T03:10:06Z")

</div>


