# Is there any way to create the OpenSearchDashbaord Programmatically using Python Client

**URL:** <https://forum.opensearch.org/t/is-there-any-way-to-create-the-opensearchdashbaord-programmatically-using-python-client/7396>\
**Category:** OpenDistro\
**Created:** [October 22, 2021, 12:34pm UTC](https://forum.opensearch.org/t/is-there-any-way-to-create-the-opensearchdashbaord-programmatically-using-python-client/7396 "2021-10-22T12:34:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhema\_135](https://avatars.discourse-cdn.com/v4/letter/r/b782af/32.png) [@rhema\_135](https://forum.opensearch.org/u/rhema_135)\
**Post date:** [October 22, 2021, 12:34pm UTC](https://forum.opensearch.org/t/is-there-any-way-to-create-the-opensearchdashbaord-programmatically-using-python-client/7396/1 "2021-10-22T12:34:17Z")

</div>

Hi Team,

Could you please help me on this…

is there any way to create the OpenSearch dashboard Programmatically using Python Client…

Thanks In Advance…

Thanks,  
Hema

---

<div class="post-metadata">

**Author:** ![imesha](https://avatars.discourse-cdn.com/v4/letter/i/58f4c7/32.png) [@imesha](https://forum.opensearch.org/u/imesha)\
**Post date:** [October 27, 2021, 6:19am UTC](https://forum.opensearch.org/t/is-there-any-way-to-create-the-opensearchdashbaord-programmatically-using-python-client/7396/2 "2021-10-27T06:19:59Z")

</div>

Not sure about OpenSearch, but in Kibana (tried in version 6.x) you could export a dashboard as a json and them there was a REST endpoint to import a dashboard via a JSON. I used that to dynamically create a dashboard in a jenkins pipeline sometime back. OpenSearch dashboard should have the same API.

---

<div class="post-metadata">

**Author:** ![rhema\_135](https://avatars.discourse-cdn.com/v4/letter/r/b782af/32.png) [@rhema\_135](https://forum.opensearch.org/u/rhema_135)\
**Post date:** [October 27, 2021, 11:55am UTC](https://forum.opensearch.org/t/is-there-any-way-to-create-the-opensearchdashbaord-programmatically-using-python-client/7396/3 "2021-10-27T11:55:50Z")

</div>

ThankYou Imesha… Yes but i too didn’t found the OpenSearchDashboard API’s to create the Dashboard programetically… seems we need to use Kibana endpoint to do the same…

> **[Saved objects APIs | Kibana Guide \[8.4\] | Elastic](https://www.elastic.co/guide/en/kibana/current/saved-objects-api.html)**
>
> Conceptual and step-by-step procedures for using runtime fields, scripted fields, and field formatters.

---

<div class="post-metadata">

**Author:** ![spapadop](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/spapadop/32/950_2.png) [@spapadop](https://forum.opensearch.org/u/spapadop)\
**Post date:** [October 28, 2021, 9:43am UTC](https://forum.opensearch.org/t/is-there-any-way-to-create-the-opensearchdashbaord-programmatically-using-python-client/7396/4 "2021-10-28T09:43:26Z")

</div>

Indeed, I’ve been using the following:

To export json object (dashboard/viz/…):

```auto
curl -u 'user:pass' -X POST 'http://localhost:5601/api/saved_objects/_export' -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -H 'securitytenant: test_tenant' -d '{
  "objects": [
    {
      "type": "dashboard",
      "id": "a12ccca0-g567-15eb-9v71-c92d207nv042"
    }
  ],
  "includeReferencesDeep": true
}' > export.ndjson

```

To import json object (dashboard/viz/…):

```auto
curl -u 'user:pass' -X POST 'http://localhost:5601/api/saved_objects/_import?overwrite=true' -H 'securitytenant: test_tenant' -H 'kbn-xsrf: true' --form file=@export.ndjson

```
