Files

1.6 KiB

R2 API Reference

Fetch the relevant page before writing code. Use the Workers API for bucket bindings and the S3 API for S3 clients; their types and semantics differ.

Task Current documentation
Read, write, inspect, delete, or list objects; metadata, checksums, ranges, and return types Workers API reference
Implement a Worker that serves or writes objects Use R2 from Workers
Create, resume, complete, or abort multipart uploads Multipart Worker and client example
Check supported S3 operations and headers S3 compatibility
Configure an S3 JavaScript client AWS SDK for JavaScript v3
Sign temporary upload or download access Presigned URLs
Encrypt with customer-provided keys SSE-C usage
Manage buckets and objects from the command line Wrangler R2 commands

Use generated project types rather than maintaining local copies of R2 interfaces; see Workers TypeScript guidance. For pagination and conditional response handling, read gotchas.md alongside the API reference.