younifyd
Menu

Upsert documents

Upsert documents

POST/namespaces/{namespace}/documents/upsert

Use it in a workflow

  1. Add a step and choose the Pinecone connector.
  2. Pick the Upsert documents action (under Data).
  3. Fill in the fields below, then reference the result from later steps as {{upsertDocuments.response.data}}.

Request

Path parameters

namespacestringrequired

The namespace to upsert documents into.

Request body

Enter the body as JSON in the step's Body field.

documentsarray<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`.

_idstringrequired

The unique identifier for the document.

json
{
  "documents": [
    {
      "_id": "doc-1",
      "content": "Machine learning is a subset of artificial intelligence.",
      "title": "Introduction to Machine Learning"
    }
  ]
}

Response

Returns 202 with an object. Read it in later steps with {{upsertDocuments.response.data.<field>}}.

upserted_countinteger (int32)

The number of documents successfully upserted.

usageobject

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`.

embed_total_tokensinteger (int32)required

The total number of tokens Pinecone embedded for the request, summed over every embedding call it made, dense and sparse, across all fields and models. Documents aren't deduplicated by `_id` within an upsert, so every entry's text is embedded and counted, including entries that repeat an `_id`.

json
{
  "upserted_count": 2,
  "usage": {
    "embed_total_tokens": 24
  }
}

Need more? See the Pinecone guide for connection setup and behaviour shared by every action.