Create a list item

POST /api/lists/items

Spaces method and path for this operation:

post /s/{space_id}/api/lists/items

Refer to Spaces for more information.

Create a list item and associate it with the specified list.

All list items in the same list must be the same type. For example, each list item in an ip list must define a specific IP address.

Before creating a list item, you must create a list.

application/json

Body Required

List item's properties

  • id string(nonempty)

    A string that does not contain only whitespace characters

    Minimum length is 1.

  • list_id string(nonempty) Required

    A string that does not contain only whitespace characters

    Minimum length is 1.

  • meta object

    Additional properties are allowed.

  • refresh string

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

    Values are true, false, or wait_for.

  • value string(nonempty) Required

    A string that does not contain only whitespace characters

    Minimum length is 1.

Responses

  • 200 application/json

    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
    • deserializer string
    • id string(nonempty) Required

      A string that does not contain only whitespace characters

      Minimum length is 1.

    • list_id string(nonempty) Required

      A string that does not contain only whitespace characters

      Minimum length is 1.

    • meta object

      Additional properties are allowed.

    • serializer string
    • 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
    • value string(nonempty) Required

      A string that does not contain only whitespace characters

      Minimum length is 1.

  • 400 application/json

    Invalid input data response

    One of:
  • 401 application/json

    Unsuccessful authentication response

    Hide response attributes Show response attributes object
    • error string Required
    • message string Required
    • statusCode integer Required
  • 403 application/json

    Not enough privileges response

    Hide response attributes Show response attributes object
    • error string Required
    • message string Required
    • statusCode integer Required
  • 409 application/json

    List item already exists response

    Hide response attributes Show response attributes object
    • message string Required
    • status_code integer Required
  • 500 application/json

    Internal server error response

    Hide response attributes Show response attributes object
    • message string Required
    • status_code integer Required
POST /api/lists/items
curl \
 --request POST 'https://localhost:5601/api/lists/items' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"id":"string","list_id":"string","meta":{},"refresh":"true","value":"string"}'