Skip to content
Start here

Objects

List Objects
GET/accounts/{account_id}/r2/buckets/{bucket_name}/objects
Get Object
GET/accounts/{account_id}/r2/buckets/{bucket_name}/objects/{object_key}
Upload Object
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/objects/{object_key}
Delete Object
DELETE/accounts/{account_id}/r2/buckets/{bucket_name}/objects/{object_key}
ModelsExpand Collapse
ObjectListResponse object { custom_metadata, etag, http_metadata, 5 more }

Metadata for an R2 object.

custom_metadata: optional map[string]

Custom metadata key-value pairs associated with the object.

etag: optional string

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.

http_metadata: optional object { cacheControl, cacheExpiry, contentDisposition, 3 more }

HTTP metadata associated with an R2 object.

cacheControl: optional string

Specifies caching behavior for the object.

cacheExpiry: optional string

The date and time at which the object’s cache entry expires.

formatdate-time
contentDisposition: optional string

Specifies presentational information for the object.

contentEncoding: optional string

Specifies the content encoding applied to the object.

contentLanguage: optional string

The language of the object content.

contentType: optional string

The MIME type of the object.

key: optional string

The object key (name).

last_modified: optional string

The date and time the object was last modified.

formatdate-time
size: optional number

The size of the object in bytes.

ssec: optional boolean

Whether the object is encrypted with a customer-supplied encryption key.

storage_class: optional "Standard" or "InfrequentAccess"

Storage class for newly uploaded objects, unless specified otherwise.

One of the following:
"Standard"
"InfrequentAccess"
ObjectUploadResponse object { etag, key, size, 3 more }

Result of a successful object upload.

etag: optional string

The entity tag for the uploaded object.

key: optional string

The key (name) of the uploaded object.

size: optional string

The size of the uploaded object in bytes (as a string).

storage_class: optional "Standard" or "InfrequentAccess"

Storage class for newly uploaded objects, unless specified otherwise.

One of the following:
"Standard"
"InfrequentAccess"
uploaded: optional string

The date and time the object was uploaded.

formatdate-time
version: optional string

The version UUID of the uploaded object.

ObjectDeleteResponse object { key }

Result of a successful object deletion.

key: optional string

The key (name) of the deleted object.