younifyd
Menu

Delete documents

Delete documents

POST/namespaces/{namespace}/documents/delete

Use it in a workflow

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

Request

Path parameters

namespacestringrequired

The namespace to delete documents from.

Request body

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

idsarray<string>

A list of document IDs to delete. Mutually exclusive with `filter` and `delete_all`.

filterobject

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

delete_allboolean

If `true`, delete all documents in the namespace. Mutually exclusive with `ids` and `filter`. `false` is treated as if the field were omitted.

json
{
  "ids": [
    "string"
  ],
  "filter": {
    "category": {
      "$eq": "news"
    }
  },
  "delete_all": false
}

Response

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

matched_recordsinteger (int32)

The number of documents that matched `filter` when the delete was accepted. Only returned for a filtered delete, and omitted when the count could not be read in time; `0` means the filter matched no documents. The delete is applied asynchronously, so this is a point-in-time count rather than a guarantee of the number of documents ultimately deleted.

json
{
  "matched_records": 42
}

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