Cloudflare R2 icon

Cloudflare R2

Manage Cloudflare R2 buckets and objects

Folder → Delete

AI-generated

Summary

Deletes all objects in the specified Cloudflare R2 bucket whose keys start with the normalized folder prefix. The operation lists matching objects, deletes them in batches of up to 1,000, and returns the prefix and number of listed keys deleted.

Inputs

  • Bucket Name (required) — The R2 bucket containing the folder.
  • Folder Key (required) — The folder key to delete, such as images/2026. Leading and trailing slashes are removed and a trailing slash is added before matching objects.

Output shape

A single JSON item on success, containing success: true, deletedCount, and `prefix.

Deletes every listed object whose key begins with the normalized prefix, including nested contents. An empty folder key normalizes to /, so it matches keys beginning with /. Errors stop execution unless Continue On Fail is enabled; then an item with an error field is returned.

Links

Discussion