---
title: "Sync saved objects in the default space"
method: GET
path: "/api/ml/saved_objects/sync"
tags: ["ml"]
---

# Sync saved objects in the default space

`GET /api/ml/saved_objects/sync`

**Spaces method and path for this operation:**

<div><span class="operation-verb get">get</span>&nbsp;<span class="operation-path">/s/{space_id}/api/ml/saved_objects/sync</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Synchronizes Kibana saved objects for machine learning jobs and trained models in the default space. 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.

## Query parameters

- `simulate` boolean

## Response `200`

Indicates a successful call

- MachineLearningAPIsMlSync200Response
  - `datafeedsAdded` object — If a saved object for an anomaly detection job is missing a datafeed identifier, it is added when you run the sync machine learning saved objects API.
  - `datafeedsRemoved` object — If a saved object for an anomaly detection job references a datafeed that no longer exists, it is deleted when you run the sync machine learning saved objects API.
  - `savedObjectsCreated` MachineLearningAPIsMlSyncResponseSavedObjectsCreated — If saved objects are missing for machine learning jobs or trained models, they are created when you run the sync machine learning saved objects API.
    - `anomaly-detector` object — If saved objects are missing for anomaly detection jobs, they are created.
    - `data-frame-analytics` object — If saved objects are missing for data frame analytics jobs, they are created.
    - `trained-model` object — If saved objects are missing for trained models, they are created.
  - `savedObjectsDeleted` MachineLearningAPIsMlSyncResponseSavedObjectsDeleted — If saved objects exist for machine learning jobs or trained models that no longer exist, they are deleted when you run the sync machine learning saved objects API.
    - `anomaly-detector` object — If there are saved objects exist for nonexistent anomaly detection jobs, they are deleted.
    - `data-frame-analytics` object — If there are saved objects exist for nonexistent data frame analytics jobs, they are deleted.
    - `trained-model` object — If there are saved objects exist for nonexistent trained models, they are deleted.

## Other responses

- `401` — Authorization information is missing or invalid.

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
