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.

Object → Copy

AI-generated

Summary

Copy an R2 object to a new location within or across buckets.

Inputs

  • bucketName (required) — The name of the R2 bucket to operate on.
  • sourceBucket — Source bucket name (if different from destination)
  • sourceKey (required) — Source object key
  • destinationKey (required) — Destination object key

Output shape

object containing success flag, message, and copied object details

Success is indicated by a success field and a message; the object field holds the copied object metadata. No pagination; may include an error envelope on failure.

Examples

Example 1: Copy a file from one bucket to another

Set sourceBucket, sourceKey, destinationKey, and bucketName (destination bucket); choose Operation=Copy.

Example 2: Copy an object to a new key in the same bucket

Leave sourceBucket empty; set bucketName to the bucket, provide sourceKey and destinationKey; choose Operation=Copy.

Example 3: Copy across buckets with optional sourceBucket

Provide sourceBucket when copying across buckets; fill sourceKey, destinationKey, and bucketName (destination bucket); choose Operation=Copy.

Discussion