POST
/
upsert
/
{namespace}
curl $UPSTASH_VECTOR_REST_URL/upsert \
  -X POST \
  -H "Authorization: Bearer $UPSTASH_VECTOR_REST_TOKEN" \
  -d '[ 
    { "id": "id-0", "vector": [0.1, 0.2], "metadata": { "link": "upstash.com" } }, 
    { "id": "id-1", "vector": [0.2, 0.3] }
  ]'
{
    "result": "Success"
}

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.

id
string
required

The id of the vector.

vector
number[]
required

The vector value.

The vector should have the same dimensions as your index.

metadata
Object

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

Path

namespace
string
default: ""

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

Response

result
string

"Success" string.