Actions17
- Bucket Actions
- Object Actions
- Batch Operations Actions
Object → Copy
AI-generatedSummary
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
successfield and amessage; theobjectfield 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.