Import Dashboard

edit

This functionality is experimental and may be changed or removed completely in a future release.

The dashboard import API allows people to import dashboards along with all of their corresponding saved objects such as visualizations, saved searches, and index patterns.

Request

edit

POST /api/kibana/dashboards/import

Query Parameters

edit
force (optional)
(boolean) Overwrite any existing objects on id conflict
exclude (optional)
(array) Saved object types that should not be imported

Request Body

edit

The request body is JSON, but you should not manually construct a payload to this endpoint. Instead, use the complete response body from the Export Dashboard API as the request body to this import API.

Response body

edit

The response body will have a top level objects property that contains an array of the saved objects that were created.

Examples

edit

The following example imports saved objects associated with and including the dashboard with id 942dcef0-b2cd-11e8-ad8e-85441f0c2e5c.

POST api/kibana/dashboards/import?exclude=index-pattern
{
  "objects": [
    {
      "id": "80b956f0-b2cd-11e8-ad8e-85441f0c2e5c",
      "type": "visualization",
      "updated_at": "2018-09-07T18:40:33.247Z",
      "version": 1,
      "attributes": {
        "title": "Count Example",
        "visState": "{\"title\":\"Count Example\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"metric\",\"metric\":{\"percentageMode\":false,\"useRanges\":false,\"colorSchema\":\"Green to Red\",\"metricColorMode\":\"None\",\"colorsRange\":[{\"from\":0,\"to\":10000}],\"labels\":{\"show\":true},\"invertColors\":false,\"style\":{\"bgFill\":\"#000\",\"bgColor\":false,\"labelColor\":false,\"subText\":\"\",\"fontSize\":60}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}",
        "uiStateJSON": "{}",
        "description": "",
        "version": 1,
        "kibanaSavedObjectMeta": {
          "searchSourceJSON": "{\"index\":\"90943e30-9a47-11e8-b64d-95841ca0b247\",\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}"
        }
      }
    },
    {
      "id": "90943e30-9a47-11e8-b64d-95841ca0b247",
      "type": "index-pattern",
      "updated_at": "2018-09-07T18:39:47.683Z",
      "version": 1,
      "attributes": {
        "title": "kibana_sample_data_logs",
        "timeFieldName": "timestamp",
        "fields": "<truncated for example>",
        "fieldFormatMap": "{\"hour_of_day\":{}}"
      }
    },
    {
      "id": "942dcef0-b2cd-11e8-ad8e-85441f0c2e5c",
      "type": "dashboard",
      "updated_at": "2018-09-07T18:41:05.887Z",
      "version": 1,
      "attributes": {
        "title": "Example Dashboard",
        "hits": 0,
        "description": "",
        "panelsJSON": "[{\"gridData\":{\"w\":24,\"h\":15,\"x\":0,\"y\":0,\"i\":\"1\"},\"version\":\"7.0.0-alpha1\",\"panelIndex\":\"1\",\"type\":\"visualization\",\"id\":\"80b956f0-b2cd-11e8-ad8e-85441f0c2e5c\",\"embeddableConfig\":{}}]",
        "optionsJSON": "{\"darkTheme\":false,\"useMargins\":true,\"hidePanelTitles\":false}",
        "version": 1,
        "timeRestore": false,
        "kibanaSavedObjectMeta": {
          "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}"
        }
      }
    }
  ]
}

A response code of 200 will be returned even if there are errors importing individual saved objects. In that case, error information will be returned in the response body on an object-by-object basis.