v1

latestOpenAPI 3.0.3Apache 2.02026-07-2685172326.0 KB
Vector Operations

Upsert records

Upsert records into a namespace. If a new value is upserted for an existing record ID, it will overwrite the previous value.

For guidance, examples, and limits, see Upsert data.

post/vectors/upsert

Headers

X-Pinecone-Api-Versionstring required

Required date-based version header

Request body

namespacestring

The namespace where you upsert records.

Example request

{
  "vectors": [
    {
      "id": "example-vector-1",
      "values": [
        0.1,
        0.2,
        0.3,
        0.4,
        0.5,
        0.6,
        0.7,
        0.8
      ],
      "sparseValues": {
        "indices": [
          1,
          312,
          822,
          14,
          980
        ],
        "values": [
          0.1,
          0.2,
          0.3,
          0.4,
          0.5
        ]
      },
      "metadata": {
        "genre": "documentary",
        "year": 2019
      }
    }
  ],
  "namespace": "example-namespace"
}

Response

A successful response.

upsertedCountinteger

The number of vectors upserted.

Example response

{
  "upsertedCount": 2
}