Skip to main content
POST
Upsert fully replaces any document with the same _id, so fields you omit are removed. To change specific fields, use Update documents. If any document fails schema validation, the whole request fails and nothing is written. The namespace is created on first upsert (use __default__ if you don’t need partitioning), and documents become searchable within about a minute.

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 upsert documents into.

Body

application/json

The request for the upsert_documents operation.

documents
object[]
required

The list of documents to upsert into the namespace. At most 1000 documents, or 96 on an index whose schema declares embed or sparse_embed.

maxItems states the general limit. A client that batches documents must size batches at 96 when any field of the index schema declares embed or sparse_embed.

Required array length: 1 - 1000 elements

Response

The documents were successfully accepted for upsert.

The response for the upsert_documents operation.

upserted_count
integer<int32>
required

The number of documents successfully upserted.

Example:

2

usage
object

Usage information for the upsert_documents and update_documents operations.

Present only when the request embedded text, that is, when it wrote text to a field whose schema declares embed or sparse_embed. A request that embedded nothing returns no usage.

Example: