# Types for JSON file using bulk API

**URL:** <https://discuss.elastic.co/t/types-for-json-file-using-bulk-api/118474>\
**Category:** Elasticsearch\
**Created:** [February 5, 2018, 2:34pm UTC](https://discuss.elastic.co/t/types-for-json-file-using-bulk-api/118474 "2018-02-05T14:34:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![val](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/val/32/138203_2.png) [@val](https://discuss.elastic.co/u/val)\
**Post date:** [February 5, 2018, 2:37pm UTC](https://discuss.elastic.co/t/types-for-json-file-using-bulk-api/118474/2 "2018-02-05T14:37:11Z")

</div>

Like I mentioned in my [previous answer](https://discuss.elastic.co/t/validation-failed-because-of-missing-type-with-bulk-api/118465/6), you can remove the index and type information from your JSON file like this:

```
{"index":{"_id":"2"}}
{"info":"2", "bob":3}

```

and then add those to your curl command

```
curl -XPOST -H 'Content-Type: application/json' localhost:9200/fake/type/_bulk --data-binary @/path/to/your/file.json

```

Also note that the type information has nothing to do with your field types (keyword, integer, etc), but it is a [mapping type](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html), i.e. the place where you define all your index fields

Finally, the `_id` can only take literal value, but not an object value. You could hash `{"$oid":"52287a4ee4b07193f703c23f"}` into some string and use that string as ID, though

---

_[View the full topic](https://discuss.elastic.co/t/types-for-json-file-using-bulk-api/118474)._
