Documentation Index
Fetch the complete documentation index at: https://docs.moorcheh.ai/llms.txt
Use this file to discover all available pages before exploring further.
documents.delete_files
Deletes one or more files by name from a text namespace (storage-backed uploads, for example afterdocuments.upload_file). The backend removes the file and associated derived content from the namespace.
This is not the same as documents.delete, which removes indexed text documents by ID.
Parameters
The name of the target text namespace.
Non-empty list of file names to delete (same names as returned by
documents.list_files or used at upload).Dict[str, Any] - A dictionary confirming the deletion request.
Common response fields include success, message, namespace, and results (each item: file_name, status, message). Keys are snake_case after SDK normalization.
Raises: NamespaceNotFound, InvalidInputError, AuthenticationError, APIError, MoorchehError.
Example
Delete Files Example
Async Example
Delete Files Async Example
Complete Example
Complete Delete Files Workflow
Important Notes
Per-file results: Check
results for each file_name; statuses can differ when some files exist and others do not.Multi-status (207): The API may return 207 when some deletions succeed and others do not; the SDK treats 200 and 207 as success responses.
Best Practices
- Delete only names you intend to remove; prefer listing (
documents.list_files) to confirm names first - Inspect
resultsand handlenot_found(or similar statuses) without treating the whole call as a hard failure - Batch related removals in one call when the API allows your list size
- Use
documents.deletewhen you need to remove documents by ID from the text pipeline, not raw file names
Related Operations
- Upload File - Upload files via pre-signed flow
- List Files - List raw file objects in storage
- Fetch Text Data - List ingested text and summary chunks
- Search - Query processed content
- Delete Data - Remove indexed documents by ID