# Importing dashboards using kibana api through curl

**URL:** https://discuss.elastic.co/t/importing-dashboards-using-kibana-api-through-curl/323320
**Category:** Kibana
**Created:** [January 17, 2023, 11:40am UTC](https://discuss.elastic.co/t/importing-dashboards-using-kibana-api-through-curl/323320 "2023-01-17T11:40:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)
#### Post date: [January 17, 2023, 11:40am UTC](https://discuss.elastic.co/t/importing-dashboards-using-kibana-api-through-curl/323320/1 "2023-01-17T11:40:13Z")

</div>

Hi Community,

I want to import metricbeat dashboard , but i can't find the id. ELK version 7.17  
command used

```auto
 curl -u user:pass -k -X POST "https://localhost:5601/api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d'
{
  "type": "metricbeat-*"
}
' > export-2.ndjson

```

when i open this file , the file was empty.

I read some where, to import dashboard we need dashboard id through id we can download dashboard .

I also inspected the dashboard **[Metricbeat System] Overview ECS** but i couldn't find the id

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/9/795e426ad2d2b29b8526d09b43f488cc03df693c.png)

---

<div class="post-metadata">

### Author: ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)
#### Post date: [January 18, 2023, 5:59pm UTC](https://discuss.elastic.co/t/importing-dashboards-using-kibana-api-through-curl/323320/2 "2023-01-18T17:59:01Z")

</div>

> [@Aniket\_Pant](#):
>
> ```auto
> {
> "type": "metricbeat-*"
> }
> 
> ```

That is not a valid Saved Object type (`dashboard`, `index-pattern`, etc). You need first [find](https://www.elastic.co/guide/en/kibana/master/saved-objects-api-find.html) the identifiers of the saved objects you want to export and then build a request like this:

```bash
curl --header 'Content-Type: application/json' \
  --header 'kbn-xsrf: true' \
  --request POST \
  --user ${ELASTIC_USER}:${ELASTIC_PASSWORD} \
  "${KIBANA_HOST}/api/saved_objects/_export" \
  --data '{ "objects": 
[
  {"type": "index-pattern", "id":"YOUR-ID1"},
  {"type": "index-pattern", "id":"YOUR-ID2"},
  {"type": "index-pattern", "id":"YOUR-ID3"},
  {"type": "index-pattern", "id":"YOUR-ID4"},
...
]
}'

```

To find your index pattern identifiers you can run something like this using [jq](https://stedolan.github.io/jq/) to extract the identifiers

```bash
curl --silent --header 'Content-Type: application/json' \
  --header 'kbn-xsrf: true' \
  --request GET \
  --user ${ELASTIC_USER}:${ELASTIC_PASSWORD} \
  "${KIBANA_HOST}/api/saved_objects/_find?type=index-pattern&search_fields=title&search=metricbeat" \
  | jq '.saved_objects[].id'

```

---

<div class="post-metadata">

### Author: ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)
#### Post date: [January 19, 2023, 2:01pm UTC](https://discuss.elastic.co/t/importing-dashboards-using-kibana-api-through-curl/323320/3 "2023-01-19T14:01:56Z")

</div>

I am getting below error

```auto
{"statusCode":400,"error":"Bad Request","message":"Trying to export object(s) with non-exportable types: metricbeat:Metricbeat-system-overview-ecs"}

```

query i ran

```auto
curl -k --header 'Content-Type: application/json' \
  --header 'kbn-xsrf: true' \
  --request POST \
  --user elastic:elastic \
  "https://localhost:5601/api/saved_objects/_export" \
  --data '{ "objects":
[
  {"type": "metricbeat", "id":"Metricbeat-system-overview-ecs"}

]
}'

```

---

<div class="post-metadata">

### Author: ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)
#### Post date: [January 19, 2023, 3:29pm UTC](https://discuss.elastic.co/t/importing-dashboards-using-kibana-api-through-curl/323320/4 "2023-01-19T15:29:14Z")

</div>

Please review again the documentation for the export endpoint to understand how to build your `objects` key

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 16, 2023, 3:29pm UTC](https://discuss.elastic.co/t/importing-dashboards-using-kibana-api-through-curl/323320/5 "2023-02-16T15:29:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
