Cloudflare R2 CORS API

The CORS API from Cloudflare R2 — 1 operation(s) for cors.

Operations 3

GET /{bucket}?cors Get Bucket CORS #
PUT /{bucket}?cors Put Bucket CORS #
DELETE /{bucket}?cors Delete Bucket CORS #

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-cors-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-cors-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cloudflare R2 S3-Compatible CORS 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: CORS
paths:
  /{bucket}?cors:
    get:
      operationId: get-bucket-cors
      summary: Get Bucket CORS
      description: Returns the CORS configuration for the bucket.
      tags:
      - CORS
      parameters:
      - name: bucket
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: CORS configuration
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/CORSConfiguration'
        4XX:
          description: Error
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      operationId: put-bucket-cors
      summary: Put Bucket CORS
      description: Sets the CORS configuration for the bucket.
      tags:
      - CORS
      parameters:
      - name: bucket
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/xml:
            schema:
              $ref: '#/components/schemas/CORSConfiguration'
      responses:
        '200':
          description: CORS configuration set
        4XX:
          description: Error
          content:
            application/xml:
              schema:
                $ref: '#/components/schemas/Error'
    delete:
      operationId: delete-bucket-cors
      summary: Delete Bucket CORS
      description: Removes the CORS configuration from the bucket.
      tags:
      - CORS
      parameters:
      - name: bucket
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          description: CORS configuration deleted
        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
    CORSConfiguration:
      type: object
      properties:
        CORSRule:
          type: array
          items:
            type: object
            properties:
              AllowedHeader:
                type: array
                items:
                  type: string
              AllowedMethod:
                type: array
                items:
                  type: string
              AllowedOrigin:
                type: array
                items:
                  type: string
              ExposeHeader:
                type: array
                items:
                  type: string
              MaxAgeSeconds:
                type: integer
      xml:
        name: CORSConfiguration
  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/