I have used API to create ES indexes. Unfortunately Kibana Index Patterns doesn't get auto-generated when we do that. I have tried using the following API call
curl -X POST "http://localhost:5601/api/saved_objects/index-pattern/iwantotestmyindexpattern" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
It creates the index pattern but doesn't associate any fields with that which is already available part of the ES indicies.