---
type: api
title: Upsert multiple monitored users via CSV upload
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/operation/operation-privmonbulkuploaduserscsv
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/operation/operation-privmonbulkuploaduserscsv
products:
  - Kibana
---

# Upsert multiple monitored users via CSV upload

deprecated

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

## Paths

- `POST` `/api/entity_analytics/monitoring/users/_csv`
- `POST` `/s/{space_id}/api/entity_analytics/monitoring/users/_csv`

## Description

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

**Deprecated in 9.4.0.** Use the Watchlists API instead.

Bulk upserts privileged users by uploading a CSV file. Returns per-row errors and aggregate upload statistics.

## Authentication

- Api key: `Authorization: <value>`
  You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/docs/current/serverless/api-keys).

## Request body

`multipart/form-data`

- `file` (string · format: binary) — required
  The CSV file to upload.

## Responses

#### `200`

Bulk upload successful

`application/json`

- `errors` (object[])
  - `index` (integer) — nullable
  - `message` (string)
  - `username` (string) — nullable
- `stats` (object)
  - `failedOperations` (integer)
  - `successfulOperations` (integer)
  - `totalOperations` (integer)
  - `uploaded` (integer)
#### `413`

File too large

## Code examples

#### Console

```console
POST kbn:/api/entity_analytics/monitoring/users/_csv
{
  "file": "username,is_privileged\njohn.doe,true\njane.smith,true\n"
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/entity_analytics/monitoring/users/_csv" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: multipart/form-data" \
  -d '{
    "file": "username,is_privileged\njohn.doe,true\njane.smith,true\n"
  }'
```

## Response examples

#### Bulk upload response with mixed results

```json
{
  "errors": [
    {
      "index": 1,
      "message": "Invalid monitored field",
      "username": "john.doe"
    }
  ],
  "stats": {
    "failedOperations": 1,
    "successfulOperations": 1,
    "totalOperations": 2,
    "uploaded": 2
  }
}
```

