Export objects API

[experimental] This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features. Retrieve sets of saved objects that you want to import into Kibana.

Request

POST <kibana host>:<port>/api/saved_objects/_export

POST <kibana host>:<port>/s/<space_id>/api/saved_objects/_export

Path parameters

space_id

(Optional, string) An identifier for the space. If space_id is not provided in the URL, the default space is used.

Request body

type

(Optional, array|string) The saved object types to include in the export.

objects

(Optional, array) A list of objects to export.

includeReferencesDeep

(Optional, boolean) Includes all of the referenced objects in the exported objects.

excludeExportDetails

(Optional, boolean) Do not add export details entry at the end of the stream.

You must include type or objects in the request body.

Response body

The format of the response body is newline delimited JSON. Each exported object is exported as a valid JSON record and separated by the newline character \n.

When excludeExportDetails=false (the default) we append an export result details record at the end of the file after all the saved object records. The export result details object has the following format:

  1. {
  2. "exportedCount": 27,
  3. "missingRefCount": 2,
  4. "missingReferences": [
  5. { "id": "an-id", "type": "visualisation"},
  6. { "id": "another-id", "type": "index-pattern"}
  7. ]
  8. }

Response code

200

Indicates a successful call.

Examples

Export all index pattern saved objects:

  1. $ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
  2. {
  3. "type": "index-pattern"
  4. }'

Export all index pattern saved objects and exclude the export summary from the stream:

  1. $ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
  2. {
  3. "type": "index-pattern",
  4. "excludeExportDetails": true
  5. }'

Export a specific saved object:

  1. $ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
  2. {
  3. "objects": [
  4. {
  5. "type": "dashboard",
  6. "id": "be3733a0-9efe-11e7-acb3-3dab96693fab"
  7. }
  8. ]
  9. }'

Export a specific saved object and it’s related objects :

  1. $ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
  2. {
  3. "objects": [
  4. {
  5. "type": "dashboard",
  6. "id": "be3733a0-9efe-11e7-acb3-3dab96693fab"
  7. }
  8. ],
  9. "includeReferencesDeep": true
  10. }'

Most Popular