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

# Export Timelines

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

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/authentication#basicauth)

## Description

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

Export Timelines as an NDJSON file.

## Query String Parameters

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

## Request Body

`application/json`

The IDs of the Timelines to export.

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

## Responses

#### `200`

Indicates a successful call.

`application/ndjson`

Type: `string`

#### `400`

Bad Request response.

`application/ndjson`

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

#### Console

```console
POST /api/timeline/_export?file_name={file_name}
{
  "ids": [
    "15c1929b-0af7-42bd-85a8-56e234cc7c4e"
  ]
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/timeline/_export?file_name={file_name}" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": [
    "15c1929b-0af7-42bd-85a8-56e234cc7c4e"
  ]
}'
```

## Response Examples

#### Single NDJSON line

```json
{"savedObjectId":"15c1929b-0af7-42bd-85a8-56e234cc7c4e","version":"WzE0LDFd","title":"Investigation","timelineType":"default"}
```

#### Export error

```json
{
  "body": "Export limit exceeded",
  "statusCode": 400
}
```

