---
type: api
title: Export 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-exporttimelines
resource: https://www.elastic.co/elastic/docs-builder/docs/4268/api/doc/kibana/v8/operation/operation-exporttimelines
products:
  - Kibana
---

# Export Timelines

Authentication: required

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

## Paths

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

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

Export Timelines as an NDJSON file.

## Query string parameters

- `file_name` (string) — required
  The name of the file to export

## Request body

The IDs of the Timelines to export.

`application/json`

- `ids` (string[] · min items: 1 · max items: 1000) — optional — nullable

## Responses

#### `200`

Indicates the Timelines were successfully exported.

`application/ndjson`

Type: `string`

#### `400`

Indicates that the export size limit was exceeded.

`application/ndjson`

- `body` (string)
- `statusCode` (number)
## Code examples

#### Console

```console
POST kbn:/api/timeline/_export?file_name=FILE_NAME
{}
```

#### curl

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

## Response examples

#### 200

`application/ndjson`

#### 400

`application/ndjson`

