---
type: api
title: Resolve import errors
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-resolveimporterrors
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-resolveimporterrors
products:
  - Kibana
---

# Resolve import errors

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

## Paths

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

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

To resolve errors from the Import objects API, you can:

* Retry certain saved objects
* Overwrite specific saved objects
* Change references to different saved objects

## Query String Parameters

- `compatibilityMode` (boolean)
  Applies various adjustments to the saved objects that are being imported to maintain compatibility between different Kibana versions. When enabled during the initial import, also enable when resolving import errors. This option cannot be used with the `createNewCopies` option.
- `createNewCopies` (boolean)
  Creates copies of the saved objects, regenerates each object ID, and resets the origin. When enabled during the initial import, also enable when resolving import errors.

## Request Body

`multipart/form-data`

- `file` (string) — optional
  The same file given to the import API.
- `retries` ([] object) — required
  The retry operations, which can specify how to resolve different types of errors.
  - `destinationId` (string) — optional
    Specifies the destination ID that the imported object should have, if different from the current ID.
  - `id` (string) — required
    The saved object ID.
  - `ignoreMissingReferences` (boolean) — optional
    When set to `true`, ignores missing reference errors. When set to `false`, does nothing.
  - `overwrite` (boolean) — optional
    When set to `true`, the source object overwrites the conflicting destination object. When set to `false`, does nothing.
  - `replaceReferences` ([] object) — optional
    A list of `type`, `from`, and `to` used to change the object references.
    - `from` (string) — optional
    - `to` (string) — optional
    - `type` (string) — optional
  - `type` (string) — required
    The saved object type.

## Responses

#### `200`

Indicates a successful call.

`application/json`

- `errors` ([] object)
  Specifies the objects that failed to resolve.

NOTE: One object can result in multiple errors, which requires separate steps to resolve. For instance, a `missing_references` error and a `conflict` error.
- `success` (boolean)
  Indicates a successful import. When set to `false`, some objects may not have been created. For additional information, refer to the `errors` and `successResults` properties.
- `successCount` (number)
  Indicates the number of successfully resolved records.
- `successResults` ([] object)
  Indicates the objects that are successfully imported, with any metadata if applicable.

NOTE: Objects are only created when all resolvable errors are addressed, including conflict and missing references.
#### `400`

Bad request.

`application/json`

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

#### Console

```console
POST /api/saved_objects/_resolve_import_errors
{
  "file": "file.ndjson",
  "retries": [
    {
      "id": "my-pattern",
      "overwrite": true,
      "type": "index-pattern"
    },
    {
      "destinationId": "another-vis",
      "id": "my-vis",
      "overwrite": true,
      "type": "visualization"
    },
    {
      "destinationId": "yet-another-canvas",
      "id": "my-canvas",
      "overwrite": true,
      "type": "canvas"
    },
    {
      "id": "my-dashboard",
      "type": "dashboard"
    }
  ]
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/saved_objects/_resolve_import_errors" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: multipart/form-data" \
  -d '{
  "file": "file.ndjson",
  "retries": [
    {
      "id": "my-pattern",
      "overwrite": true,
      "type": "index-pattern"
    },
    {
      "destinationId": "another-vis",
      "id": "my-vis",
      "overwrite": true,
      "type": "visualization"
    },
    {
      "destinationId": "yet-another-canvas",
      "id": "my-canvas",
      "overwrite": true,
      "type": "canvas"
    },
    {
      "id": "my-dashboard",
      "type": "dashboard"
    }
  ]
}'
```

## Response Examples

#### Resolve missing reference errors.

```json
{
  "success": true,
  "successCount": 3,
  "successResults": [
    {
      "id": "my-vis",
      "meta": {
        "icon": "visualizeApp",
        "title": "Look at my visualization"
      },
      "type": "visualization"
    },
    {
      "id": "my-search",
      "meta": {
        "icon": "searchApp",
        "title": "Look at my search"
      },
      "type": "search"
    },
    {
      "id": "my-dashboard",
      "meta": {
        "icon": "dashboardApp",
        "title": "Look at my dashboard"
      },
      "type": "dashboard"
    }
  ]
}
```

