---
type: api
title: Create a list
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-createlist
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v8/operation/operation-createlist
products:
  - Kibana
---

# Create a list

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

## Paths

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

## Description

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

Create a new list.

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

## Request body

List's properties

`application/json`

- `description` (string · format: nonempty · min length: 1) — required
  A string that does not contain only whitespace characters
- `id` (string · format: nonempty · min length: 1) — optional
  A string that does not contain only whitespace characters
- `meta` (object) — optional
- `name` (string · format: nonempty · min length: 1) — required
  A string that does not contain only whitespace characters
- `type` (enum) — required
  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`
- `version` (integer · min: 1 · default: 1) — optional

## Responses

#### `200`

Successful response

`application/json`

- `_version` (string)
- `@timestamp` (string · format: date-time)
- `created_at` (string · format: date-time)
- `created_by` (string)
- `description` (string · format: nonempty · min length: 1)
  A string that does not contain only whitespace characters
- `id` (string · format: nonempty · min length: 1)
  A string that does not contain only whitespace characters
- `immutable` (boolean)
- `meta` (object)
- `name` (string · format: nonempty · min length: 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 · format: date-time)
- `updated_by` (string)
- `version` (integer · min: 1)
#### `400`

Invalid input data response

`application/json`

One of:
- **{ error, statusCode }**
  - `error` (string)
  - `message` (string)
  - `statusCode` (integer)
- **{ status_code }**
  - `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 already exists 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 kbn:/api/lists
{
  "description": "This list describes bad internet ips",
  "id": "ip_list",
  "name": "Simple list with ips",
  "type": "ip"
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/lists" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "This list describes bad internet ips",
    "id": "ip_list",
    "name": "Simple list with ips",
    "type": "ip"
  }'
```

## 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 ips",
  "id": "ip_list",
  "immutable": false,
  "name": "Simple list with ips",
  "tie_breaker_id": "f5508188-b1e9-4e6e-9662-d039a7d89899",
  "type": "ip",
  "updated_at": "2025-01-08T04:47:34.273Z",
  "updated_by": "elastic",
  "version": 1
}
```

#### Ip range

```json
{
  "_version": "WzAsMV0=",
  "@timestamp": "2025-01-09T18:23:52.241Z",
  "created_at": "2025-01-09T18:23:52.241Z",
  "created_by": "elastic",
  "description": "This list has ip ranges",
  "id": "ip_range_list",
  "immutable": false,
  "name": "Simple list with ip ranges",
  "tie_breaker_id": "74aebdaf-601f-4940-b351-155728ff7003",
  "type": "ip_range",
  "updated_at": "2025-01-09T18:23:52.241Z",
  "updated_by": "elastic",
  "version": 1
}
```

#### Keyword

```json
{
  "_version": "WzEsMV0=",
  "@timestamp": "2025-01-09T18:24:55.786Z",
  "created_at": "2025-01-09T18:24:55.786Z",
  "created_by": "elastic",
  "description": "This list describes bad host names",
  "id": "keyword_list",
  "immutable": false,
  "name": "Simple list with a keyword",
  "tie_breaker_id": "f7e7dbaa-daf7-4c9a-a3dc-56643923ef68",
  "type": "keyword",
  "updated_at": "2025-01-09T18:24:55.786Z",
  "updated_by": "elastic",
  "version": 1
}
```

#### Keyword custom format

```json
{
  "_version": "WzIsMV0=",
  "@timestamp": "2025-01-09T18:25:39.604Z",
  "created_at": "2025-01-09T18:25:39.604Z",
  "created_by": "elastic",
  "description": "This parses the first found ipv4 only",
  "id": "keyword_custom_format_list",
  "immutable": false,
  "name": "Simple list with a keyword using a custom format",
  "tie_breaker_id": "8247ae63-b780-47b8-9a89-948b643e9ec2",
  "type": "keyword",
  "updated_at": "2025-01-09T18:25:39.604Z",
  "updated_by": "elastic",
  "version": 1
}
```

