---
title: "Upsert records"
method: POST
path: "/vectors/upsert"
tags: ["Vector Operations"]
---

# Upsert records

`POST /vectors/upsert`

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](https://docs.pinecone.io/guides/index-data/upsert-data).

## Headers

- `X-Pinecone-Api-Version` string, required

## Request body

- DbDataUpsertRequest — The request for the `upsert` operation.
  - `vectors` DbDataVector[], required — An array containing the vectors to upsert. Recommended batch limit is up to 1000 vectors.
    - `id` string, required — This is the vector's unique id.
    - `values` number[] — This is the vector data included in the request.
    - `sparseValues` DbDataSparseValues — Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length.
      - `indices` integer[], required — The indices of the sparse data.
      - `values` number[], required — The corresponding values of the sparse data, which must be with the same length as the indices.
    - `metadata` object — This is the metadata included in the request.
  - `namespace` string — The namespace where you upsert records.

## Response `200`

A successful response.

- DbDataUpsertResponse — The response for the `upsert` operation.
  - `upsertedCount` integer — The number of vectors upserted.

## Other responses

- `400` — Bad request. The request body included invalid request parameters.
- `4XX` — An unexpected error response.
- `5XX` — An unexpected error response.

---

[API](https://skmtc.net/pinecone/apis/pinecone-api.md) · [All operations](https://skmtc.net/pinecone/apis/pinecone-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pinecone/pinecone-api/revisions/35876583485d/schema)
