[[Machine_learning_APIs]]
== Machine learning APIs

* <<ml-sync>>

[[ml-sync]]
=== Sync machine learning objects

Synchronizes Kibana saved objects for machine learning jobs and trained models. You must have `all` privileges for the *Machine Learning* feature in the *Analytics* section of the Kibana feature privileges. This API runs automatically when you start Kibana and periodically thereafter.


==== Request

`GET /s/{spaceId}/api/ml/saved_objects/sync`

==== Path parameters

[options="header"]
|==========
|Name |Type |Required |Description
|`spaceId` |+string+ |Y |An identifier for the space. If you omit `/s/` and this identifier from the path, the default space is used.

|==========
==== Query parameters

[options="header"]
|==========
|Name |Type |Required |Description
|`simulate` |+boolean+; default: ++false++ |N |When true, simulates the synchronization by returning only the list actions that would be performed.

|==========
==== Responses

`200`::
+
--
(<<MLSyncResponse,`MLSyncResponse`>>)

Indicates a successful call.

--

==== Request example

[source,json]
--------
curl -XGET https://localhost:5601/s/{spaceId}/api/ml/saved_objects/sync \
-u USER:PASSWORD
--------