# pip install --upgrade pinecone
import os
from pinecone import Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
index = pc.preview.index(name="articles")
NAMESPACE = "example-namespace"
index.documents.delete(namespace=NAMESPACE, ids=["doc1", "doc2"])
index.documents.delete(namespace=NAMESPACE, delete_all=True)
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="articles-abc123.svc.us-east-1.pinecone.io"
# EXAMPLE REQUEST 1: Delete by IDs
curl "https://$INDEX_HOST/namespaces/__default__/documents/delete" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-01.alpha" \
-d '{ "ids": ["doc1", "doc2"] }'
# EXAMPLE REQUEST 2: Delete all documents in a namespace
curl "https://$INDEX_HOST/namespaces/__default__/documents/delete" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-01.alpha" \
-d '{ "delete_all": true }'
// Status: 202 Accepted
{}
Documents
Delete documents
Delete documents from a namespace. Exactly one of ids or delete_all must be specified.
ids: Delete documents with the given IDs.delete_all: Delete all documents in the namespace.
POST
/
namespaces
/
{namespace}
/
documents
/
delete
# pip install --upgrade pinecone
import os
from pinecone import Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
index = pc.preview.index(name="articles")
NAMESPACE = "example-namespace"
index.documents.delete(namespace=NAMESPACE, ids=["doc1", "doc2"])
index.documents.delete(namespace=NAMESPACE, delete_all=True)
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="articles-abc123.svc.us-east-1.pinecone.io"
# EXAMPLE REQUEST 1: Delete by IDs
curl "https://$INDEX_HOST/namespaces/__default__/documents/delete" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-01.alpha" \
-d '{ "ids": ["doc1", "doc2"] }'
# EXAMPLE REQUEST 2: Delete all documents in a namespace
curl "https://$INDEX_HOST/namespaces/__default__/documents/delete" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-01.alpha" \
-d '{ "delete_all": true }'
// Status: 202 Accepted
{}
Full-text search is in public
preview and uses API version
2026-01.alpha. APIs may continue to evolve before general availability.ids or delete_all.
Delete does not accept a
filter parameter — text match operators ($match_phrase, $match_all, $match_any) and metadata filter expressions are rejected with a 400 error. To delete documents matching a metadata expression, use POST /namespaces/{namespace}/documents/search with a filter to get IDs, then pass them to delete.# pip install --upgrade pinecone
import os
from pinecone import Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
index = pc.preview.index(name="articles")
NAMESPACE = "example-namespace"
index.documents.delete(namespace=NAMESPACE, ids=["doc1", "doc2"])
index.documents.delete(namespace=NAMESPACE, delete_all=True)
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="articles-abc123.svc.us-east-1.pinecone.io"
# EXAMPLE REQUEST 1: Delete by IDs
curl "https://$INDEX_HOST/namespaces/__default__/documents/delete" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-01.alpha" \
-d '{ "ids": ["doc1", "doc2"] }'
# EXAMPLE REQUEST 2: Delete all documents in a namespace
curl "https://$INDEX_HOST/namespaces/__default__/documents/delete" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-01.alpha" \
-d '{ "delete_all": true }'
// Status: 202 Accepted
{}
Authorizations
Headers
Required date-based version header
Path Parameters
The namespace to delete documents from.
Body
application/json
The request for the delete_documents operation. Exactly one of ids or delete_all must be specified.
Response
The delete request was successfully accepted.
The response for the delete_documents operation.
Was this page helpful?
⌘I