Imports list items

POST /api/lists/items/_import

Imports a list of 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 parameters

  • list_id string

    List's id.

    Required when importing to an existing list.

    Minimum length is 1. Format should match the following pattern: ^(?! *$).+$.

  • type string

    Type of the importing list.

    Required when importing a new list that is list_id is not specified.

    Values are 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, or text.

  • refresh string

    Determines when changes made by the request are made visible to search

    Values are true, false, or wait_for.

multipart/form-data; Elastic-Api-Version=2023-10-31

Body Required

  • file string(binary)

    A .txt or .csv file containing newline separated list items

Responses

  • 200 application/json; Elastic-Api-Version=2023-10-31

    Successful response

    Hide response attributes Show response attributes object
    • _version string
    • @timestamp string(date-time)
    • created_at string(date-time) Required
    • created_by string Required
    • description string Required

      A string that is not empty and does not contain only whitespace

      Minimum length is 1. Format should match the following pattern: ^(?! *$).+$.

    • id string Required

      A string that is not empty and does not contain only whitespace

      Minimum length is 1. Format should match the following pattern: ^(?! *$).+$.

    • immutable boolean Required
    • meta object
      Hide meta attribute Show meta attribute object
    • name string Required

      A string that is not empty and does not contain only whitespace

      Minimum length is 1. Format should match the following pattern: ^(?! *$).+$.

    • tie_breaker_id string Required
    • type string Required

      Values are 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, or text.

    • updated_at string(date-time) Required
    • updated_by string Required
    • version integer Required

      Minimum value is 1.

  • 400 application/json; Elastic-Api-Version=2023-10-31

    Invalid input data response

    One of:
  • 401 application/json; Elastic-Api-Version=2023-10-31

    Unsuccessful authentication response

    Hide response attributes Show response attributes object
  • 403 application/json; Elastic-Api-Version=2023-10-31

    Not enough privileges response

    Hide response attributes Show response attributes object
  • 409 application/json; Elastic-Api-Version=2023-10-31

    List with specified list_id does not exist response

    Hide response attributes Show response attributes object
  • 500 application/json; Elastic-Api-Version=2023-10-31

    Internal server error response

    Hide response attributes Show response attributes object
POST /api/lists/items/_import
curl \
 -X POST http://localhost:5601/api/lists/items/_import \
 -H "Content-Type: multipart/form-data; Elastic-Api-Version=2023-10-31"
Response examples (200)
{
  "_version": "string",
  "@timestamp": "2024-05-04T09:42:00+00:00",
  "created_at": "2024-05-04T09:42:00+00:00",
  "created_by": "string",
  "description": "string",
  "deserializer": "string",
  "id": "string",
  "immutable": true,
  "meta": {},
  "name": "string",
  "serializer": "string",
  "tie_breaker_id": "string",
  "type": "binary",
  "updated_at": "2024-05-04T09:42:00+00:00",
  "updated_by": "string",
  "version": 42
}
Response examples (400)
{
  "error": "string",
  "message": "string",
  "statusCode": 42
}
{
  "message": "string",
  "status_code": 42
}
Response examples (401)
{
  "error": "string",
  "message": "string",
  "statusCode": 42
}
Response examples (403)
{
  "error": "string",
  "message": "string",
  "statusCode": 42
}
Response examples (409)
{
  "message": "string",
  "status_code": 42
}
Response examples (500)
{
  "message": "string",
  "status_code": 42
}