Delete all files matching a prefix (bulk delete)
S3/blob-style bulk delete: remove every uploaded file whose key starts with prefix (e.g. data/2024/ deletes all files in that virtual folder). Only upload-side files are affected; sandbox output files cannot be bulk-deleted. Returns the count of files actually removed. Anthropic SDK callers can reach this via client.beta.files.with_raw_response or a plain httpx call with extra_query={...prefix: data/2024/...}.
Query parameters
Session / container identifier.
Session / container identifier.
Key prefix to delete. All uploaded files whose relative path starts with this string are removed. Must be non-empty. A trailing / is recommended to avoid accidentally deleting sibling keys that share the same prefix string (e.g. use data/2024/ not data/2024).
Key prefix to delete. All uploaded files whose relative path starts with this string are removed. Must be non-empty. A trailing / is recommended to avoid accidentally deleting sibling keys that share the same prefix string (e.g. use data/2024/ not data/2024).
Namespace to delete from. Defaults to 'session'.
Namespace to delete from. Defaults to 'session'.
Response
Successful Response
Example response
{
"deleted_count": 3,
"prefix": "data/2024/",
"type": "prefix_deleted"
}