Spaces method and path for this operation:
post /s/{space_id}/api/exception_lists/_import
Refer to Spaces for more information.
Import an exception list and its associated items from an NDJSON file.
Query parameters
-
Determines whether existing exception lists with the same
list_idare overwritten. If any exception items have the sameitem_id, those are also overwritten.Default value is
false. -
Determines whether the list being imported will have a new
list_idgenerated. Additionalitem_id's are generated for each exception item. Both the exception list and its items are overwritten.Default value is
false.
POST
/api/exception_lists/_import
curl \
--request POST 'https://<KIBANA_URL>/api/exception_lists/_import' \
--header "Authorization: $API_KEY" \
--header "Content-Type: multipart/form-data" \
--form "file=exception_lists.ndjson"
Request example
{"file" => "exception_lists.ndjson"}
Response examples (200)
With errors
{
"errors": [
{
"error": {
"message": "Error found importing exception list: Invalid value \\\"4\\\" supplied to \\\"list_id\\\"",
"status_code": 400
},
"list_id": "(unknown list_id)"
},
{
"error": {
"message": "Found that item_id: \\\"f7fd00bb-dba8-4c93-9d59-6cbd427b6330\\\" already exists. Import of item_id: \\\"f7fd00bb-dba8-4c93-9d59-6cbd427b6330\\\" skipped.",
"status_code": 409
},
"item_id": "f7fd00bb-dba8-4c93-9d59-6cbd427b6330",
"list_id": "7d7cccb8-db72-4667-b1f3-648efad7c1ee"
}
],
"success": "false,",
"success_count": "0,",
"success_count_exception_list_items": 0,
"success_count_exception_lists": "0,",
"success_exception_list_items": "false,",
"success_exception_lists": "false,"
}
{
"errors": [],
"success": true,
"success_count": 2,
"success_count_exception_list_items": 1,
"success_count_exception_lists": 1,
"success_exception_list_items": true,
"success_exception_lists": "true,"
}
Response examples (400)
{
"error": "Bad Request",
"message": "Multipart part `file` is required and must contain a valid .ndjson exception list export",
"statusCode": 400
}
Response examples (401)
{
"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
}
Response examples (403)
{
"error": "Forbidden",
"message": "API [POST /api/exception_lists/_import] is unauthorized for user, this action is granted by the Kibana privileges [lists-all]",
"statusCode": 403
}
Response examples (500)
{
"message": "Internal Server Error",
"status_code": 500
}