Skip to content
Start here

Create a job

client.r2.superSlurper.jobs.create(JobCreateParams { account_id, overwrite, source, target } params, RequestOptionsoptions?): JobCreateResponse { id }
POST/accounts/{account_id}/slurper/jobs

Creates a new R2 Super Slurper migration job to transfer objects from a source bucket (e.g. S3, GCS, R2) to R2.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
params: JobCreateParams { account_id, overwrite, source, target }
account_id: string

Path param

overwrite?: boolean

Body param

source?: R2SlurperS3SourceSchema { bucket, secret, vendor, 4 more } | R2SlurperGcsSourceSchema { bucket, secret, vendor, 2 more } | R2SlurperR2SourceSchema { bucket, secret, vendor, 3 more }

Body param

One of the following:
R2SlurperS3SourceSchema { bucket, secret, vendor, 4 more }
bucket: string
secret: Secret { accessKeyId, secretAccessKey }
accessKeyId: string
secretAccessKey: string
vendor: "s3"
endpoint?: string | null
keys?: Array<string> | null
pathPrefix?: string | null
region?: string | null
R2SlurperGcsSourceSchema { bucket, secret, vendor, 2 more }
bucket: string
secret: Secret { clientEmail, privateKey }
clientEmail: string
privateKey: string
vendor: "gcs"
keys?: Array<string> | null
pathPrefix?: string | null
R2SlurperR2SourceSchema { bucket, secret, vendor, 3 more }
bucket: string
secret: Secret { accessKeyId, secretAccessKey }
accessKeyId: string
secretAccessKey: string
vendor: Provider { }
jurisdiction?: "default" | "eu" | "fedramp"
One of the following:
"default"
"eu"
"fedramp"
keys?: Array<string> | null
pathPrefix?: string | null
target?: Target

Body param

bucket: string
secret: Secret { accessKeyId, secretAccessKey }
accessKeyId: string
secretAccessKey: string
vendor: Provider { }
jurisdiction?: "default" | "eu" | "fedramp"
One of the following:
"default"
"eu"
"fedramp"
ReturnsExpand Collapse
JobCreateResponse { id }
id?: string

Create a job

import Cloudflare from 'cloudflare';

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

const job = await client.r2.superSlurper.jobs.create({ account_id: 'account_id' });

console.log(job.id);
{
  "errors": [
    {
      "code": 7003,
      "message": "No route for the URI",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {
    "id": "id"
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 7003,
      "message": "No route for the URI",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "result": {
    "id": "id"
  },
  "success": true
}