R2
R2Buckets
List Buckets
Get Bucket
Create Bucket
Patch Bucket
Delete Bucket
ModelsExpand Collapse
R2BucketsLifecycle
Get Object Lifecycle Rules
Set Object Lifecycle Rules
ModelsExpand Collapse
LifecycleGetResponse object { rules }
rules: optional array of object { id, conditions, enabled, 3 more }
abortMultipartUploadsTransition: optional object { condition } Transition to abort ongoing multipart uploads.
Transition to abort ongoing multipart uploads.
deleteObjectsTransition: optional object { condition } Transition to delete objects.
Transition to delete objects.
condition: optional object { maxAge, type } or object { date, type } Condition for lifecycle transitions to apply after an object reaches an age in seconds.
Condition for lifecycle transitions to apply after an object reaches an age in seconds.
storageClassTransitions: optional array of object { condition, storageClass } Transitions to change the storage class of objects.
Transitions to change the storage class of objects.
condition: object { maxAge, type } or object { date, type } Condition for lifecycle transitions to apply after an object reaches an age in seconds.
Condition for lifecycle transitions to apply after an object reaches an age in seconds.
R2BucketsCORS
Get Bucket CORS Policy
Set Bucket CORS Policy
Delete Bucket CORS Policy
ModelsExpand Collapse
CORSGetResponse object { rules }
rules: optional array of object { allowed, id, exposeHeaders, maxAgeSeconds }
allowed: object { methods, origins, headers } Object specifying allowed origins, methods and headers for this CORS rule.
Object specifying allowed origins, methods and headers for this CORS rule.
methods: array of "GET" or "PUT" or "POST" or 2 moreSpecifies the value for the Access-Control-Allow-Methods header R2 sets when requesting objects in a bucket from a browser.
Specifies the value for the Access-Control-Allow-Methods header R2 sets when requesting objects in a bucket from a browser.
R2BucketsDomains
R2BucketsDomainsCustom
List Custom Domains of Bucket
Get Custom Domain Settings
Attach Custom Domain To Bucket
Configure Custom Domain Settings
Remove Custom Domain From Bucket
ModelsExpand Collapse
CustomListResponse object { domains }
domains: array of object { domain, enabled, status, 4 more }
status: object { ownership, ssl }
An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.
CustomGetResponse object { domain, enabled, status, 4 more }
status: object { ownership, ssl }
An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.
R2BucketsDomainsManaged
Get r2.dev Domain of Bucket
Update r2.dev Domain of Bucket
ModelsExpand Collapse
R2BucketsEvent Notifications
List Event Notification Rules
Get Event Notification Rules for a Queue
Create Event Notification Rules
Delete Event Notification Rules
ModelsExpand Collapse
EventNotificationListResponse object { bucketName, queues }
queues: optional array of object { queueId, queueName, rules } List of queues associated with the bucket.
List of queues associated with the bucket.
rules: optional array of object { actions, createdAt, description, 3 more }
EventNotificationGetResponse object { queueId, queueName, rules }
rules: optional array of object { actions, createdAt, description, 3 more }
R2BucketsLocks
Get Bucket Lock Rules
Set Bucket Lock Rules
ModelsExpand Collapse
LockGetResponse object { rules }
rules: optional array of object { id, condition, enabled, prefix }
condition: object { maxAgeSeconds, type } or object { date, type } or object { type } Condition to apply a lock rule to an object for how long in seconds.
Condition to apply a lock rule to an object for how long in seconds.
R2BucketsMetrics
Get Account-Level Metrics
ModelsExpand Collapse
MetricListResponse object { infrequentAccess, standard } Metrics based on the class they belong to.
Metrics based on the class they belong to.
infrequentAccess: optional object { published, uploaded } Metrics based on what state they are in(uploaded or published).
Metrics based on what state they are in(uploaded or published).
R2BucketsSippy
Get Sippy Configuration
Enable Sippy
Disable Sippy
ModelsExpand Collapse
Sippy object { destination, enabled, source }
destination: optional object { accessKeyId, account, bucket, provider } Details about the configured destination bucket.
Details about the configured destination bucket.
R2BucketsObjects
List Objects
Get Object
Upload Object
Delete Object
ModelsExpand Collapse
ObjectListResponse object { custom_metadata, etag, http_metadata, 5 more } Metadata for an R2 object.
Metadata for an R2 object.
The entity tag for the object. In JSON list/get responses this is the raw
hex digest (without surrounding quotes). The HTTP ETag response header on
Get Object follows RFC 7232 and IS wrapped in surrounding double-quotes.
R2BucketsJobs
List Bucket Jobs
Create Bucket Job
Get Bucket Job
ModelsExpand Collapse
JobListResponse object { jobs, nextContinuationToken }
jobs: array of object { id, jobType, prefixDelete, 3 more } or object { id, jobType, startTime, 3 more } Bucket jobs in the current page.
Bucket jobs in the current page.
PrefixDelete object { id, jobType, prefixDelete, 3 more } Descriptor of a prefix-delete job. An empty prefix indicates a job that empties the
whole bucket.
Descriptor of a prefix-delete job. An empty prefix indicates a job that empties the whole bucket.
StorageClassMigration object { id, jobType, startTime, 3 more } Descriptor of a bucket-wide storage-class migration job.
Descriptor of a bucket-wide storage-class migration job.
status: "ENQUEUED" or "RUNNING" or "COMPLETED" or 2 moreLifecycle status of a bucket background job.
Lifecycle status of a bucket background job.
storageClassMigration: object { destinationStorageClass, migratedObjects, sourceStorageClass, 6 more }
destinationStorageClass: "Standard" or "InfrequentAccess"The storage class objects are migrated to. The source and destination storage
classes always differ.
The storage class objects are migrated to. The source and destination storage classes always differ.
Object payload bytes migrated successfully. Present for Metadata Worker jobs.
JobCreateResponse = object { id, jobType, prefixDelete, 3 more } or object { id, jobType, startTime, 3 more } Descriptor of a bucket background job, discriminated by jobType. Returned by the
Create Bucket Job, Get Bucket Job and List Bucket Jobs endpoints. A small operation can
already be COMPLETED when it is returned.
Descriptor of a bucket background job, discriminated by jobType. Returned by the
Create Bucket Job, Get Bucket Job and List Bucket Jobs endpoints. A small operation can
already be COMPLETED when it is returned.
PrefixDelete object { id, jobType, prefixDelete, 3 more } Descriptor of a prefix-delete job. An empty prefix indicates a job that empties the
whole bucket.
Descriptor of a prefix-delete job. An empty prefix indicates a job that empties the whole bucket.
StorageClassMigration object { id, jobType, startTime, 3 more } Descriptor of a bucket-wide storage-class migration job.
Descriptor of a bucket-wide storage-class migration job.
status: "ENQUEUED" or "RUNNING" or "COMPLETED" or 2 moreLifecycle status of a bucket background job.
Lifecycle status of a bucket background job.
storageClassMigration: object { destinationStorageClass, migratedObjects, sourceStorageClass, 6 more }
destinationStorageClass: "Standard" or "InfrequentAccess"The storage class objects are migrated to. The source and destination storage
classes always differ.
The storage class objects are migrated to. The source and destination storage classes always differ.
Object payload bytes migrated successfully. Present for Metadata Worker jobs.
JobGetResponse = object { id, jobType, prefixDelete, 3 more } or object { id, jobType, startTime, 3 more } Descriptor of a bucket background job, discriminated by jobType. Returned by the
Create Bucket Job, Get Bucket Job and List Bucket Jobs endpoints. A small operation can
already be COMPLETED when it is returned.
Descriptor of a bucket background job, discriminated by jobType. Returned by the
Create Bucket Job, Get Bucket Job and List Bucket Jobs endpoints. A small operation can
already be COMPLETED when it is returned.
PrefixDelete object { id, jobType, prefixDelete, 3 more } Descriptor of a prefix-delete job. An empty prefix indicates a job that empties the
whole bucket.
Descriptor of a prefix-delete job. An empty prefix indicates a job that empties the whole bucket.
StorageClassMigration object { id, jobType, startTime, 3 more } Descriptor of a bucket-wide storage-class migration job.
Descriptor of a bucket-wide storage-class migration job.
status: "ENQUEUED" or "RUNNING" or "COMPLETED" or 2 moreLifecycle status of a bucket background job.
Lifecycle status of a bucket background job.
storageClassMigration: object { destinationStorageClass, migratedObjects, sourceStorageClass, 6 more }
destinationStorageClass: "Standard" or "InfrequentAccess"The storage class objects are migrated to. The source and destination storage
classes always differ.
The storage class objects are migrated to. The source and destination storage classes always differ.
Object payload bytes migrated successfully. Present for Metadata Worker jobs.
R2Temporary Credentials
Create Temporary Access Credentials
ModelsExpand Collapse
TemporaryCredential object { bucket, parentAccessKeyId, permission, 3 more }
Access key ID of the parent R2 API token. The temporary credentials cannot exceed this token’s permissions.
permission: "admin-read-write" or "admin-read-only" or "object-read-write" or "object-read-only"Permissions allowed on the credentials.
Permissions allowed on the credentials.