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

# Import list items

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

## Paths

- `POST` `/api/lists/items/_import`
- `POST` `/s/{space_id}/api/lists/items/_import`

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

## Description

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

Import list items from a TXT or CSV file. The maximum file size is 9 million bytes.

You can import items to a new or existing list.

## Query String Parameters

- `list_id` (string · min: 1)
  List's id.

Required when importing to an existing list.
- `type` (enum)
  Type of the importing list.

Required when importing a new list that is `list_id` is not specified.
  Values: `binary`, `boolean`, `byte`, `date`, `date_nanos`, `date_range`, `double`, `double_range`, `float`, `float_range`, `geo_point`, `geo_shape`, `half_float`, `integer`, `integer_range`, `ip`, `ip_range`, `keyword`, `long`, `long_range`, `shape`, `short`, `text`
- `refresh` (enum)
  Determines when changes made by the request are made visible to search
  Values: `true`, `false`, `wait_for`

## Request Body

`multipart/form-data`

- `file` (string) — optional
  A `.txt` or `.csv` file containing newline separated list items

## Responses

#### `200`

Successful response

`application/json`

- `_version` (string)
- `@timestamp` (string)
- `created_at` (string)
- `created_by` (string)
- `description` (string · min: 1)
  A string that does not contain only whitespace characters
- `id` (string · min: 1)
  A string that does not contain only whitespace characters
- `immutable` (boolean)
- `meta` (object)
- `name` (string · min: 1)
  A string that does not contain only whitespace characters
- `tie_breaker_id` (string)
- `type` (enum)
  Values: `binary`, `boolean`, `byte`, `date`, `date_nanos`, `date_range`, `double`, `double_range`, `float`, `float_range`, `geo_point`, `geo_shape`, `half_float`, `integer`, `integer_range`, `ip`, `ip_range`, `keyword`, `long`, `long_range`, `shape`, `short`, `text`
- `updated_at` (string)
- `updated_by` (string)
- `version` (integer · min: 1)
#### `400`

Invalid input data response

`application/json`

One of:
- **PlatformErrorResponse**
  - `error` (string)
  - `message` (string)
  - `statusCode` (integer)
- **SiemErrorResponse**
  - `message` (string)
  - `status_code` (integer)
#### `401`

Unsuccessful authentication response

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (integer)
#### `403`

Not enough privileges response

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (integer)
#### `409`

List with specified list_id does not exist response

`application/json`

- `message` (string)
- `status_code` (integer)
#### `500`

Internal server error response

`application/json`

- `message` (string)
- `status_code` (integer)
## Code Examples

#### Console

```console
POST /api/lists/items/_import
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/lists/items/_import"
```

