Skip to content
Start here

Enable Sippy

client.r2.buckets.sippy.update(stringbucketName, SippyUpdateParamsparams, RequestOptionsoptions?): Sippy { destination, enabled, source }
PUT/accounts/{account_id}/r2/buckets/{bucket_name}/sippy

Configures and enables Sippy on-demand migration for an R2 bucket. When a requested object is missing from R2, Sippy serves it from the configured source storage provider and copies it to R2.

Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
ParametersExpand Collapse
bucketName: string

Name of the bucket.

maxLength64
minLength3
SippyUpdateParams = R2EnableSippyAws | R2EnableSippyGcs | R2EnableSippyS3 | R2EnableSippyAzure
SippyUpdateParamsBase { account_id, destination, source, cfR2Jurisdiction }
account_id: string

Path param: Cloudflare account ID that owns the R2 resource.

maxLength32
destination?: Destination

Body param: R2 bucket to copy objects to.

accessKeyId?: string

ID of a Cloudflare API token. This is the value labelled “Access Key ID” when creating an API. token from the R2 dashboard.

Sippy will use this token when writing objects to R2, so it is best to scope this token to the bucket you’re enabling Sippy for.

provider?: Provider { }
secretAccessKey?: string

Value of a Cloudflare API token. This is the value labelled “Secret Access Key” when creating an API. token from the R2 dashboard.

Sippy will use this token when writing objects to R2, so it is best to scope this token to the bucket you’re enabling Sippy for.

source?: Source

Body param: AWS S3 bucket to copy objects from.

accessKeyId?: string

Access Key ID of an IAM credential (ideally scoped to a single S3 bucket).

bucket?: string

Name of the AWS S3 bucket.

provider?: "aws"
region?: string

AWS region containing the source S3 bucket.

secretAccessKey?: string

Secret Access Key of an IAM credential (ideally scoped to a single S3 bucket).

cfR2Jurisdiction?: "default" | "eu" | "us" | 2 more

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

One of the following:
"default"
"eu"
"us"
"fedramp"
"fedramp-high"
R2EnableSippyAws extends SippyUpdateParamsBase { account_id, destination, source, cfR2Jurisdiction }
R2EnableSippyGcs extends SippyUpdateParamsBase { account_id, destination, source, cfR2Jurisdiction }
R2EnableSippyS3 extends SippyUpdateParamsBase { account_id, destination, source, cfR2Jurisdiction }
R2EnableSippyAzure extends SippyUpdateParamsBase { account_id, destination, source, cfR2Jurisdiction }
ReturnsExpand Collapse
Sippy { destination, enabled, source }
destination?: Destination { accessKeyId, account, bucket, provider }

Details about the configured destination bucket.

accessKeyId?: string

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

account?: string
bucket?: string

Name of the bucket on the provider.

provider?: Provider { }
enabled?: boolean

State of Sippy for this bucket.

source?: Source { bucket, bucketUrl, container, 2 more }

Details about the configured source bucket.

bucket?: string | null

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

bucketUrl?: string | null

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

container?: string | null

Name of the Azure Blob Storage container (Azure only).

provider?: "aws" | "gcs" | "s3" | "azure"
One of the following:
"aws"
"gcs"
"s3"
"azure"
region?: string | null

Region where the bucket resides (AWS only).

Enable Sippy

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const sippy = await client.r2.buckets.sippy.update('example-bucket', {
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
});

console.log(sippy.destination);
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {
    "destination": {
      "accessKeyId": "accessKeyId",
      "account": "account",
      "bucket": "bucket",
      "provider": "r2"
    },
    "enabled": true,
    "source": {
      "bucket": "bucket",
      "bucketUrl": "bucketUrl",
      "container": "container",
      "provider": "aws",
      "region": "region"
    }
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {
    "destination": {
      "accessKeyId": "accessKeyId",
      "account": "account",
      "bucket": "bucket",
      "provider": "r2"
    },
    "enabled": true,
    "source": {
      "bucket": "bucket",
      "bucketUrl": "bucketUrl",
      "container": "container",
      "provider": "aws",
      "region": "region"
    }
  },
  "success": true
}