---
type: api
title: Export saved objects
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-exportsavedobjectsdefault
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-exportsavedobjectsdefault
products:
  - Kibana
---

# Export saved objects

- Server: `https://{kibana_url}`

## Paths

- `POST` `/api/saved_objects/_export`
- `POST` `/s/{space_id}/api/saved_objects/_export`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v8/authentication#basicauth)

## Description

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.

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

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

## Request Body

`application/json`

- `excludeExportDetails` (boolean · default: false) — optional
  Do not add export details entry at the end of the stream.
- `includeReferencesDeep` (boolean) — optional
  Includes all of the referenced objects in the exported objects.
- `objects` ([] object) — optional
  A list of objects to export.
- `type` (union string | [] string) — optional
  The saved object types to include in the export. Use `*` to export all the types.

## Responses

#### `200`

Indicates a successful call.

`application/x-ndjson`

Type: `object`

#### `400`

Bad request.

`application/json`

- `error` (enum)
  Values: `Bad Request`
- `message` (string)
- `statusCode` (enum)
  Values: `400`
## Code Examples

#### Console

```console
POST /api/saved_objects/_export
{
  "excludeExportDetails": true,
  "includeReferencesDeep": false,
  "objects": [
    {
      "id": "de71f4f0-1902-11e9-919b-ffe5949a18d2",
      "type": "map"
    }
  ]
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/saved_objects/_export" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
  "excludeExportDetails": true,
  "includeReferencesDeep": false,
  "objects": [
    {
      "id": "de71f4f0-1902-11e9-919b-ffe5949a18d2",
      "type": "map"
    }
  ]
}'
```

## Response Examples

#### The export objects API response contains a JSON record for each exported object.

