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

    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.

    overwrite

    (Optional, boolean) Overwrites saved objects.

    Request body

    The request body must include the multipart/form-data type.

    file

    success

    Top-level property that indicates if the import was successful.

    successCount

    Indicates the number of successfully imported records.

    errors

    (array) Indicates the import was unsuccessful and specifies the objects that failed to import.

    Response code

    200

    Indicates a successful call.

    The file.ndjson file contains the following:

    1. {"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}}
    2. {"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}}

    The API returns the following:

    1. {
    2. "success": true,
    3. "successCount": 2
    4. }

    Import an index pattern and dashboard that includes a conflict on the index pattern:

    The file.ndjson file contains the following:

    1. {"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}}
    2. {"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}}

    The API returns the following:

    1. "success": false,
    2. "successCount": 1,
    3. {
    4. "id": "my-pattern",
    5. "type": "index-pattern",
    6. "title": "my-pattern-*",
    7. "error": {
    8. "type": "conflict"
    9. },
    10. },
    11. ],
    12. }

    Import a visualization and dashboard with an index pattern for the visualization reference that doesn’t exist:

    The file.ndjson file contains the following:

    1. {"type":"visualization","id":"my-vis","attributes":{"title":"my-vis"},"references":[{"name":"ref_0","type":"index-pattern","id":"my-pattern-*"}]}
    2. {"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"},"references":[{"name":"ref_0","type":"visualization","id":"my-vis"}]}

    The API returns the following:

    1. "success": false,
    2. "successCount": 0,
    3. "errors": [
    4. "id": "my-vis",
    5. "type": "visualization",
    6. "title": "my-vis",
    7. "type": "missing_references",
    8. "references": [
    9. {
    10. "type": "index-pattern",
    11. "id": "my-pattern-*"
    12. }
    13. ],
    14. "blocking": [
    15. {
    16. "type": "dashboard",
    17. "id": "my-dashboard"
    18. }
    19. ]
    20. }
    21. }

    Most Popular