Spaces method and path for this operation:
post /s/{space_id}/api/entity_analytics/watchlists/{watchlist_id}/csv_upload
Refer to Spaces for more information.
Uploads a CSV file to add entities to a watchlist. The CSV must contain a header row with a "type" column (user, host, service, or generic) and one or more ECS identity fields (e.g. "user.name", "host.hostname") used to match entities in the entity store.
Matched entities are added to the watchlist and their entity.attributes.watchlists
field is updated in the entity store.
Each row will match up to 10,000 entities.
POST
/api/entity_analytics/watchlists/{watchlist_id}/csv_upload
curl \
--request POST 'https://localhost:5601/api/entity_analytics/watchlists/high-risk-vendors/csv_upload' \
--header "Authorization: $API_KEY" \
--header "Content-Type: multipart/form-data" \
--form "file=type,user.name
user,john.doe
user,jane.smith
"
Request example
{"file" => "type,user.name\nuser,john.doe\nuser,jane.smith\n"}
Response examples (200)
{
"failed": 1,
"items": [
{
"matchedEntities": 1,
"status": "success"
},
{
"error": "Invalid entity type",
"matchedEntities": 0,
"status": "failure"
},
{
"matchedEntities": 0,
"status": "unmatched"
}
],
"successful": 1,
"total": 3,
"unmatched": 1
}