# Can the APM Kibana objects be loaded with API call?

**URL:** <https://discuss.elastic.co/t/can-the-apm-kibana-objects-be-loaded-with-api-call/230208>\
**Category:** APM\
**Tags:** ui\
**Created:** [April 28, 2020, 3:23pm UTC](https://discuss.elastic.co/t/can-the-apm-kibana-objects-be-loaded-with-api-call/230208 "2020-04-28T15:23:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cotjoey](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@cotjoey](https://discuss.elastic.co/u/cotjoey)\
**Post date:** [April 28, 2020, 3:23pm UTC](https://discuss.elastic.co/t/can-the-apm-kibana-objects-be-loaded-with-api-call/230208/1 "2020-04-28T15:23:08Z")

</div>

I am using Kibana 7.6.0, Logstash 7.6.0 & APM version 7.6.0 and would like to automate the "Load Kibana Objects" functionality that I can find in the Kibana UI at [Home] \> [Add data] \> APM \> "Load Kibana Objects". I was unable to find the documentation online as to if there is a "curl" command that can call the API to load such objects. Looking at the Kibana logs, the closest thing I could find was:

`POST /api/saved_objects/_bulk_create?overwrite=false`

I tried in the developer tools, but it returns an error as it's probably malformed.

I am looking for the curl command that would let me accomplish such a thing.

Thank you,  
Joey

---

<div class="post-metadata">

**Author:** ![bmorelli25](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bmorelli25/32/38738_2.png) [@bmorelli25](https://discuss.elastic.co/u/bmorelli25)\
**Post date:** [April 28, 2020, 4:03pm UTC](https://discuss.elastic.co/t/can-the-apm-kibana-objects-be-loaded-with-api-call/230208/2 "2020-04-28T16:03:27Z")

</div>

Hey again Joey,

When you click the **Load saved Kibana objects** button in the APM app, it creates an APM index pattern via the `saved_objects` API (as it looks like you were able to partially figure out). We don't have documentation yet, but we do have an issue open to add documentation for creating APM index pattern via the API: [Kibana/#52736](https://github.com/elastic/kibana/issues/52736). Pair that information with the [bulk\_create](https://www.elastic.co/guide/en/kibana/current/saved-objects-api-bulk-create.html) saved objects API and you should be able to get it to work.

It's important to note that the [saved\_objects](https://www.elastic.co/guide/en/kibana/7.6/saved-objects-api.html) API is still experimental and subject to change at any time.

---

<div class="post-metadata">

**Author:** ![cotjoey](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@cotjoey](https://discuss.elastic.co/u/cotjoey)\
**Post date:** [April 28, 2020, 5:31pm UTC](https://discuss.elastic.co/t/can-the-apm-kibana-objects-be-loaded-with-api-call/230208/3 "2020-04-28T17:31:50Z")

</div>

Awesome thanks!

---

<div class="post-metadata">

**Author:** ![Oliver\_Gupte](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oliver_gupte/32/41850_2.png) [@Oliver\_Gupte](https://discuss.elastic.co/u/Oliver_Gupte)\
**Post date:** [April 28, 2020, 9:12pm UTC](https://discuss.elastic.co/t/can-the-apm-kibana-objects-be-loaded-with-api-call/230208/4 "2020-04-28T21:12:28Z")

</div>

It might be possible to manually download/pipe the `apm` saved objects to the `saved_objects` API:

```bash
curl -u elastic:$KIBANAPASS \
  'https://<kibana_host>/api/kibana/home/tutorials' \
  -H 'kbn-xsrf: true' \
  | jq '.[] | select(.id == "apm") | .savedObjects' \
  > apm_saved_objects.json
curl -u elastic:$KIBANAPASS \
  'https://<kibana_host>/api/saved_objects/_bulk_create?overwrite=false' \
  -X POST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' \
  --data @apm_saved_objects.json

```

Note that this example uses `jq` to filter the tutorial data to select only the `savedObjects` data of the `apm` tutorial definition.

This is essentially the manual equivalent to how Kibana handles that button click for "Load Kibana Objects", but the tutorial API is not a public API, and may change between releases.

---

<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:** [May 19, 2020, 5:12pm UTC](https://discuss.elastic.co/t/can-the-apm-kibana-objects-be-loaded-with-api-call/230208/5 "2020-05-19T17:12:32Z")

</div>

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