Cloudflare R2 R2 Bucket API

The R2 Bucket API from Cloudflare R2 — 13 operation(s) for r2 bucket.

GitHub OpenAPI
Business capability
IT Infrastructure Management BC-600.50

Operations 29

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration List R2 event notification rules · List Event Notification Rules #
Ask an LLM
“Which SQS queues are set up to receive R2 event notifications for my bucket?”
“Can I see all notification rules for an R2 bucket in one call?”
Tell an agent
List all event notification rules for bucket {bucket_name} in account {account_id}.
Show every notification rule on R2 bucket {bucket_name}.
DELETE /accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id} Delete R2 event notification rules · Delete Event Notification Rules #
Ask an LLM
“How do I stop R2 from sending events to a queue?”
“Does deleting an R2 notification rule delete all its rules at once?”
Tell an agent destructive · confirm first
Delete notification rule {queue_id} from bucket {bucket_name} in account {account_id}.
Remove R2 notification rules {ruleIds} from queue {queue_id} on bucket {bucket_name}.
GET /accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id} Get one R2 event notification rule · Get Event Notification Rule #
Ask an LLM
“How do I read a single notification rule for an R2 bucket?”
“What does one R2 event notification rule contain?”
Tell an agent
Get notification rule {queue_id} for bucket {bucket_name} in account {account_id}.
Show the R2 notification rule {queue_id} on bucket {bucket_name}.
PUT /accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id} Create an R2 event notification rule · Create Event Notification Rule #
Ask an LLM
“How do I send R2 bucket events to an SQS queue?”
“Can I create a notification rule that fires when an object is uploaded to R2?”
Tell an agent
Create notification rule {queue_id} on bucket {bucket_name} in account {account_id} with rules {rules}.
Set up R2 bucket {bucket_name} to notify queue {queue_id}.
GET /accounts/{account_id}/r2/buckets List R2 buckets · List Buckets #
Ask an LLM
“Which R2 buckets exist on my account?”
“Can I list only buckets whose name contains a word?”
Tell an agent
List all R2 buckets in account {account_id}.
Show R2 buckets on account {account_id} whose name contains {name_contains}.
POST /accounts/{account_id}/r2/buckets Create an R2 bucket · Create Bucket #
Ask an LLM
“How do I create a new R2 bucket for storing files?”
“Can I choose the storage class when creating an R2 bucket?”
Tell an agent
Create R2 bucket {name} in account {account_id}.
Create R2 bucket {name} in account {account_id} with storage class {storageClass}.
DELETE /accounts/{account_id}/r2/buckets/{bucket_name} Delete an R2 bucket · Delete Bucket #
Ask an LLM
“How do I delete an R2 bucket?”
“Can I remove an R2 bucket that still holds objects?”
Tell an agent destructive · confirm first
Delete R2 bucket {bucket_name} in account {account_id}.
Remove R2 bucket {bucket_name}.
GET /accounts/{account_id}/r2/buckets/{bucket_name} Get an R2 bucket's properties · Get Bucket #
Ask an LLM
“What are the properties of an existing R2 bucket?”
“Can I look up one R2 bucket by name?”
Tell an agent
Get R2 bucket {bucket_name} in account {account_id}.
Show the properties of R2 bucket {bucket_name}.
PATCH /accounts/{account_id}/r2/buckets/{bucket_name} Update an R2 bucket's storage class · Patch Bucket #
Ask an LLM
“How do I change the storage class of an existing R2 bucket?”
“Can I patch an R2 bucket's properties?”
Tell an agent
Patch R2 bucket {bucket_name} in account {account_id} to storage class {storageClass}.
Change the storage class of R2 bucket {bucket_name}.
DELETE /accounts/{account_id}/r2/buckets/{bucket_name}/cors Remove an R2 bucket's CORS policy · Delete Bucket CORS Policy #
Ask an LLM
“How do I remove CORS rules from an R2 bucket?”
“Can I clear the cross-origin policy on an R2 bucket?”
Tell an agent destructive · confirm first
Delete the CORS policy from R2 bucket {bucket_name} in account {account_id}.
Remove cross-origin rules on R2 bucket {bucket_name}.
GET /accounts/{account_id}/r2/buckets/{bucket_name}/cors Get an R2 bucket's CORS policy · Get Bucket CORS Policy #
Ask an LLM
“What CORS rules apply to my R2 bucket?”
“Can I read the cross-origin policy on an R2 bucket?”
Tell an agent
Get the CORS policy for R2 bucket {bucket_name} in account {account_id}.
Show cross-origin rules on R2 bucket {bucket_name}.
PUT /accounts/{account_id}/r2/buckets/{bucket_name}/cors Set an R2 bucket's CORS policy · Put Bucket CORS Policy #
Ask an LLM
“How do I allow cross-origin requests to my R2 bucket?”
“Can I set CORS rules on an R2 bucket?”
Tell an agent
Set CORS policy {rules} on R2 bucket {bucket_name} in account {account_id}.
Allow cross-origin requests on R2 bucket {bucket_name}.
GET /accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom List custom domains on an R2 bucket · List Custom Domains of Bucket #
Ask an LLM
“Which custom domains are attached to my R2 bucket?”
“Can I see every custom domain registered to an R2 bucket?”
Tell an agent
List custom domains on R2 bucket {bucket_name} in account {account_id}.
Show all custom domains attached to R2 bucket {bucket_name}.
POST /accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom Attach a custom domain to an R2 bucket · Attach Custom Domain To Bucket #
Ask an LLM
“How do I serve my R2 bucket over a custom domain?”
“Can I require a minimum TLS version on a custom domain for an R2 bucket?”
Tell an agent
Attach custom domain {domain} to R2 bucket {bucket_name} in account {account_id} on zone {zoneId}.
Enable public access at custom domain {domain} on R2 bucket {bucket_name}.
DELETE /accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain} Remove a custom domain from an R2 bucket · Remove Custom Domain From Bucket #
Ask an LLM
“How do I stop serving my R2 bucket over a custom domain?”
“Can I detach a custom domain from an R2 bucket?”
Tell an agent destructive · confirm first
Remove custom domain {domain} from R2 bucket {bucket_name} in account {account_id}.
Detach custom domain {domain} from R2 bucket {bucket_name}.
GET /accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain} Get custom domain settings on an R2 bucket · Get Custom Domain Settings #
Ask an LLM
“What TLS settings are configured on a custom domain for my R2 bucket?”
“Can I read the settings of one custom domain on an R2 bucket?”
Tell an agent
Get custom domain settings for {domain} on R2 bucket {bucket_name} in account {account_id}.
Show the TLS configuration of custom domain {domain} on R2 bucket {bucket_name}.
PUT /accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain} Update custom domain settings on an R2 bucket · Configure Custom Domain Settings #
Ask an LLM
“How do I change the minimum TLS version on a custom domain for an R2 bucket?”
“Can I disable public access on a custom domain of an R2 bucket?”
Tell an agent
Set minimum TLS version {minTLS} on custom domain {domain} of R2 bucket {bucket_name} in account {account_id}.
Disable public access on custom domain {domain} of R2 bucket {bucket_name}.
GET /accounts/{account_id}/r2/buckets/{bucket_name}/domains/managed Get public access over the r2.dev domain · Get r2.dev Domain of Bucket #
Ask an LLM
“Is my R2 bucket publicly accessible over its r2.dev domain?”
“Can I check whether the managed r2.dev domain has public access enabled?”
Tell an agent
Get public access state of the r2.dev domain for R2 bucket {bucket_name} in account {account_id}.
Check whether the r2.dev domain of R2 bucket {bucket_name} is public.
PUT /accounts/{account_id}/r2/buckets/{bucket_name}/domains/managed Enable or disable public access over r2.dev · Update r2.dev Domain of Bucket #
Ask an LLM
“How do I make my R2 bucket public over its r2.dev domain?”
“Can I turn off public access on the managed r2.dev domain?”
Tell an agent
Set public access on the r2.dev domain of R2 bucket {bucket_name} in account {account_id} to {enabled}.
Make the r2.dev domain of R2 bucket {bucket_name} public.
GET /accounts/{account_id}/r2/buckets/{bucket_name}/lifecycle Get an R2 bucket's lifecycle rules · Get Object Lifecycle Rules #
Ask an LLM
“What object lifecycle rules are set on my R2 bucket?”
“Can I read the retention and deletion rules for an R2 bucket?”
Tell an agent
Get lifecycle rules for R2 bucket {bucket_name} in account {account_id}.
Show the object lifecycle configuration of R2 bucket {bucket_name}.
PUT /accounts/{account_id}/r2/buckets/{bucket_name}/lifecycle Set object lifecycle rules for a bucket · Put Object Lifecycle Rules #
Ask an LLM
“How do I automatically expire old objects in an R2 bucket?”
“Can I set lifecycle rules that move objects to Glacier after a number of days?”
Tell an agent
Set lifecycle rules {rules} on bucket {bucket_name} in account {account_id}.
Move objects in {bucket_name} to Glacier after {days} days.
GET /accounts/{account_id}/r2/buckets/{bucket_name}/local-uploads Get a bucket's local uploads setting · Get Local Uploads Configuration #
Ask an LLM
“Is local uploads enabled for my R2 bucket?”
“Where does object data get written first when local uploads are on?”
Tell an agent
Get the local uploads configuration for bucket {bucket_name} in account {account_id}.
Check whether local uploads are enabled on {bucket_name}.
PUT /accounts/{account_id}/r2/buckets/{bucket_name}/local-uploads Turn local uploads on or off for a bucket · Put Local Uploads Configuration #
Ask an LLM
“How do I enable local uploads so objects write to the nearest region first?”
“Can I switch local uploads off for a bucket?”
Tell an agent
Set local uploads enabled to {enabled} on bucket {bucket_name} in account {account_id}.
Turn local uploads on for {bucket_name}.
GET /accounts/{account_id}/r2/buckets/{bucket_name}/lock Get a bucket's retention lock rules · Get Bucket Lock Rules #
Ask an LLM
“What retention lock rules are set on my R2 bucket?”
“Can I read the lock configuration for a bucket?”
Tell an agent
Get the lock rules for bucket {bucket_name} in account {account_id}.
Show the retention locks on {bucket_name}.
PUT /accounts/{account_id}/r2/buckets/{bucket_name}/lock Set retention lock rules on a bucket · Put Bucket Lock Rules #
Ask an LLM
“How do I set a retention lock on a bucket so objects can't be deleted?”
“Can I change the lock rules on an R2 bucket?”
Tell an agent
Set lock rules {rules} on bucket {bucket_name} in account {account_id}.
Apply retention locks to {bucket_name}.
DELETE /accounts/{account_id}/r2/buckets/{bucket_name}/sippy Disable Sippy on a bucket · Disable Sippy #
Ask an LLM
“How do I turn off Sippy on a bucket?”
“Can I disable Sippy for an R2 bucket?”
Tell an agent destructive · confirm first
Disable Sippy on bucket {bucket_name} in account {account_id}.
Turn off Sippy for {bucket_name}.
GET /accounts/{account_id}/r2/buckets/{bucket_name}/sippy Get Sippy configuration for a bucket · Get Sippy Configuration #
Ask an LLM
“Is Sippy enabled on my R2 bucket?”
“What Sippy settings does a bucket have?”
Tell an agent
Get the Sippy configuration for bucket {bucket_name} in account {account_id}.
Show Sippy settings on {bucket_name}.
PUT /accounts/{account_id}/r2/buckets/{bucket_name}/sippy Enable Sippy on a bucket · Enable Sippy #
Ask an LLM
“How do I enable Sippy on an R2 bucket?”
“Can I turn on Sippy for a bucket that already has it?”
Tell an agent
Enable Sippy on bucket {bucket_name} in account {account_id}.
Turn on Sippy for {bucket_name}.
POST /accounts/{account_id}/r2/temp-access-credentials Create temporary access credentials for a bucket · Create Temporary Access Credentials #
Ask an LLM
“How do I give a user temporary access to an R2 bucket?”
“Can I scope temporary credentials to certain prefixes or objects?”
Tell an agent
Create temporary credentials for bucket {bucket} scoped to {objects} in account {account_id}.
Issue {permission} credentials for {bucket} valid for {ttlSeconds} seconds.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/cloudflare-r2:cloudflare-r2-r2-bucket-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

cloudflare-r2-r2-bucket-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cloudflare R2 Cloudflare R2 Bucket API
  description: Cloudflare API endpoints for managing R2 object storage buckets, objects, CORS, lifecycle policies, custom domains, event notifications, data catalog, and temporary credentials.
  version: 4.0.0
  termsOfService: https://www.cloudflare.com/website-terms/
  contact:
    name: Cloudflare Developer Docs
    url: https://developers.cloudflare.com/r2/
servers:
- url: https://api.cloudflare.com/client/v4
  description: Cloudflare API v4
tags:


# --- truncated at 32 KB (79 KB total) ---
# Full source: https://artifacts.apis.io/cloudflare-r2/openapi/cloudflare-r2-r2-bucket-api-openapi.yml