Skip to main content
Pinecone Docs
current

Search documentation

Type to search this documentation.

Update a record

Update records by ID or by metadata in a namespace. Updating by ID changes the vector and/or metadata of a single record. Updating by metadata changes metadata across multiple records using a metadata filter.

If a vector value is included, it will overwrite the previous value. If set_metadata is included, only the specified metadata fields are modified, and if a specified metadata field does not exist, it is added. For guidance and examples, see Update data.

curl
# 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/update" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Pinecone-Api-Version: 2026-07" \
  -d '{
        "id": "id-3",
        "values": [4.0, 2.0],
        "setMetadata": {"type": "comedy"},
        "namespace": "example-namespace"
      }'

POST /vectors/update

200
{
  "matchedRecords": 42
}
400
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
4XX
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
5XX
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
Api-Keystringrequired

An API Key is required to call Pinecone APIs. Get yours from the console.

X-Pinecone-Api-Versionstringrequired

Required date-based version header

Typestring
Default2026-07
id?string

Vector's unique id.

Required string length: 1 - 512. Example: example-vector-1

Typestring
values?number[]

Vector data.

Typenumber[]
sparseValues?object

Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length.

Typeobject
Show child attributes
indicesinteger[]required

The indices of the sparse data.

Typeinteger[]
valuesnumber[]required

The corresponding values of the sparse data, which must be with the same length as the indices.

Typenumber[]
setMetadata?object

Metadata to set for the record. Field names may not begin with $, which is reserved for filter operators.

Typeobject
namespace?string

The namespace containing the record to update.

Example: example-namespace

Typestring
filter?object

A metadata filter expression. When updating metadata across records in a namespace, the update is applied to all records that match the filter. See Understanding metadata.

dryRun?boolean

If true, return the number of records that match the filter, but do not execute the update. Default is false.

Example: false

Typeboolean
Defaultfalse

200 — A successful response.

The response for the update operation.

matchedRecords?integer

The number of records that matched the filter (if a filter was provided).

Example: 42

Typeinteger
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu