Skip to main content
This page shows you how to delete the data in an index namespace. The kind of index determines which operation you use. An index with a document schema uses the Documents API, and a vector index uses the Vectors API. If you aren’t sure which kind of index you have, see Adopt the Documents API.
  • Delete documents: Delete documents by ID, by metadata filter, or delete every document in the namespace.
  • Delete records: The same three options for a vector index.
Deletes consume write units (WUs). See Understanding cost for how delete cost is calculated.

Delete documents

In an index with a document schema, delete documents by ID, by metadata filter, or delete the whole namespace’s contents. A request specifies exactly one of ids, filter, or delete_all, and can name up to 1,000 IDs.

Delete documents by ID

To delete specific documents, pass their IDs:

Delete documents by metadata

To delete every document matching a metadata filter expression, pass a filter. The response reports how many documents matched:

Delete all documents in a namespace

To empty a namespace without deleting the namespace itself, pass delete_all:
A delete by ID and a delete_all return an empty response body. Only a filtered delete reports matched_records.
Text-match operators ($match_phrase, $match_all, $match_any) aren’t supported in a filtered delete, and a request carrying one is rejected with a 400. To delete documents by text match, search for them first and delete the IDs the search returns.
For the full request and response schema, see Delete documents.

Delete records

In a vector index, delete records by ID, by metadata filter, or delete every record in the namespace.

Delete records by ID

Since Pinecone records can always be efficiently accessed using their ID, deleting by ID is the most efficient way to remove specific records from a namespace.
To remove records from the default namespace, specify "__default__" as the namespace in your request.

Delete records by metadata

To delete records from a namespace based on their metadata values, pass a metadata filter expression to the delete operation. This deletes all records in the namespace that match the filter expression. For example, the following code deletes all records with a genre field set to documentary from namespace example-namespace:

Delete all records in a namespace

To delete all of the records in a namespace but not the namespace itself, provide a namespace parameter and specify the appropriate deleteAll parameter for your SDK. To target the default namespace, set namespace to "__default__".

Delete an entire namespace

To delete an entire namespace and all of its records, see Delete a namespace.

Delete an entire index

To remove all records from an index, delete the index and recreate it.

Vector delete limits

These limits apply to the Vectors API. For an index with a document schema, see Delete documents.

Delete by ID limits

Delete by metadata limits

Data freshness

Pinecone is eventually consistent, so there can be a slight delay before new or changed records are visible to queries. You can view index stats to check data freshness.