# Upsert Data Vector Index

Launch stage: GA

`POST /api/2.0/vector-search/indexes/{name}/upsert-data`

Handles the upserting of data into a specified vector index.

API scopes: vector-search

## Path parameters

- `name` (string, optional)
  Name of the vector index where data is to be upserted. Must be a Direct Vector Access Index.

## Request body

- `inputs_json` (string, optional)
  JSON string representing the data to be upserted.

## Returns

- `status` (string, optional)
  Status of the upsert operation.
  Possible values: `SUCCESS`, `PARTIAL_SUCCESS`, `FAILURE`
- `result` (object, optional)
  Result of the upsert or delete operation.
  - `success_row_count` (int64, optional)
    Count of successfully processed rows.
  - `failed_primary_keys` (array of string, optional)
    List of primary keys for rows that failed to process.

## Request

### Upsert a single row of data.

```json
{
  "inputs_json": "[{\"id\": \"1\", \"text\": \"hello world\", \"text_vector\": [1.0, 2.0, 3.0]}]"
}
```

### Upsert multiple rows of data.

```json
{
  "inputs_json": "[{\"id\": \"1\", \"text\": \"hello world\", \"text_vector\": [1.0, 2.0, 3.0]}, {\"id\": \"2\", \"text\": \"hello world\", \"text_vector\": [1.0, 2.0, 3.0]}]"
}
```

## Response

### Failed response for upsert operation.

```json
{
  "result": {
    "failed_primary_keys": [
      "1"
    ],
    "success_row_count": 0
  },
  "status": "FAILURE"
}
```

### Partial success response for upsert operation.

```json
{
  "result": {
    "failed_primary_keys": [
      "1"
    ],
    "success_row_count": 1
  },
  "status": "PARTIAL_SUCCESS"
}
```

### Successful response for upsert operation.

```json
{
  "result": {
    "failed_primary_keys": [],
    "success_row_count": 1
  },
  "status": "SUCCESS"
}
```

