Upstash Documentation

Upsert Vectors

Upserts (inserts or updates) the vector.
2 min read
posthttps://{endpoint}/upsert/{namespace}
posthttps://{endpoint}/upsert/{namespace}
Tip

The vector will be upserted into the default namespace by default. You can use a different namespace by specifying it in the request path.

Request#

You can either upsert a single vector, or multiple vectors in an array.

idstringrequired#

The id of the vector.

vectornumber[]#
The dense vector value for dense and hybrid indexes.
Note
The vector should have the same dimensions as your index.
sparseVectorObject[]#

The sparse vector value for sparse and hybrid indexes.

Show properties
indicesnumber[]#

Indices of the non-zero valued dimensions.

valuesnumber[]#

Values of the non-zero valued dimensions.

metadataObject#

The metadata of the vector. This makes identifying vectors on retrieval easier and can be used to with filters on queries.

datastring#

The data of the vector. This is an unstructured raw text data, which can be anything associated with this vector.

Note

For dense indexes, only vector should be provided, and sparseVector should not be set.

For sparse indexes, only sparseVector should be provided, and vector should not be set.

For hybrid indexes both of vector and sparseVector must be present.

Path#

namespacestring#

The namespace to use. When no namespace is specified, the default namespace will be used.

Default: ""

Response#

resultstring#

"Success" string.