```json
{
  "attributes": {
    "description": "",
    "layerListJSON": "[{\u0022id\u0022:\u00220hmz5\u0022,\u0022alpha\u0022:1,\u0022sourceDescriptor\u0022:{\u0022type\u0022:\u0022EMS_TMS\u0022,\u0022isAutoSelect\u0022:true,\u0022lightModeDefault\u0022:\u0022road_map_desaturated\u0022},\u0022visible\u0022:true,\u0022style\u0022:{},\u0022type\u0022:\u0022EMS_VECTOR_TILE\u0022,\u0022minZoom\u0022:0,\u0022maxZoom\u0022:24},{\u0022id\u0022:\u0022edh66\u0022,\u0022label\u0022:\u0022Total Requests by Destination\u0022,\u0022minZoom\u0022:0,\u0022maxZoom\u0022:24,\u0022alpha\u0022:0.5,\u0022sourceDescriptor\u0022:{\u0022type\u0022:\u0022EMS_FILE\u0022,\u0022id\u0022:\u0022world_countries\u0022,\u0022tooltipProperties\u0022:[\u0022name\u0022,\u0022iso2\u0022]},\u0022visible\u0022:true,\u0022style\u0022:{\u0022type\u0022:\u0022VECTOR\u0022,\u0022properties\u0022:{\u0022fillColor\u0022:{\u0022type\u0022:\u0022DYNAMIC\u0022,\u0022options\u0022:{\u0022field\u0022:{\u0022name\u0022:\u0022__kbnjoin__count__673ff994-fc75-4c67-909b-69fcb0e1060e\u0022,\u0022origin\u0022:\u0022join\u0022},\u0022color\u0022:\u0022Greys\u0022,\u0022fieldMetaOptions\u0022:{\u0022isEnabled\u0022:false,\u0022sigma\u0022:3}}},\u0022lineColor\u0022:{\u0022type\u0022:\u0022STATIC\u0022,\u0022options\u0022:{\u0022color\u0022:\u0022#FFFFFF\u0022}},\u0022lineWidth\u0022:{\u0022type\u0022:\u0022STATIC\u0022,\u0022options\u0022:{\u0022size\u0022:1}},\u0022iconSize\u0022:{\u0022type\u0022:\u0022STATIC\u0022,\u0022options\u0022:{\u0022size\u0022:10}},\u0022symbolizeAs\u0022:{\u0022options\u0022:{\u0022value\u0022:\u0022circle\u0022}},\u0022icon\u0022:{\u0022type\u0022:\u0022STATIC\u0022,\u0022options\u0022:{\u0022value\u0022:\u0022marker\u0022}}}},\u0022type\u0022:\u0022GEOJSON_VECTOR\u0022,\u0022joins\u0022:[{\u0022leftField\u0022:\u0022iso2\u0022,\u0022right\u0022:{\u0022type\u0022:\u0022ES_TERM_SOURCE\u0022,\u0022id\u0022:\u0022673ff994-fc75-4c67-909b-69fcb0e1060e\u0022,\u0022indexPatternTitle\u0022:\u0022kibana_sample_data_logs\u0022,\u0022term\u0022:\u0022geo.dest\u0022,\u0022indexPatternRefName\u0022:\u0022layer_1_join_0_index_pattern\u0022,\u0022metrics\u0022:[{\u0022type\u0022:\u0022count\u0022,\u0022label\u0022:\u0022web logs count\u0022}],\u0022applyGlobalQuery\u0022:true}}]},{\u0022id\u0022:\u0022gaxya\u0022,\u0022label\u0022:\u0022Actual Requests\u0022,\u0022minZoom\u0022:9,\u0022maxZoom\u0022:24,\u0022alpha\u0022:1,\u0022sourceDescriptor\u0022:{\u0022id\u0022:\u0022b7486535-171b-4d3b-bb2e-33c1a0a2854c\u0022,\u0022type\u0022:\u0022ES_SEARCH\u0022,\u0022geoField\u0022:\u0022geo.coordinates\u0022,\u0022limit\u0022:2048,\u0022filterByMapBounds\u0022:true,\u0022tooltipProperties\u0022:[\u0022clientip\u0022,\u0022timestamp\u0022,\u0022host\u0022,\u0022request\u0022,\u0022response\u0022,\u0022machine.os\u0022,\u0022agent\u0022,\u0022bytes\u0022],\u0022indexPatternRefName\u0022:\u0022layer_2_source_index_pattern\u0022,\u0022applyGlobalQuery\u0022:true,\u0022scalingType\u0022:\u0022LIMIT\u0022},\u0022visible\u0022:true,\u0022style\u0022:{\u0022type\u0022:\u0022VECTOR\u0022,\u0022properties\u0022:{\u0022fillColor\u0022:{\u0022type\u0022:\u0022STATIC\u0022,\u0022options\u0022:{\u0022color\u0022:\u0022#2200ff\u0022}},\u0022lineColor\u0022:{\u0022type\u0022:\u0022STATIC\u0022,\u0022options\u0022:{\u0022color\u0022:\u0022#FFFFFF\u0022}},\u0022lineWidth\u0022:{\u0022type\u0022:\u0022STATIC\u0022,\u0022options\u0022:{\u0022size\u0022:2}},\u0022iconSize\u0022:{\u0022type\u0022:\u0022DYNAMIC\u0022,\u0022options\u0022:{\u0022field\u0022:{\u0022name\u0022:\u0022bytes\u0022,\u0022origin\u0022:\u0022source\u0022},\u0022minSize\u0022:1,\u0022maxSize\u0022:23,\u0022fieldMetaOptions\u0022:{\u0022isEnabled\u0022:false,\u0022sigma\u0022:3}}},\u0022symbolizeAs\u0022:{\u0022options\u0022:{\u0022value\u0022:\u0022circle\u0022}},\u0022icon\u0022:{\u0022type\u0022:\u0022STATIC\u0022,\u0022options\u0022:{\u0022value\u0022:\u0022marker\u0022}}}},\u0022type\u0022:\u0022GEOJSON_VECTOR\u0022},{\u0022id\u0022:\u0022tfi3f\u0022,\u0022label\u0022:\u0022Total Requests and Bytes\u0022,\u0022minZoom\u0022:0,\u0022maxZoom\u0022:9,\u0022alpha\u0022:1,\u0022sourceDescriptor\u0022:{\u0022type\u0022:\u0022ES_GEO_GRID\u0022,\u0022resolution\u0022:\u0022COARSE\u0022,\u0022id\u0022:\u00228aaa65b5-a4e9-448b-9560-c98cb1c5ac5b\u0022,\u0022geoField\u0022:\u0022geo.coordinates\u0022,\u0022requestType\u0022:\u0022point\u0022,\u0022metrics\u0022:[{\u0022type\u0022:\u0022count\u0022,\u0022label\u0022:\u0022web logs count\u0022},{\u0022type\u0022:\u0022sum\u0022,\u0022field\u0022:\u0022bytes\u0022}],\u0022indexPatternRefName\u0022:\u0022layer_3_source_index_pattern\u0022,\u0022applyGlobalQuery\u0022:true},\u0022visible\u0022:true,\u0022style\u0022:{\u0022type\u0022:\u0022VECTOR\u0022,\u0022properties\u0022:{\u0022fillColor\u0022:{\u0022type\u0022:\u0022DYNAMIC\u0022,\u0022options\u0022:{\u0022field\u0022:{\u0022name\u0022:\u0022doc_count\u0022,\u0022origin\u0022:\u0022source\u0022},\u0022color\u0022:\u0022Blues\u0022,\u0022fieldMetaOptions\u0022:{\u0022isEnabled\u0022:false,\u0022sigma\u0022:3}}},\u0022lineColor\u0022:{\u0022type\u0022:\u0022STATIC\u0022,\u0022options\u0022:{\u0022color\u0022:\u0022#cccccc\u0022}},\u0022lineWidth\u0022:{\u0022type\u0022:\u0022STATIC\u0022,\u0022options\u0022:{\u0022size\u0022:1}},\u0022iconSize\u0022:{\u0022type\u0022:\u0022DYNAMIC\u0022,\u0022options\u0022:{\u0022field\u0022:{\u0022name\u0022:\u0022sum_of_bytes\u0022,\u0022origin\u0022:\u0022source\u0022},\u0022minSize\u0022:7,\u0022maxSize\u0022:25,\u0022fieldMetaOptions\u0022:{\u0022isEnabled\u0022:false,\u0022sigma\u0022:3}}},\u0022labelText\u0022:{\u0022type\u0022:\u0022DYNAMIC\u0022,\u0022options\u0022:{\u0022field\u0022:{\u0022name\u0022:\u0022doc_count\u0022,\u0022origin\u0022:\u0022source\u0022},\u0022fieldMetaOptions\u0022:{\u0022isEnabled\u0022:false,\u0022sigma\u0022:3}}},\u0022labelSize\u0022:{\u0022type\u0022:\u0022DYNAMIC\u0022,\u0022options\u0022:{\u0022field\u0022:{\u0022name\u0022:\u0022doc_count\u0022,\u0022origin\u0022:\u0022source\u0022},\u0022minSize\u0022:12,\u0022maxSize\u0022:24,\u0022fieldMetaOptions\u0022:{\u0022isEnabled\u0022:false,\u0022sigma\u0022:3}}},\u0022symbolizeAs\u0022:{\u0022options\u0022:{\u0022value\u0022:\u0022circle\u0022}},\u0022icon\u0022:{\u0022type\u0022:\u0022STATIC\u0022,\u0022options\u0022:{\u0022value\u0022:\u0022marker\u0022}}}},\u0022type\u0022:\u0022GEOJSON_VECTOR\u0022}]",
    "mapStateJSON": "{\u0022zoom\u0022:3.64,\u0022center\u0022:{\u0022lon\u0022:-88.92107,\u0022lat\u0022:42.16337},\u0022timeFilters\u0022:{\u0022from\u0022:\u0022now-7d\u0022,\u0022to\u0022:\u0022now\u0022},\u0022refreshConfig\u0022:{\u0022isPaused\u0022:true,\u0022interval\u0022:0},\u0022query\u0022:{\u0022language\u0022:\u0022kuery\u0022,\u0022query\u0022:\u0022\u0022},\u0022settings\u0022:{\u0022autoFitToDataBounds\u0022:false}}",
    "title": "[Logs] Total Requests and Bytes",
    "uiStateJSON": "{\u0022isDarkMode\u0022:false}"
  },
  "coreMigrationVersion": "8.8.0",
  "created_at": "2023-08-23T20:03:32.204Z",
  "id": "de71f4f0-1902-11e9-919b-ffe5949a18d2",
  "managed": false,
  "references": [
    {
      "id": "90943e30-9a47-11e8-b64d-95841ca0b247",
      "name": "layer_1_join_0_index_pattern",
      "type": "index-pattern"
    },
    {
      "id": "90943e30-9a47-11e8-b64d-95841ca0b247",
      "name": "layer_2_source_index_pattern",
      "type": "index-pattern"
    },
    {
      "id": "90943e30-9a47-11e8-b64d-95841ca0b247",
      "name": "layer_3_source_index_pattern",
      "type": "index-pattern"
    }
  ],
  "type": "map",
  "typeMigrationVersion": "8.4.0",
  "updated_at": "2023-08-23T20:03:32.204Z",
  "version": "WzEzLDFd"
}
```

