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

# Import value 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/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#basicauth)

## Description

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

Import value 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 whose 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)
  The version id, normally returned by the API when the document is retrieved. Use it ensure updates are done against the latest version.
- `@timestamp` (string)
- `created_at` (string)
  Autogenerated date of object creation.
- `created_by` (string)
  Autogenerated value - user that created object.
- `description` (string · min: 1)
  Describes the value list.
- `id` (string · min: 1)
  Value list's identifier.
- `immutable` (boolean)
- `meta` (object)
  Placeholder for metadata about the value list.
- `name` (string · min: 1)
  Value list's name.
- `tie_breaker_id` (string)
  Field used in search to ensure all containers are sorted and returned correctly.
- `type` (enum)
  Specifies the Elasticsearch data type of excludes the list container holds. Some common examples:

- `keyword`: Many ECS fields are Elasticsearch keywords
- `ip`: IP addresses
- `ip_range`: Range of IP addresses (supports IPv4, IPv6, and CIDR notation)
  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)
  Autogenerated date of last object update.
- `updated_by` (string)
  Autogenerated value - user that last updated object.
- `version` (integer · min: 1)
  The document version number.
#### `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
{
  "file": "list_values.txt"
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/lists/items/_import" \
  -H "Content-Type: multipart/form-data" \
  -d '{
  "file": "list_values.txt"
}'
```

## Response Examples

#### Ip

```json
{
  "_version": "WzAsMV0=",
  "@timestamp": "2025-01-08T04:47:34.273Z",
  "created_at": "2025-01-08T04:47:34.273Z",
  "created_by": "elastic",
  "description": "This list describes bad internet ip",
  "id": "ip_list",
  "immutable": false,
  "name": "Simple list with an ip",
  "tie_breaker_id": "f5508188-b1e9-4e6e-9662-d039a7d89899",
  "type": "ip",
  "updated_at": "2025-01-08T04:47:34.273Z",
  "updated_by": "elastic",
  "version": 1
}
```

#### Bad

```json
{
  "message": "Either type or list_id need to be defined in the query",
  "status_code": 400
}
```

#### Unauthorized

```json
{
  "error": "Unauthorized",
  "message": "[security_exception\\n\\tRoot causes:\\n\\t\\tsecurity_exception: unable to authenticate user [elastic] for REST request [/_security/_authenticate]]: unable to authenticate user [elastic] for REST request [/_security/_authenticate]",
  "statusCode": 401
}
```

#### Forbidden

```json
{
  "error": "Forbidden",
  "message": "API [POST /api/lists/items/_import?list_id=ip_list] is unauthorized for user, this action is granted by the Kibana privileges [lists-all]",
  "statusCode": 403
}
```

#### Conflict

```json
{
  "message": "List with the specified list_id does not exist, create the list or fix list_id to import to an existing one",
  "status_code": 409
}
```

#### Server error

```json
{
  "message": "Internal Server Error",
  "status_code": 500
}
```

