# 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-04" \
-d '{
"id": "id-3",
"values": [4.0, 2.0],
"setMetadata": {"type": "comedy"},
"namespace": "example-namespace"
}'
{}
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.
# 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-04" \
-d '{
"id": "id-3",
"values": [4.0, 2.0],
"setMetadata": {"type": "comedy"},
"namespace": "example-namespace"
}'
{}
# 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-04" \
-d '{
"id": "id-3",
"values": [4.0, 2.0],
"setMetadata": {"type": "comedy"},
"namespace": "example-namespace"
}'
{}
Authorizations
Headers
Required date-based version header
Body
The request for the update operation.
Vector's unique id.
1 - 512"example-vector-1"
Vector data.
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length.
Show child attributes
Show child attributes
Metadata to set for the record.
{ "genre": "documentary", "year": 2019 }The namespace containing the record to update.
"example-namespace"
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.
{
"genre": { "$in": ["comedy", "documentary", "drama"] },
"year": { "$eq": 2019 }
}If true, return the number of records that match the filter, but do not execute the update. Default is false.
false
Response
A successful response.
The response for the update operation.
The number of records that matched the filter (if a filter was provided).
42
Was this page helpful?