---
title: "POST /v1/{+index}:upsertDatapoints"
method: POST
path: "/v1/{+index}:upsertDatapoints"
tags: ["projects"]
---

# POST /v1/{+index}:upsertDatapoints

`POST /v1/{+index}:upsertDatapoints`

Add/update Datapoints into an Index.

## Path parameters

- `index` string, required

## Request body

- GoogleCloudAiplatformV1UpsertDatapointsRequest — Request message for IndexService.UpsertDatapoints
  - `updateMask` string, google-fieldmask — Optional. Update mask is used to specify the fields to be overwritten in the datapoints by the update. The fields specified in the update_mask are relative to each IndexDatapoint inside datapoints, not the full request. Updatable fields: * Use `all_restricts` to update both restricts and numeric_restricts.
  - `datapoints` GoogleCloudAiplatformV1IndexDatapoint[] — A list of datapoints to be created/updated.
    - `featureVector` number[] — Required. Feature embedding vector for dense index. An array of numbers with the length of [NearestNeighborSearchConfig.dimensions].
    - `numericRestricts` GoogleCloudAiplatformV1IndexDatapointNumericRestriction[] — Optional. List of Restrict of the datapoint, used to perform "restricted searches" where boolean rule are used to filter the subset of the database eligible for matching. This uses numeric comparisons.
      - `valueFloat` number, float — Represents 32 bit float.
      - `op` 'OPERATOR_UNSPECIFIED' | 'LESS' | 'LESS_EQUAL' | 'EQUAL' | 'GREATER_EQUAL' | 'GREATER' | 'NOT_EQUAL' — This MUST be specified for queries and must NOT be specified for datapoints.
      - `namespace` string — The namespace of this restriction. e.g.: cost.
      - `valueInt` string, int64 — Represents 64 bit integer.
      - `valueDouble` number, double — Represents 64 bit float.
    - `crowdingTag` GoogleCloudAiplatformV1IndexDatapointCrowdingTag — Crowding tag is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than some value k' of the k neighbors returned have the same value of crowding_attribute.
      - `crowdingAttribute` string — The attribute value used for crowding. The maximum number of neighbors to return per crowding attribute value (per_crowding_attribute_num_neighbors) is configured per-query. This field is ignored if per_crowding_attribute_num_neighbors is larger than the total number of neighbors to return for a given query.
    - `restricts` GoogleCloudAiplatformV1IndexDatapointRestriction[] — Optional. List of Restrict of the datapoint, used to perform "restricted searches" where boolean rule are used to filter the subset of the database eligible for matching. This uses categorical tokens. See: https://cloud.google.com/vertex-ai/docs/matching-engine/filtering
      - `denyList` string[] — The attributes to deny in this namespace. e.g.: 'blue'
      - `namespace` string — The namespace of this restriction. e.g.: color.
      - `allowList` string[] — The attributes to allow in this namespace. e.g.: 'red'
    - `embeddingMetadata` object — Optional. The key-value map of additional metadata for the datapoint.
    - `datapointId` string — Required. Unique identifier of the datapoint.
    - `sparseEmbedding` GoogleCloudAiplatformV1IndexDatapointSparseEmbedding — Feature embedding vector for sparse index. An array of numbers whose values are located in the specified dimensions.
      - `values` number[] — Required. The list of embedding values of the sparse vector.
      - `dimensions` string[] — Required. The list of indexes for the embedding values of the sparse vector.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/aiplatform.md) · [All operations](https://skmtc.net/google/apis/aiplatform/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/aiplatform/versions/b608d71b91f0/schema)
