Skip to content
Get started

Bulk delete documents

documents.delete_bulk(DocumentDeleteBulkParams**kwargs) -> DocumentDeleteBulkResponse
DELETE/v3/documents/bulk

Bulk delete documents by IDs or container tags

ParametersExpand Collapse
Deprecatedcontainer_tags: Optional[Sequence[str]]

Array of container tags - all documents in these containers will be deleted

filepath: Optional[str]

Delete documents matching this filepath. Exact match for full paths, prefix match if ending with /

ids: Optional[Sequence[str]]

Array of document IDs to delete (max 100 at once)

ReturnsExpand Collapse
class DocumentDeleteBulkResponse:

Response for bulk document deletion

deleted_count: float

Number of documents successfully deleted

success: bool

Whether the bulk deletion was successful

Deprecatedcontainer_tags: Optional[List[str]]

Container tags that were processed (only applicable when deleting by container tags)

errors: Optional[List[Error]]

Array of errors for documents that couldn’t be deleted (only applicable when deleting by IDs)

id: str
error: str

Bulk delete documents

import os
from supermemory import Supermemory

client = Supermemory(
    api_key=os.environ.get("SUPERMEMORY_API_KEY"),  # This is the default and can be omitted
)
response = client.documents.delete_bulk()
print(response.deleted_count)
{
  "deletedCount": 2,
  "success": true,
  "containerTags": [
    "string"
  ],
  "errors": [
    {
      "id": "id",
      "error": "error"
    }
  ]
}
Returns Examples
{
  "deletedCount": 2,
  "success": true,
  "containerTags": [
    "string"
  ],
  "errors": [
    {
      "id": "id",
      "error": "error"
    }
  ]
}