younifyd
Menu

Fetch documents

Fetch documents

POST/namespaces/{namespace}/documents/fetch

Use it in a workflow

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

Request

Path parameters

namespacestringrequired

The namespace to fetch documents from.

Request body

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

idsarray<string>

A list of document IDs to fetch. Mutually exclusive with `filter`.

filterobject

A metadata filter expression selecting the documents to fetch. Must not be empty; an empty filter is rejected rather than matching every document. Mutually exclusive with `ids`.

include_fieldsarray<string>

The document fields to return on each document. When omitted or empty, all fields are returned; `["*"]` also returns every field. A name the schema doesn't declare is read as a metadata key, and returns nothing for documents without that key. Naming a field whose schema sets `store_text: false` is rejected with `400`, since its text is not stored; omitting `include_fields` or passing `["*"]` leaves such fields out.

pagination_tokenstring

A pagination token from a previous fetch response, used to retrieve the next page of matching documents. Only valid together with `filter`.

limitinteger (int32)

The maximum number of documents to return per page. Only applies to a fetch by `filter`; a fetch by `ids` is already bounded by `ids` and ignores an in-range value, but a value outside 1-10000 is rejected on either form. Defaults to 100.

Default 100

json
{
  "ids": [
    "string"
  ],
  "filter": {
    "category": {
      "$eq": "news"
    }
  },
  "include_fields": [
    "string"
  ],
  "pagination_token": "string",
  "limit": 100
}

Response

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

documentsobject

A map of document IDs to their fetched documents.

paginationobject
nextstringrequired
namespacestring

The namespace the documents were fetched from: the request's namespace, or the alias's target namespace when the request named a namespace alias.

usageobject

Usage information for the `fetch_documents` operation.

read_unitsinteger (int32)required

The number of read units consumed by this operation.

egress_bytesinteger (int64)

The billed egress for this response, in bytes. Measured on the encoded response payload.

json
{
  "documents": {},
  "namespace": "my-namespace",
  "usage": {
    "egress_bytes": 1024,
    "read_units": 5
  },
  "pagination": {
    "next": "Tm90aGluZyB0byBzZWUgaGVyZQo="
  }
}

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