---
type: api
title: Resolve import errors
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-resolveimporterrors
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/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`

## 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

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Query string parameters

- `compatibilityMode` (boolean) — optional
  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) — optional
  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.

## Header parameters

- `kbn-xsrf` (string) — required
  Cross-site request forgery protection

## Request body

`multipart/form-data`

- `file` (string · format: binary) — 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 kbn:/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 "${KIBANA_URL}/api/saved_objects/_resolve_import_errors" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -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"
    }
  ]
}
```

