Delete one or more items by id within a namespace. Missing ids are listed in not_found_ids without failing the request. Deleting items frees global item quota immediately.
Both call the same endpoint. Use whichever matches the resource you uploaded with.API:POST /namespaces/{namespace_name}/items/delete — see Delete items
Parameters
string
required
Namespace to delete from.
array
required
Non-empty array of item id strings. Maximum 100 ids per request.
Examples
from moorcheh import MoorchehClient, MoorchehApiErrorwith MoorchehClient("http://localhost:8080") as client: result = client.documents.delete( "my-documents", ids=["doc-1", "doc-missing"], ) print(result["deleted"], result["not_found_ids"]) # 1 ['doc-missing']
A response with deleted: 0 means none of the requested ids existed — this is still a successful call, not an exception.
Returns
string
"success" when the delete request completed.
string
Human-readable result description.
string
Namespace items were deleted from.
number
Number of ids sent in the request.
number
Number of items actually removed.
array
Ids that were not found in the namespace (may be empty).
Non-2xx responses raise MoorchehApiError. Partial deletes (some ids not found) do not raise — check not_found_ids.
from moorcheh import MoorchehClient, MoorchehApiErrortry: with MoorchehClient() as client: result = client.documents.delete("my-documents", ids=["doc-1"])except MoorchehApiError as e: print(e.status_code, e.body)
Status
Cause
400
Empty ids, more than 100 ids, or empty id string
404
Namespace not found
Maximum 100 ids per request
Deleting items frees quota toward the global 100,000 item limit
A successful response with deleted: 0 means none of the requested ids existed