---
title: "Export saved objects"
method: POST
path: "/api/saved_objects/_export"
tags: ["saved objects"]
---

# Export saved objects

`POST /api/saved_objects/_export`

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

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

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

Retrieve sets of saved objects that you want to import into Kibana. You must include `type` or `objects` in the request body. The output of exporting saved objects must be treated as opaque. Tampering with exported data risks introducing unspecified errors and data loss.

Exported saved objects are not backwards compatible and cannot be imported into an older version of Kibana.

NOTE: The exported saved objects include `coreMigrationVersion` and `typeMigrationVersion` metadata. If you store exported saved objects outside of Kibana (for example in NDJSON files) or generate them yourself, you must preserve or include these fields to retain forward compatibility across Kibana versions.

NOTE: The `savedObjects.maxImportExportSize` configuration setting limits the number of saved objects which may be exported.

## Headers

- `kbn-xsrf` string, required

## Request body

- object
  - `excludeExportDetails` boolean — Do not add export details entry at the end of the stream.
  - `hasReference` union
    - object
      - `id` string, required
      - `type` string, required
    - object[]
      - `id` string, required
      - `type` string, required
  - `includeReferencesDeep` boolean — Includes all of the referenced objects in the exported objects.
  - `objects` object[] — A list of objects to export. NOTE: this optional parameter cannot be combined with the `types` option
    - `id` string, required
    - `type` string, required
  - `search` string — Search for documents to export using the Elasticsearch Simple Query String syntax.
  - `type` union — The saved object types to include in the export. Use `*` to export all the types. Valid options depend on enabled plugins, but may include `visualization`, `dashboard`, `search`, `index-pattern`, `tag`, `config`, `config-global`, `lens`, `map`, `event-annotation-group`, `query`, `url`, `action`, `alert`, `alerting_rule_template`, `apm-indices`, `cases-user-actions`, `cases`, `cases-comments`, `infrastructure-monitoring-log-view`, `ml-trained-model`, `osquery-saved-query`, `osquery-pack`, `osquery-pack-asset`.
    - string
    - string[]

## Response `200`

Indicates a successfull call.

## Other responses

- `400` — Bad request.

---

[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)
