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

## Description

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

Export Timelines as an NDJSON file.

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

- `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 a successful call.

`application/ndjson`

Type: `string`

#### `400`

Bad Request response.

`application/ndjson`

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

#### Console

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

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

