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

# Import Timelines

Authentication: required

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

## Paths

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

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

## Description

Import Timelines.

## 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 '{}'
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "errors": [
    {
      "error": {
        "message": "Malformed JSON",
        "status_code": 400
      },
      "id": "6ce1b592-84e3-4b4a-9552-f189d4b82075"
    }
  ],
  "success": false,
  "success_count": 99,
  "timelines_installed": 80,
  "timelines_updated": 19
}
```

#### 400

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "body": "Invalid file extension",
  "statusCode": 400
}
```

#### 404

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "body": "Unable to find saved object client",
  "statusCode": 404
}
```

#### 409

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "body": "Could not import timelines",
  "statusCode": 409
}
```

