Patch Bucket
PATCH/accounts/{account_id}/r2/buckets/{bucket_name}
Changes the default storage class for newly uploaded objects in an existing R2 bucket. Existing objects retain their storage class, and individual uploads can override the bucket default.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Path Parameters
Patch Bucket
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/r2/buckets/$BUCKET_NAME \
-X PATCH \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"creation_date": "creation_date",
"jurisdiction": "default",
"location": "apac",
"name": "example-bucket",
"storage_class": "Standard"
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"creation_date": "creation_date",
"jurisdiction": "default",
"location": "apac",
"name": "example-bucket",
"storage_class": "Standard"
},
"success": true
}