Skip to main content
POST

Authorizations

Api-Key
string
header
required

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

Headers

X-Pinecone-Api-Version
string
default:2026-07
required

Required date-based version header

Path Parameters

namespace
string
required

The namespace to update documents in.

Body

application/json

The request for the update_documents operation. Either documents or filter must be specified, and they are mutually exclusive. A filter must be accompanied by a non-empty set_fields and/or remove_fields.

An empty set_fields or remove_fields asks for no change, so it does not make a request by-filter: it is ignored, and a request that also has documents is still a valid per-ID update.

A by-filter patch is checked against the index schema the same way a per-ID patch is: a value must match the type its field declares, a field cannot be both set and removed, and a required field cannot be removed.

documents
object[]
required

The list of partial document updates to apply. Mutually exclusive with filter, and with a non-empty set_fields or remove_fields.

Required array length: 1 - 1000 elements
filter
object

A metadata filter expression selecting the documents to patch with set_fields and remove_fields. Must not be empty; an empty filter is rejected rather than matching every document. Text-match operators ($match_phrase, $match_all, $match_any) are not supported here, since documents are selected on metadata alone. Mutually exclusive with documents.

Example:
set_fields
object

The fields to set on every document matching filter, and the values to set them to. When non-empty, only valid together with filter; an empty object asks for no change and is ignored.

Example:
remove_fields
string[]

The names of the fields to remove from every document matching filter. When non-empty, only valid together with filter; an empty list asks for no change and is ignored.

Example:

Response

The update request was successfully accepted.

The response for the update_documents operation.

matched_records
integer<int32>

The number of documents that matched filter when the update was accepted. Only returned for a filtered update; a per-ID update reports no count. The patch is applied asynchronously, so this is a point-in-time count rather than a guarantee of the number of documents ultimately patched.

Example:

42