Create Bucket
POST/accounts/{account_id}/r2/buckets
Creates an R2 bucket in the account and selected jurisdiction, with an optional location hint and default storage class.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Accepted Permissions (at least one required)
Create Bucket
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/r2/buckets \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"name": "example-bucket"
}'{
"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
}