Cloudflare R2 Buckets API

The Buckets API from Cloudflare R2 — 2 operation(s) for buckets.

Operations 4

GET / List Buckets #
HEAD /{bucket} Head Bucket #
PUT /{bucket} Create Bucket #
DELETE /{bucket} Delete Bucket #

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-buckets-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

cloudflare-r2-buckets-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cloudflare R2 S3-Compatible Buckets API
  description: 'An S3-compatible REST API for storing and retrieving objects in Cloudflare R2 buckets. Supports core S3 operations including bucket management, object CRUD, multipart uploads, CORS configuration, lifecycle policies, and server-side encryption. Compatible with AWS S3 SDKs across Python, JavaScript, Go, Java, PHP, Ruby, and Rust. Base URL format: https://<ACCOUNT_ID>.r2.cloudflarestorage.com

    '
  version: 1.0.0
  termsOfService: https://www.cloudflare.com/website-terms/
  contact:
    name: Cloudflare R2 Documentation
    url: https://developers.cloudflare.com/r2/api/s3/api/
servers:
- url: https://{account_id}.r2.cloudflarestorage.com
  description: Cloudflare R2 S3-compatible endpoint
  variables:
    account_id:
      description: Your Cloudflare account ID
      default: YOUR_ACCOUNT_ID
security:
- hmacAuth: []
tags:
- name: Buckets
paths:
  /:
    get:
      operationId: list-buckets
      summary: List Buckets
      description: Returns a list of all buckets owned by the authenticated user.
      tags:
      - Buckets
      responses:
        '200':
          description: Success
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/ListAllMyBucketsResult'
        4XX:
          description: Error
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/Error'
  /{bucket}:
    head:
      operationId: head-bucket
      summary: Head Bucket
      description: Checks if a bucket exists and if you have access to it.
      tags:
      - Buckets
      parameters:
      - name: bucket
        in: path
        required: true
        schema:
          type: string
        description: Name of the bucket
      responses:
        '200':
          description: Bucket exists and is accessible
        '403':
          description: Access denied
        '404':
          description: Bucket not found
    put:
      operationId: create-bucket
      summary: Create Bucket
      description: Creates a new R2 bucket. The region is always 'auto' for R2.
      tags:
      - Buckets
      parameters:
      - name: bucket
        in: path
        required: true
        schema:
          type: string
        description: Name of the bucket to create
      - name: cf-r2-jurisdiction
        in: header
        required: false
        schema:
          type: string
          enum:
          - default
          - eu
          - fedramp
        description: Jurisdiction for the bucket
      responses:
        '200':
          description: Bucket created successfully
        4XX:
          description: Error
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: delete-bucket
      summary: Delete Bucket
      description: Deletes an empty R2 bucket.
      tags:
      - Buckets
      parameters:
      - name: bucket
        in: path
        required: true
        schema:
          type: string
        description: Name of the bucket to delete
      responses:
        '204':
          description: Bucket deleted successfully
        4XX:
          description: Error
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        Code:
          type: string
          description: Error code
        Message:
          type: string
          description: Human-readable error message
        Resource:
          type: string
          description: The resource that caused the error
        RequestId:
          type: string
          description: The request ID for troubleshooting
      xml:
        name: Error
    ListAllMyBucketsResult:
      type: object
      properties:
        Owner:
          type: object
          properties:
            ID:
              type: string
            DisplayName:
              type: string
        Buckets:
          type: object
          properties:
            Bucket:
              type: array
              items:
                type: object
                properties:
                  Name:
                    type: string
                    description: Bucket name
                  CreationDate:
                    type: string
                    format: date-time
                    description: Bucket creation date
      xml:
        name: ListAllMyBucketsResult
  securitySchemes:
    hmacAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'AWS Signature Version 4 authentication. Use your R2 API token (Access Key ID and Secret Access Key) generated from the R2 dashboard. Compatible with all AWS S3 SDKs.

        '
externalDocs:
  description: Cloudflare R2 S3 API Compatibility
  url: https://developers.cloudflare.com/r2/api/s3/api/