POST
/
vectors
/
upsert
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"

curl -X POST "https://$INDEX_HOST/vectors/upsert" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
        "vectors": [
          {
            "id": "vec1",
            "values": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
            "sparseValues": {
              "indices": [2, 7],
              "values": [0.4, 0.5]
            },
            "metatdata": {
              "genre": "drama"
            }
          },
          {
            "id": "vec2",
            "values": [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
            "sparseValues": {
              "indices": [1, 4],
              "values": [0.1, 0.2]
            },
            "metadata": {
              "genre": "action"
            }
          }
        ]
      }'
{
  "upsertedCount": 2
}

Authorizations

Api-Key
string
headerrequired

An API Key is required to call Pinecone APIs. Get yours at https://app.pinecone.io/.

Body

application/json
namespace
string

This is the namespace name where you upsert vectors.

vectors
object[]
required

An array containing the vectors to upsert. Recommended batch limit is 100 vectors.

Response

200 - application/json
upsertedCount
integer

The number of vectors upserted.

Was this page helpful?