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.
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"
curl "https://$INDEX_HOST/vectors/upsert" \
-H "Api-Key: $PINECONE_API_KEY" \
-H 'Content-Type: application/json' \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"vectors": [
{
"id": "vec1",
"values": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1],
"metadata": {"genre": "comedy", "year": 2020}
},
{
"id": "vec2",
"values": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2],
"metadata": {"genre": "documentary", "year": 2019}
}
],
"namespace": "example-namespace"
}'POST /vectors/upsert
Parameters
Section titled “Parameters”X-Pinecone-Api-Version(header, string, required) — Required date-based version header
Request body
Section titled “Request body”vectors(body, object[], required) — An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.namespace(body, string) — The namespace where you upsert records.
Responses
Section titled “Responses”200— A successful response.400— Bad request. The request body included invalid request parameters.401— Unauthorized. Possible causes: missing or invalid API key.4XX— An unexpected error response.5XX— An unexpected error response.