Creating Dashboards in Kibana through elastic rest client

Hi ,

I want to create a new dashboard in kibana using java api, I tried by indexing as a document in .kibana index using elastic rest client but it is throwing error.
Does anyone has a clue how it will be done, any guidance is appreciated.

Can you share what error your seeing, more steps, screenshots and logs, version of the stack would help . AFAIK, there's no publically exposed API for this, but there is an open PREQ for this: https://github.com/elastic/kibana/issues/4759 .

All dashboards are stored as saved-objects (basically a JSON-object that described which visualizations are included, plus some other settings).

Kibana internally uses a REST-API to manage saved-objects (so you can use curl to make requests). You can find more details about that here: https://github.com/elastic/kibana/issues/4759 . This is an internal implementation detail though, so this is subject to change at any time.
Thanks
Rashmi