---
type: api
title: Import Timelines
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-importtimelines
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-importtimelines
products:
  - Kibana
---

# Import Timelines

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

## Paths

- `POST` `/api/timeline/_import`
- `POST` `/s/{space_id}/api/timeline/_import`

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Import Timelines.

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

## Request body

The Timelines to import as a readable stream.

`application/json`

- `file` (object) — required
- `isImmutable` (enum) — optional
  Whether the Timeline should be immutable
  Values: `true`, `false`

## Responses

#### `200`

Indicates the import of Timelines was successful.

`application/json`

- `errors` (object[])
  The list of failed Timeline imports
  - `error` (object)
    The error containing the reason why the timeline could not be imported
    - `message` (string)
      The reason why the timeline could not be imported
    - `status_code` (number)
      The HTTP status code of the error
  - `id` (string)
    The ID of the timeline that failed to import
- `success` (boolean)
  Indicates whether any of the Timelines were successfully imports
- `success_count` (number)
  The amount of successfully imported/updated Timelines
- `timelines_installed` (number)
  The amount of successfully installed Timelines
- `timelines_updated` (number)
  The amount of successfully updated Timelines
#### `400`

Indicates the import of Timelines was unsuccessful because of an invalid file extension.

`application/json`

- `body` (string)
  The error message
- `statusCode` (number)
#### `404`

Indicates that we were unable to locate the saved object client necessary to handle the import.

`application/json`

- `body` (string)
  The error message
- `statusCode` (number)
#### `409`

Indicates the import of Timelines was unsuccessful.

`application/json`

- `body` (string)
  The error message
- `statusCode` (number)
## Code examples

#### Console

```console
POST kbn:/api/timeline/_import
{}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/timeline/_import" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{}'
```

