Skip to content
Start here

R2

R2Buckets

List Buckets
client.R2.Buckets.List(ctx, params) (*BucketListResponse, error)
GET/accounts/{account_id}/r2/buckets
Get Bucket
client.R2.Buckets.Get(ctx, bucketName, params) (*Bucket, error)
GET/accounts/{account_id}/r2/buckets/{bucket_name}
Create Bucket
client.R2.Buckets.New(ctx, params) (*Bucket, error)
POST/accounts/{account_id}/r2/buckets
Patch Bucket
client.R2.Buckets.Edit(ctx, bucketName, params) (*Bucket, error)
PATCH/accounts/{account_id}/r2/buckets/{bucket_name}
Delete Bucket
client.R2.Buckets.Delete(ctx, bucketName, params) (*BucketDeleteResponse, error)
DELETE/accounts/{account_id}/r2/buckets/{bucket_name}
ModelsExpand Collapse
type Bucket struct{…}

A single R2 bucket.

CreationDate stringoptional

Creation timestamp.

Jurisdiction BucketJurisdictionoptional

Jurisdiction where objects in this bucket are guaranteed to be stored.

One of the following:
const BucketJurisdictionDefault BucketJurisdiction = "default"
const BucketJurisdictionEu BucketJurisdiction = "eu"
const BucketJurisdictionFedramp BucketJurisdiction = "fedramp"
Location BucketLocationoptional

Location of the bucket.

One of the following:
const BucketLocationApac BucketLocation = "apac"
const BucketLocationEeur BucketLocation = "eeur"
const BucketLocationEnam BucketLocation = "enam"
const BucketLocationWeur BucketLocation = "weur"
const BucketLocationWnam BucketLocation = "wnam"
const BucketLocationOc BucketLocation = "oc"
Name stringoptional

Name of the bucket.

maxLength64
minLength3
StorageClass BucketStorageClassoptional

Storage class for newly uploaded objects, unless specified otherwise.

One of the following:
const BucketStorageClassStandard BucketStorageClass = "Standard"
const BucketStorageClassInfrequentAccess BucketStorageClass = "InfrequentAccess"

R2BucketsLifecycle

Get Object Lifecycle Rules
client.R2.Buckets.Lifecycle.Get(ctx, bucketName, params) (*BucketLifecycleGetResponse, error)
GET/accounts/{account_id}/r2/buckets/{bucket_name}/lifecycle
Put Object Lifecycle Rules
client.R2.Buckets.Lifecycle.Update(ctx, bucketName, params) (*BucketLifecycleUpdateResponse, error)
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/lifecycle

R2BucketsCORS

Get Bucket CORS Policy
client.R2.Buckets.CORS.Get(ctx, bucketName, params) (*BucketCORSGetResponse, error)
GET/accounts/{account_id}/r2/buckets/{bucket_name}/cors
Put Bucket CORS Policy
client.R2.Buckets.CORS.Update(ctx, bucketName, params) (*BucketCORSUpdateResponse, error)
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/cors
Delete Bucket CORS Policy
client.R2.Buckets.CORS.Delete(ctx, bucketName, params) (*BucketCORSDeleteResponse, error)
DELETE/accounts/{account_id}/r2/buckets/{bucket_name}/cors

R2BucketsDomains

R2BucketsDomainsCustom

List Custom Domains of Bucket
client.R2.Buckets.Domains.Custom.List(ctx, bucketName, params) (*BucketDomainCustomListResponse, error)
GET/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom
Get Custom Domain Settings
client.R2.Buckets.Domains.Custom.Get(ctx, bucketName, domain, params) (*BucketDomainCustomGetResponse, error)
GET/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}
Attach Custom Domain To Bucket
client.R2.Buckets.Domains.Custom.New(ctx, bucketName, params) (*BucketDomainCustomNewResponse, error)
POST/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom
Configure Custom Domain Settings
client.R2.Buckets.Domains.Custom.Update(ctx, bucketName, domain, params) (*BucketDomainCustomUpdateResponse, error)
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}
Remove Custom Domain From Bucket
client.R2.Buckets.Domains.Custom.Delete(ctx, bucketName, domain, params) (*BucketDomainCustomDeleteResponse, error)
DELETE/accounts/{account_id}/r2/buckets/{bucket_name}/domains/custom/{domain}

R2BucketsDomainsManaged

Get r2.dev Domain of Bucket
client.R2.Buckets.Domains.Managed.List(ctx, bucketName, params) (*BucketDomainManagedListResponse, error)
GET/accounts/{account_id}/r2/buckets/{bucket_name}/domains/managed
Update r2.dev Domain of Bucket
client.R2.Buckets.Domains.Managed.Update(ctx, bucketName, params) (*BucketDomainManagedUpdateResponse, error)
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/domains/managed

R2BucketsEvent Notifications

List Event Notification Rules
client.R2.Buckets.EventNotifications.List(ctx, bucketName, params) (*BucketEventNotificationListResponse, error)
GET/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration
Get Event Notification Rule
client.R2.Buckets.EventNotifications.Get(ctx, bucketName, queueID, params) (*BucketEventNotificationGetResponse, error)
GET/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}
Create Event Notification Rule
client.R2.Buckets.EventNotifications.Update(ctx, bucketName, queueID, params) (*BucketEventNotificationUpdateResponse, error)
PUT/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}
Delete Event Notification Rules
client.R2.Buckets.EventNotifications.Delete(ctx, bucketName, queueID, params) (*BucketEventNotificationDeleteResponse, error)
DELETE/accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}

R2BucketsLocks

