How to create docs in index using API?

Right. The right way is to send:

DELETE /myindex
POST /myindex/_bulk
{ "index": { } }
{ "name": "john doe", "age": 25 }