Cloudflare R2 Storage icon

Cloudflare R2 Storage

Interact with Cloudflare R2 object storage. Upload, download, manage files and buckets. Supports batch operations, multipart uploads, and can be used as a tool by AI Agents.

Batch Operations → Delete Multiple

AI-generated

Summary

Delete multiple objects from an R2 bucket

Inputs

  • bucketName (required) — The name of the R2 bucket to operate on.
  • objectKeys — One object key per line (max 1000 objects).

Output shape

Array of operation results, each containing a success flag and deletedCount (or error details)

Returns one result per requested object; failures include error messages when continueOnFail is disabled.

Examples

Example 1: Delete a set of files from a bucket

Bucket Name: my-r2-bucket; Object Keys: file1.txt\nfolder/file2.jpg\nanother/file3.pdf

Example 2: Remove a batch of log files

Bucket Name: logs-bucket; Object Keys: 2023-01.log\n2023-02.log\n2023-03.log

Discussion