Get Bucket Lock Rules
client.R2.Buckets.Locks.Get(ctx, bucketName, params) (*BucketLockGetResponse, error)
GET/accounts/{account_id}/r2/buckets/{bucket_name}/lock
Put Bucket Lock Rules
client.R2.Buckets.Locks.Update(ctx, bucketName, params) (*BucketLockUpdateResponse, error)
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/lock

R2BucketsMetrics

Get Account-Level Metrics
client.R2.Buckets.Metrics.List(ctx, query) (*BucketMetricListResponse, error)
GET/accounts/{account_id}/r2/metrics

R2BucketsSippy

Get Sippy Configuration
client.R2.Buckets.Sippy.Get(ctx, bucketName, params) (*Sippy, error)
GET/accounts/{account_id}/r2/buckets/{bucket_name}/sippy
Enable Sippy
client.R2.Buckets.Sippy.Update(ctx, bucketName, params) (*Sippy, error)
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/sippy
Disable Sippy
client.R2.Buckets.Sippy.Delete(ctx, bucketName, params) (*BucketSippyDeleteResponse, error)
DELETE/accounts/{account_id}/r2/buckets/{bucket_name}/sippy
ModelsExpand Collapse
type Provider string
type Sippy struct{…}
Destination SippyDestinationoptional

Details about the configured destination bucket.

AccessKeyID stringoptional

ID of the Cloudflare API token used when writing objects to this bucket.

Account stringoptional
Bucket stringoptional

Name of the bucket on the provider.

Provider Provideroptional
Enabled booloptional

State of Sippy for this bucket.

Source SippySourceoptional

Details about the configured source bucket.

Bucket stringoptional

Name of the bucket on the provider (AWS, GCS only).

BucketURL stringoptional

S3-compatible URL (Generic S3-compatible providers only).

Provider SippySourceProvideroptional
One of the following:
const SippySourceProviderAws SippySourceProvider = "aws"
const SippySourceProviderGcs SippySourceProvider = "gcs"
const SippySourceProviderS3 SippySourceProvider = "s3"
Region stringoptional

Region where the bucket resides (AWS only).

R2Temporary Credentials

Create Temporary Access Credentials
client.R2.TemporaryCredentials.New(ctx, params) (*TemporaryCredentialNewResponse, error)
POST/accounts/{account_id}/r2/temp-access-credentials
ModelsExpand Collapse
type TemporaryCredential struct{…}
Bucket string

Name of the R2 bucket.

ParentAccessKeyID string

The parent access key id to use for signing.

Permission TemporaryCredentialPermission

Permissions allowed on the credentials.

One of the following:
const TemporaryCredentialPermissionAdminReadWrite TemporaryCredentialPermission = "admin-read-write"
const TemporaryCredentialPermissionAdminReadOnly TemporaryCredentialPermission = "admin-read-only"
const TemporaryCredentialPermissionObjectReadWrite TemporaryCredentialPermission = "object-read-write"
const TemporaryCredentialPermissionObjectReadOnly TemporaryCredentialPermission = "object-read-only"
TTLSeconds float64

How long the credentials will live for in seconds.

maximum604800
Objects []stringoptional

Optional object paths to scope the credentials to.

Prefixes []stringoptional

Optional prefix paths to scope the credentials to.

R2Super Slurper

R2Super SlurperJobs

List jobs
client.R2.SuperSlurper.Jobs.List(ctx, params) (*SinglePage[SuperSlurperJobListResponse], error)
GET/accounts/{account_id}/slurper/jobs
Get job details
client.R2.SuperSlurper.Jobs.Get(ctx, jobID, query) (*SuperSlurperJobGetResponse, error)
GET/accounts/{account_id}/slurper/jobs/{job_id}
Create a job
client.R2.SuperSlurper.Jobs.New(ctx, params) (*SuperSlurperJobNewResponse, error)
POST/accounts/{account_id}/slurper/jobs
Abort all jobs
client.R2.SuperSlurper.Jobs.AbortAll(ctx, body) (*string, error)
PUT/accounts/{account_id}/slurper/jobs/abortAll
Abort a job
client.R2.SuperSlurper.Jobs.Abort(ctx, jobID, body) (*string, error)
PUT/accounts/{account_id}/slurper/jobs/{job_id}/abort
Pause a job
client.R2.SuperSlurper.Jobs.Pause(ctx, jobID, body) (*string, error)
PUT/accounts/{account_id}/slurper/jobs/{job_id}/pause
Get job progress
client.R2.SuperSlurper.Jobs.Progress(ctx, jobID, query) (*SuperSlurperJobProgressResponse, error)
GET/accounts/{account_id}/slurper/jobs/{job_id}/progress
Resume a job
client.R2.SuperSlurper.Jobs.Resume(ctx, jobID, body) (*string, error)
PUT/accounts/{account_id}/slurper/jobs/{job_id}/resume

R2Super SlurperJobsLogs

Get job logs
client.R2.SuperSlurper.Jobs.Logs.List(ctx, jobID, params) (*SinglePage[SuperSlurperJobLogListResponse], error)
GET/accounts/{account_id}/slurper/jobs/{job_id}/logs

R2Super SlurperConnectivity Precheck

Check source connectivity
client.R2.SuperSlurper.ConnectivityPrecheck.Source(ctx, params) (*SuperSlurperConnectivityPrecheckSourceResponse, error)
PUT/accounts/{account_id}/slurper/source/connectivity-precheck
Check target connectivity
client.R2.SuperSlurper.ConnectivityPrecheck.Target(ctx, params) (*SuperSlurperConnectivityPrecheckTargetResponse, error)
PUT/accounts/{account_id}/slurper/target/connectivity-precheck