# API call for ML job Kibana settings

**URL:** <https://discuss.elastic.co/t/api-call-for-ml-job-kibana-settings/281763>\
**Category:** Kibana\
**Tags:** elastic-stack-machine-learning\
**Created:** [August 18, 2021, 4:28am UTC](https://discuss.elastic.co/t/api-call-for-ml-job-kibana-settings/281763 "2021-08-18T04:28:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![admlko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/admlko/32/21787_2.png) [@admlko](https://discuss.elastic.co/u/admlko)\
**Post date:** [August 18, 2021, 4:28am UTC](https://discuss.elastic.co/t/api-call-for-ml-job-kibana-settings/281763/1 "2021-08-18T04:28:27Z")

</div>

Hi,

I am creating datafeeds and ML jobs via API calls and they are working just fine, but I always have to open Kibana and select **Synchronize saved objects** if I want them to show up in the UI.  
Is there a way to do the same programmatically via API call?

Also, I have just discovered that ML jobs supports Kibana Spaces. How can I select the spaces for each job via API?

Thank you!

---

<div class="post-metadata">

**Author:** ![James\_Gowdy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james_gowdy/32/74175_2.png) [@James\_Gowdy](https://discuss.elastic.co/u/James_Gowdy)\
**Post date:** [August 18, 2021, 9:31am UTC](https://discuss.elastic.co/t/api-call-for-ml-job-kibana-settings/281763/2 "2021-08-18T09:31:24Z")

</div>

Hi,

Saved objects can be synchronized via a Kibana API:  
`GET <KIBANA_SERVER>/api/ml/saved_objects/sync`  
Adding the argument `?simulate=true` to the end will show you what the endpoint will do before doing it.

To assign an initial space to a job, you can call that `sync` endpoint with a space in the path. e.g.  
`GET <KIBANA_SERVER>/s/<SPACE_NAME>/api/ml/saved_objects/sync`  
This will create the saved objects and assign the job to that space.

To assign a job to multiple spaces or to change the current job's space after the initial sync, I'd recommend using the UI.

I hope this is helpful.

Cheers,  
James

---

<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:** [September 15, 2021, 9:31am UTC](https://discuss.elastic.co/t/api-call-for-ml-job-kibana-settings/281763/3 "2021-09-15T09:31:40Z")

</div>

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